Skip to content

Commit

Permalink
[darwin-framework-tool] Use per commissioner storage by default inste… (
Browse files Browse the repository at this point in the history
project-chip#36194)

* [darwin-framework-tool] Make the issuerId of the root certificate constant

* [darwin-framework-tool] Use per commissioner storage by default instead of shared storage
  • Loading branch information
vivien-apple authored Oct 28, 2024
1 parent ac43b68 commit 17a2aad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CHIPCommandBridge : public Command {
"commissioner-name. Interactive mode will only set a single commissioner on the inital command. "
"The commissioner node ID will be persisted until a different one is specified.");
AddArgument("commissioner-shared-storage", 0, 1, &mCommissionerSharedStorage,
"Use a shared storage instance instead of individual storage for each commissioner. Default is true.");
"Use a shared storage instance instead of individual storage for each commissioner. Default is false.");
AddArgument("paa-trust-store-path", &mPaaTrustStorePath,
"Path to directory holding PAA certificate information. Can be absolute or relative to the current working "
"directory.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
productAttestationAuthorityCertificates = nil;
}

sUseSharedStorage = mCommissionerSharedStorage.ValueOr(true);
sUseSharedStorage = mCommissionerSharedStorage.ValueOr(false);
if (sUseSharedStorage) {
return SetUpStackWithSharedStorage(productAttestationAuthorityCertificates);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include <lib/support/logging/CHIPLogging.h>

constexpr const uint32_t kIssuerId = 12345678;

@interface CertificateIssuer ()
- (MTRCertificateDERBytes _Nullable)issueOperationalCertificateForNodeID:(NSNumber *)nodeID
fabricID:(NSNumber *)fabricID
Expand Down Expand Up @@ -67,7 +69,7 @@ - (void)startWithStorage:(id<MTRStorage>)storage
return;
}

__auto_type * rootCertificate = [MTRCertificates createRootCertificate:signingKey issuerID:nil fabricID:nil error:error];
__auto_type * rootCertificate = [MTRCertificates createRootCertificate:signingKey issuerID:@(kIssuerId) fabricID:nil error:error];
if (nil == rootCertificate) {
*error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating root certificate" }];
return;
Expand Down

0 comments on commit 17a2aad

Please sign in to comment.