From 611937fbda242c9a6e6a6a4c3d1911a4b9fdfb00 Mon Sep 17 00:00:00 2001 From: Karsten Sperling Date: Wed, 20 Dec 2023 14:24:27 +1300 Subject: [PATCH] Don't generate getters that copy P256Keypair --- .../commands/common/CHIPToolKeypair.mm | 15 +++++++-------- src/darwin/Framework/CHIP/MTRDeviceController.mm | 7 ++++--- src/darwin/Framework/CHIP/MTRP256KeypairBridge.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm index fccf3d2734407e..4d6f53de9aa08f 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm @@ -12,15 +12,14 @@ static NSString * const kOperationalCredentialsIssuerKeypairStorage = @"ChipToolOpCredsCAKey"; static NSString * const kOperationalCredentialsIPK = @"ChipToolOpCredsIPK"; -@interface CHIPToolKeypair () -@property (nonatomic) chip::Crypto::P256Keypair mKeyPair; -@property (nonatomic) chip::Crypto::P256Keypair mIssuer; -@property (nonatomic) NSData * ipk; -@property (atomic) uint32_t mNow; -@property (nonatomic, readonly) SecKeyRef mPublicKey; -@end +@implementation CHIPToolKeypair { + chip::Crypto::P256Keypair _mKeyPair; + chip::Crypto::P256Keypair _mIssuer; + NSData * _ipk; + uint32_t _mNow; + SecKeyRef _mPublicKey; +} -@implementation CHIPToolKeypair - (instancetype)init { if (self = [super init]) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 04f92e8e3bdf1a..5f0e123a24fe85 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -114,8 +114,6 @@ @interface MTRDeviceController () { @property (readonly) chip::Credentials::DefaultDACVerifier * defaultDACVerifier; @property (readonly) MTRDeviceControllerDelegateBridge * deviceControllerDelegateBridge; @property (readonly) MTROperationalCredentialsDelegate * operationalCredentialsDelegate; -@property (readonly) MTRP256KeypairBridge signingKeypairBridge; -@property (readonly) MTRP256KeypairBridge operationalKeypairBridge; @property (readonly) MTRDeviceAttestationDelegateBridge * deviceAttestationDelegateBridge; @property (readonly) MTRDeviceControllerFactory * factory; @property (readonly) NSMutableDictionary * nodeIDToDeviceMap; @@ -125,7 +123,10 @@ @interface MTRDeviceController () { @end -@implementation MTRDeviceController +@implementation MTRDeviceController { + MTRP256KeypairBridge _signingKeypairBridge; + MTRP256KeypairBridge _operationalKeypairBridge; +} - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { diff --git a/src/darwin/Framework/CHIP/MTRP256KeypairBridge.h b/src/darwin/Framework/CHIP/MTRP256KeypairBridge.h index 4683326926ae0f..b63aead22b6d0c 100644 --- a/src/darwin/Framework/CHIP/MTRP256KeypairBridge.h +++ b/src/darwin/Framework/CHIP/MTRP256KeypairBridge.h @@ -22,10 +22,10 @@ NS_ASSUME_NONNULL_BEGIN -class MTRP256KeypairBridge : public chip::Crypto::P256Keypair +class MTRP256KeypairBridge final : public chip::Crypto::P256Keypair { public: - ~MTRP256KeypairBridge(){}; + ~MTRP256KeypairBridge() = default; CHIP_ERROR Init(id keypair);