From 6484899c0796f7c5a3f78d189b309ada254d1b5b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 5 Dec 2024 22:27:34 +0100 Subject: [PATCH] [darwin-framework-tool] Update CHIPToolKeyPair implementation to not use matter sdk specific APIs but native APIS (#36723) --- examples/darwin-framework-tool/BUILD.gn | 2 +- .../commands/common/CHIPCommandBridge.mm | 2 +- .../commands/common/CHIPToolKeypair.mm | 193 -------------- .../commands/common/CertificateIssuer.mm | 21 +- .../{CHIPToolKeypair.h => DFTKeypair.h} | 16 +- .../commands/common/DFTKeypair.mm | 243 ++++++++++++++++++ .../Matter.xcodeproj/project.pbxproj | 16 +- 7 files changed, 268 insertions(+), 225 deletions(-) delete mode 100644 examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm rename examples/darwin-framework-tool/commands/common/{CHIPToolKeypair.h => DFTKeypair.h} (68%) create mode 100644 examples/darwin-framework-tool/commands/common/DFTKeypair.mm diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 257431b2425aec..07b45733161761 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -200,11 +200,11 @@ executable("darwin-framework-tool") { "commands/clusters/WriteAttributeCommandBridge.h", "commands/common/CHIPCommandBridge.mm", "commands/common/CHIPCommandStorageDelegate.mm", - "commands/common/CHIPToolKeypair.mm", "commands/common/CertificateIssuer.h", "commands/common/CertificateIssuer.mm", "commands/common/ControllerStorage.h", "commands/common/ControllerStorage.mm", + "commands/common/DFTKeypair.mm", "commands/common/DeviceDelegate.h", "commands/common/DeviceDelegate.mm", "commands/common/MTRDevice_Externs.h", diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 6b9dfcec29be9e..0eb7d60a89eb24 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -18,7 +18,7 @@ #include "CHIPCommandBridge.h" -#import "CHIPToolKeypair.h" +#import "DFTKeypair.h" #import #include diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm deleted file mode 100644 index a09975d68da41f..00000000000000 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2024 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#import "CHIPToolKeypair.h" -#import -#include -#include -#include -#include - -#import "CHIPCommandStorageDelegate.h" -#import "ControllerStorage.h" - -#define CHIPPlugin_CAKeyTag "com.apple.matter.commissioner.ca.issuer.id" -#define Public_KeySize "256" - -static NSString * const kCHIPToolKeychainLabel = @"Chip Tool Keypair"; -static NSString * const kOperationalCredentialsIssuerKeypairStorage = @"ChipToolOpCredsCAKey"; -static NSString * const kOperationalCredentialsIPK = @"ChipToolOpCredsIPK"; - -@implementation CHIPToolKeypair { - chip::Crypto::P256Keypair _mKeyPair; - chip::Crypto::P256Keypair _mIssuer; - NSData * _ipk; - uint32_t _mNow; - SecKeyRef _mPublicKey; -} - -- (instancetype)init -{ - if (self = [super init]) { - _mNow = 0; - } - return self; -} - -- (BOOL)initialize -{ - return _mKeyPair.Initialize(chip::Crypto::ECPKeyTarget::ECDSA) == CHIP_NO_ERROR; -} - -- (NSData *)signMessageECDSA_RAW:(NSData *)message -{ - chip::Crypto::P256ECDSASignature signature; - NSData * out_signature; - CHIP_ERROR signing_error = _mKeyPair.ECDSA_sign_msg((const uint8_t *) [message bytes], (size_t)[message length], signature); - if (signing_error != CHIP_NO_ERROR) - return nil; - out_signature = [NSData dataWithBytes:signature.Bytes() length:signature.Length()]; - return out_signature; -} - -- (SecKeyRef)copyPublicKey -{ - if (_mPublicKey == nil) { - chip::Crypto::P256PublicKey publicKey = _mKeyPair.Pubkey(); - NSData * publicKeyNSData = [NSData dataWithBytes:publicKey.Bytes() length:publicKey.Length()]; - NSDictionary * attributes = @{ - (__bridge NSString *) kSecAttrKeyClass : (__bridge NSString *) kSecAttrKeyClassPublic, - (NSString *) kSecAttrKeyType : (NSString *) kSecAttrKeyTypeECSECPrimeRandom, - (NSString *) kSecAttrKeySizeInBits : @Public_KeySize, - (NSString *) kSecAttrLabel : kCHIPToolKeychainLabel, - (NSString *) kSecAttrApplicationTag : @CHIPPlugin_CAKeyTag, - }; - _mPublicKey = SecKeyCreateWithData((__bridge CFDataRef) publicKeyNSData, (__bridge CFDictionaryRef) attributes, nullptr); - } - - if (_mPublicKey) { - CFRetain(_mPublicKey); - return _mPublicKey; - } - - return NULL; -} - -- (CHIP_ERROR)Deserialize:(chip::Crypto::P256SerializedKeypair &)input -{ - return _mKeyPair.Deserialize(input); -} - -- (CHIP_ERROR)Serialize:(chip::Crypto::P256SerializedKeypair &)output -{ - return _mKeyPair.Serialize(output); -} - -- (NSData *)getIPK -{ - return _ipk; -} - -- (CHIP_ERROR)createOrLoadKeys:(id)storage -{ - chip::ASN1::ASN1UniversalTime effectiveTime; - chip::Crypto::P256SerializedKeypair serializedKey; - - // Initializing the default start validity to start of 2021. The default validity duration is 10 years. - CHIP_ZERO_AT(effectiveTime); - effectiveTime.Year = 2021; - effectiveTime.Month = 1; - effectiveTime.Day = 1; - ReturnErrorOnFailure(chip::Credentials::ASN1ToChipEpochTime(effectiveTime, _mNow)); - - __auto_type * value = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage]; - __auto_type err = [self initSerializedKeyFromValue:value serializedKey:serializedKey]; - - if (err != CHIP_NO_ERROR) { - // Storage doesn't have an existing keypair. Let's create one and add it to the storage. - if (![self initialize]) { - return CHIP_ERROR_INTERNAL; - } - ReturnErrorOnFailure([self Serialize:serializedKey]); - - NSData * valueData = [NSData dataWithBytes:serializedKey.Bytes() length:serializedKey.Length()]; - [self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage value:valueData]; - } else { - ReturnErrorOnFailure([self Deserialize:serializedKey]); - } - - NSData * ipk = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIPK]; - if (ipk == nil) { - err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; - } - if (err != CHIP_NO_ERROR) { - uint8_t tempIPK[chip::Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES]; - - ReturnLogErrorOnFailure(chip::Crypto::DRBG_get_bytes(tempIPK, sizeof(tempIPK))); - - _ipk = [NSData dataWithBytes:tempIPK length:sizeof(tempIPK)]; - [self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIPK value:_ipk]; - } else { - _ipk = ipk; - } - - return CHIP_NO_ERROR; -} - -- (NSData *)_getValueForKeyWithStorage:(id)storage key:(NSString *)key -{ - if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { - return [storage storageDataForKey:key]; - } else if ([storage isKindOfClass:[ControllerStorage class]]) { - return [storage valueForKey:key]; - } - return nil; -} - -- (void)_setValueForKeyWithStorage:(id)storage key:(NSString *)key value:(NSData *)value -{ - if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { - [storage setStorageData:value forKey:key]; - } else if ([storage isKindOfClass:[ControllerStorage class]]) { - [storage storeValue:value forKey:key]; - } -} - -- (CHIP_ERROR)initSerializedKeyFromValue:(NSData *)value serializedKey:(chip::Crypto::P256SerializedKeypair &)serializedKey -{ - if (value == nil) { - return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; - } - - if (serializedKey.Capacity() < [value length]) { - return CHIP_ERROR_BUFFER_TOO_SMALL; - } - - memcpy(serializedKey.Bytes(), [value bytes], [value length]); - serializedKey.SetLength([value length]); - return CHIP_NO_ERROR; -} - -- (void)dealloc -{ - if (_mPublicKey) { - CFRelease(_mPublicKey); - } -} - -@end diff --git a/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm b/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm index c86a41490b08c5..5a0e9bce10f985 100644 --- a/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm +++ b/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm @@ -17,7 +17,7 @@ */ #import "CertificateIssuer.h" -#import "CHIPToolKeypair.h" +#import "DFTKeypair.h" #include @@ -61,17 +61,13 @@ - (instancetype)init - (void)startWithStorage:(id)storage error:(NSError * _Nullable __autoreleasing * _Nonnull)error { - __auto_type * signingKey = [[CHIPToolKeypair alloc] init]; - - __auto_type err = [signingKey createOrLoadKeys:storage]; - if (CHIP_NO_ERROR != err) { - *error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating or loading keys" }]; + __auto_type * signingKey = [DFTKeypair createKeypairWithStorage:storage error:error]; + if (!signingKey) { return; } __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" }]; + if (!rootCertificate) { return; } @@ -82,15 +78,12 @@ - (void)startWithStorage:(id)storage - (id)issueOperationalKeypairWithControllerStorage:(ControllerStorage *)storage error:(NSError * _Nullable __autoreleasing * _Nonnull)error { - __auto_type * keypair = [[CHIPToolKeypair alloc] init]; - - __auto_type err = [keypair createOrLoadKeys:storage]; - if (CHIP_NO_ERROR != err) { - *error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating or loading keys" }]; + __auto_type * signingKey = [DFTKeypair createKeypairWithStorage:storage error:error]; + if (!signingKey) { return nil; } - return keypair; + return signingKey; } - (void)issueOperationalCertificateForRequest:(MTROperationalCSRInfo *)csrInfo diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h b/examples/darwin-framework-tool/commands/common/DFTKeypair.h similarity index 68% rename from examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h rename to examples/darwin-framework-tool/commands/common/DFTKeypair.h index 58be7f2ac4b041..3026696482a685 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h +++ b/examples/darwin-framework-tool/commands/common/DFTKeypair.h @@ -17,15 +17,15 @@ */ #import -#include -@interface CHIPToolKeypair : NSObject -- (BOOL)initialize; -- (NSData *)signMessageECDSA_RAW:(NSData *)message; +NS_ASSUME_NONNULL_BEGIN + +@interface DFTKeypair : NSObject +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)createKeypairWithStorage:(id)storage error:(NSError * _Nullable __autoreleasing *)error; +- (NSData *)signMessageECDSA_DER:(NSData *)message; - (SecKeyRef)copyPublicKey; -- (CHIP_ERROR)Serialize:(chip::Crypto::P256SerializedKeypair &)output; -- (CHIP_ERROR)Deserialize:(chip::Crypto::P256SerializedKeypair &)input; -- (CHIP_ERROR)createOrLoadKeys:(id)storage; - (NSData *)getIPK; - @end + +NS_ASSUME_NONNULL_END diff --git a/examples/darwin-framework-tool/commands/common/DFTKeypair.mm b/examples/darwin-framework-tool/commands/common/DFTKeypair.mm new file mode 100644 index 00000000000000..ade29c03b2e4d4 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/DFTKeypair.mm @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "DFTKeypair.h" + +#import "CHIPCommandStorageDelegate.h" +#import "ControllerStorage.h" + +#define CAKeyTag "com.apple.matter.commissioner.ca.issuer.id" +#define KeySize "256" +#define CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES 16 + +// Note: The following constants are used for storing keychain and operational credentials. +// To maintain backward compatibility with existing keychain entries and preferences, +// these constants still mention "Chip Tool". +static NSString * const kKeychainLabel = @"Chip Tool Keypair"; +static NSString * const kOperationalCredentialsIssuerKeypairStorage = @"ChipToolOpCredsCAKey"; +static NSString * const kOperationalCredentialsIPK = @"ChipToolOpCredsIPK"; + +// Error Descriptions +NSString * const kErrorDomain = @"Error"; +NSString * const kErrorFailedToStoreKeypairData = @"Failed to store keypair data in storage."; +NSString * const kErrorInvalidIPKData = @"Invalid IPK data."; +NSString * const kErrorFailedToGenerateIPK = @"Failed to generate random bytes for IPK."; +NSString * const kErrorFailedToStoreIPK = @"Failed to store IPK in storage."; +NSString * const kPublicKeyRetrievalFailureReason = @"Failed to retrieve the public key from the private key. This may occur if the private key was created without storing the corresponding public key in the keychain, or if the system cannot reconstruct the public key."; + +@interface DFTKeypair () +@property (readonly) SecKeyRef privateKey; +@property (readonly) SecKeyRef publicKey; +@property (readonly) NSData * ipk; +@end + +@implementation DFTKeypair ++ (instancetype)createKeypairWithStorage:(id)storage error:(NSError * _Nullable __autoreleasing *)error +{ + __auto_type * keypair = [[self alloc] init]; + if (![keypair setupKeys:storage error:error] || ![keypair setupIPK:storage error:error]) { + return nil; + } + + return keypair; +} + +- (NSData *)signMessageECDSA_DER:(NSData *)message +{ + if (!_privateKey) { + NSLog(@"Error: Private key is not available for signing."); + return nil; + } + + CFErrorRef cfError = NULL; + CFDataRef signatureData = SecKeyCreateSignature(_privateKey, + kSecKeyAlgorithmECDSASignatureMessageX962SHA256, + (__bridge CFDataRef) message, + &cfError); + + if (!signatureData) { + NSError * error = (__bridge_transfer NSError *) cfError; + NSLog(@"Error: Failed to sign message: %@", error.localizedDescription); + return nil; + } + + return (__bridge_transfer NSData *) signatureData; +} + +- (SecKeyRef)copyPublicKey +{ + if (_publicKey) { + CFRetain(_publicKey); + return _publicKey; + } + + return nil; +} + +- (BOOL)setupKeys:(id)storage error:(NSError * _Nonnull __autoreleasing *)error +{ + __auto_type * keypairData = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage]; + return keypairData ? [self loadKeys:keypairData error:error] : [self createKeys:storage error:error]; +} + +- (BOOL)loadKeys:(NSData *)keypairData error:(NSError * _Nonnull __autoreleasing *)error +{ + NSDictionary * const attributes = @{ + (NSString *) kSecAttrKeyClass : (NSString *) kSecAttrKeyClassPrivate, + (NSString *) kSecAttrKeyType : (NSString *) kSecAttrKeyTypeECSECPrimeRandom, + (NSString *) kSecAttrKeySizeInBits : @KeySize, + (NSString *) kSecAttrLabel : kKeychainLabel, + (NSString *) kSecAttrApplicationTag : [@CAKeyTag dataUsingEncoding:NSUTF8StringEncoding], + }; + + CFErrorRef cfError = NULL; + __auto_type * privateKey = SecKeyCreateWithData((__bridge CFDataRef) keypairData, (__bridge CFDictionaryRef) attributes, &cfError); + if (!privateKey) { + *error = (__bridge_transfer NSError *) cfError; + return NO; + } + + __auto_type * publicKey = SecKeyCopyPublicKey(privateKey); + if (!publicKey) { + CFRelease(privateKey); + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kPublicKeyRetrievalFailureReason }]; + return NO; + } + + _privateKey = privateKey; + _publicKey = publicKey; + return YES; +} + +- (BOOL)createKeys:(id)storage error:(NSError * _Nonnull __autoreleasing *)error +{ + NSDictionary * const attributes = @{ + (NSString *) kSecAttrKeyType : (NSString *) kSecAttrKeyTypeECSECPrimeRandom, + (NSString *) kSecAttrKeySizeInBits : @KeySize, + (NSString *) kSecAttrLabel : kKeychainLabel, + (NSString *) kSecAttrApplicationTag : [@CAKeyTag dataUsingEncoding:NSUTF8StringEncoding], + }; + + CFErrorRef cfError = NULL; + __auto_type * privateKey = SecKeyCreateRandomKey((__bridge CFDictionaryRef) attributes, &cfError); + if (!privateKey) { + *error = (__bridge_transfer NSError *) cfError; + return NO; + } + + __auto_type * publicKey = SecKeyCopyPublicKey(privateKey); + if (!publicKey) { + CFRelease(privateKey); + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kPublicKeyRetrievalFailureReason }]; + return NO; + } + + __auto_type * keypairData = (__bridge_transfer NSData *) SecKeyCopyExternalRepresentation(privateKey, &cfError); + if (!keypairData) { + CFRelease(privateKey); + CFRelease(publicKey); + *error = (__bridge_transfer NSError *) cfError; + return NO; + } + + if (![self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage value:keypairData]) { + CFRelease(privateKey); + CFRelease(publicKey); + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kErrorFailedToStoreKeypairData }]; + return NO; + } + + _privateKey = privateKey; + _publicKey = publicKey; + return YES; +} + +- (BOOL)setupIPK:(id)storage error:(NSError * _Nonnull __autoreleasing *)error +{ + __auto_type * ipk = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIPK]; + return ipk ? [self loadIPK:ipk error:error] : [self createIPK:storage error:error]; +} + +- (BOOL)loadIPK:(NSData *)ipk error:(NSError * _Nonnull __autoreleasing *)error +{ + if (ipk.length != CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES) { + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kErrorInvalidIPKData }]; + return NO; + } + + _ipk = ipk; + return YES; +} + +- (BOOL)createIPK:(id)storage error:(NSError * _Nonnull __autoreleasing *)error +{ + uint8_t tempIPK[CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES]; + + if (errSecSuccess != SecRandomCopyBytes(kSecRandomDefault, (sizeof tempIPK) / (sizeof tempIPK[0]), &tempIPK[0])) { + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kErrorFailedToGenerateIPK }]; + return NO; + } + + __auto_type * ipk = [NSData dataWithBytes:tempIPK length:(sizeof tempIPK)]; + if (![self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIPK value:ipk]) { + *error = [NSError errorWithDomain:kErrorDomain code:0 userInfo:@{ NSLocalizedDescriptionKey : kErrorFailedToStoreIPK }]; + return NO; + } + + _ipk = ipk; + return YES; +} + +- (NSData *)getIPK +{ + return _ipk; +} + +- (NSData *)_getValueForKeyWithStorage:(id)storage key:(NSString *)key +{ + if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { + return [storage storageDataForKey:key]; + } else if ([storage isKindOfClass:[ControllerStorage class]]) { + return [storage valueForKey:key]; + } + return nil; +} + +- (BOOL)_setValueForKeyWithStorage:(id)storage key:(NSString *)key value:(NSData *)value +{ + if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { + return [storage setStorageData:value forKey:key]; + } else if ([storage isKindOfClass:[ControllerStorage class]]) { + [storage storeValue:value forKey:key]; + return YES; + } + return NO; +} + +- (void)dealloc +{ + if (_privateKey) { + CFRelease(_privateKey); + } + + if (_publicKey) { + CFRelease(_publicKey); + } +} + +@end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 2420581978c855..f934f91dfbccb7 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -33,8 +33,6 @@ 037C3DC32991BD5100B7EEE2 /* Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C3D982991BD4F00B7EEE2 /* Commands.h */; }; 037C3DC42991BD5100B7EEE2 /* StorageManagementCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = 037C3D992991BD4F00B7EEE2 /* StorageManagementCommand.mm */; }; 037C3DC52991BD5100B7EEE2 /* StorageManagementCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C3D9A2991BD4F00B7EEE2 /* StorageManagementCommand.h */; }; - 037C3DC72991BD5100B7EEE2 /* CHIPToolKeypair.mm in Sources */ = {isa = PBXBuildFile; fileRef = 037C3D9D2991BD4F00B7EEE2 /* CHIPToolKeypair.mm */; }; - 037C3DC82991BD5100B7EEE2 /* CHIPToolKeypair.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C3D9E2991BD4F00B7EEE2 /* CHIPToolKeypair.h */; }; 037C3DC92991BD5100B7EEE2 /* MTRDevice_Externs.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C3D9F2991BD4F00B7EEE2 /* MTRDevice_Externs.h */; }; 037C3DCA2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 037C3DA02991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.mm */; }; 037C3DCB2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 037C3DA12991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.h */; }; @@ -420,6 +418,8 @@ B45374002A9FEC4F00807602 /* unix-init.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F92A9FEC4F00807602 /* unix-init.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; B45374012A9FEC4F00807602 /* unix-sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373FA2A9FEC4F00807602 /* unix-sockets.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; B4C8E6B72B3453AD00FCD54D /* MTRDiagnosticLogsDownloader.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4C8E6B42B3453AD00FCD54D /* MTRDiagnosticLogsDownloader.mm */; }; + B4D67A412D00DD3D00C49965 /* DFTKeypair.h in Headers */ = {isa = PBXBuildFile; fileRef = B4D67A3F2D00DD3D00C49965 /* DFTKeypair.h */; }; + B4D67A422D00DD3D00C49965 /* DFTKeypair.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4D67A402D00DD3D00C49965 /* DFTKeypair.mm */; }; B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */; }; B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */; }; B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */; }; @@ -506,8 +506,6 @@ 037C3D992991BD4F00B7EEE2 /* StorageManagementCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StorageManagementCommand.mm; sourceTree = ""; }; 037C3D9A2991BD4F00B7EEE2 /* StorageManagementCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageManagementCommand.h; sourceTree = ""; }; 037C3D9C2991BD4F00B7EEE2 /* CHIPCommandBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPCommandBridge.mm; sourceTree = ""; }; - 037C3D9D2991BD4F00B7EEE2 /* CHIPToolKeypair.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPToolKeypair.mm; sourceTree = ""; }; - 037C3D9E2991BD4F00B7EEE2 /* CHIPToolKeypair.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPToolKeypair.h; sourceTree = ""; }; 037C3D9F2991BD4F00B7EEE2 /* MTRDevice_Externs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDevice_Externs.h; sourceTree = ""; }; 037C3DA02991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPCommandStorageDelegate.mm; sourceTree = ""; }; 037C3DA12991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPCommandStorageDelegate.h; sourceTree = ""; }; @@ -909,6 +907,8 @@ B45373FA2A9FEC4F00807602 /* unix-sockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-sockets.c"; path = "repo/lib/plat/unix/unix-sockets.c"; sourceTree = ""; }; B4C8E6B32B3453AD00FCD54D /* MTRDiagnosticLogsDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDiagnosticLogsDownloader.h; sourceTree = ""; }; B4C8E6B42B3453AD00FCD54D /* MTRDiagnosticLogsDownloader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDiagnosticLogsDownloader.mm; sourceTree = ""; }; + B4D67A3F2D00DD3D00C49965 /* DFTKeypair.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DFTKeypair.h; sourceTree = ""; }; + B4D67A402D00DD3D00C49965 /* DFTKeypair.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DFTKeypair.mm; sourceTree = ""; }; B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteDataModelLogger.mm; sourceTree = ""; }; B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteDataModelLogger.h; sourceTree = ""; }; B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SleepCommand.mm; sourceTree = ""; }; @@ -1074,6 +1074,8 @@ 037C3D9B2991BD4F00B7EEE2 /* common */ = { isa = PBXGroup; children = ( + B4D67A3F2D00DD3D00C49965 /* DFTKeypair.h */, + B4D67A402D00DD3D00C49965 /* DFTKeypair.mm */, B409D0AC2CCFB89600A7ED5A /* DeviceDelegate.h */, B409D0AD2CCFB89600A7ED5A /* DeviceDelegate.mm */, B43B39EF2CB99090006AA284 /* CertificateIssuer.h */, @@ -1085,8 +1087,6 @@ B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */, B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */, 037C3D9C2991BD4F00B7EEE2 /* CHIPCommandBridge.mm */, - 037C3D9D2991BD4F00B7EEE2 /* CHIPToolKeypair.mm */, - 037C3D9E2991BD4F00B7EEE2 /* CHIPToolKeypair.h */, 037C3D9F2991BD4F00B7EEE2 /* MTRDevice_Externs.h */, 037C3DA02991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.mm */, 037C3DA12991BD4F00B7EEE2 /* CHIPCommandStorageDelegate.h */, @@ -1778,7 +1778,6 @@ B409D0AE2CCFB89600A7ED5A /* DeviceDelegate.h in Headers */, B43B39FA2CB99090006AA284 /* ControllerStorage.h in Headers */, 037C3DB82991BD5000B7EEE2 /* ClusterCommandBridge.h in Headers */, - 037C3DC82991BD5100B7EEE2 /* CHIPToolKeypair.h in Headers */, 037C3DB52991BD5000B7EEE2 /* WriteAttributeCommandBridge.h in Headers */, 03FB93DE2A46200A0048CB35 /* DiscoverCommissionablesCommand.h in Headers */, 037C3DCD2991BD5100B7EEE2 /* MTRLogging.h in Headers */, @@ -1808,6 +1807,7 @@ 037C3DAD2991BD4F00B7EEE2 /* PairingCommandBridge.h in Headers */, 037C3DBB2991BD5000B7EEE2 /* Commands.h in Headers */, 512431262BA0C8BA000BC136 /* ResetMRPParametersCommand.h in Headers */, + B4D67A412D00DD3D00C49965 /* DFTKeypair.h in Headers */, 03FB93DF2A46200A0048CB35 /* Commands.h in Headers */, 512431252BA0C8B7000BC136 /* Commands.h in Headers */, 037C3DB22991BD5000B7EEE2 /* PreWarmCommissioningCommand.h in Headers */, @@ -2182,6 +2182,7 @@ 0395469F2991DFC5006D42A8 /* json_reader.cpp in Sources */, 514C79F42B62ED5500DD6D7B /* attribute-storage.cpp in Sources */, 0395469E2991DFC5006D42A8 /* json_writer.cpp in Sources */, + B4D67A422D00DD3D00C49965 /* DFTKeypair.mm in Sources */, 7534D17F2CF8CE2000F64654 /* DefaultAttributePersistenceProvider.cpp in Sources */, 03FB93E02A46200A0048CB35 /* DiscoverCommissionablesCommand.mm in Sources */, 516411332B6BF77700E67C05 /* MTRServerAccessControl.mm in Sources */, @@ -2212,7 +2213,6 @@ 514C79FD2B62F94C00DD6D7B /* ota-provider.cpp in Sources */, 037C3DCA2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.mm in Sources */, 037C3DCF2991BD5200B7EEE2 /* MTRError.mm in Sources */, - 037C3DC72991BD5100B7EEE2 /* CHIPToolKeypair.mm in Sources */, 514C79F72B62F0B900DD6D7B /* util.cpp in Sources */, 037C3DB62991BD5000B7EEE2 /* ModelCommandBridge.mm in Sources */, 516411322B6BF75700E67C05 /* MTRIMDispatch.mm in Sources */,