Skip to content

Commit

Permalink
Don't generate getters that copy P256Keypair
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Dec 20, 2023
1 parent a55c241 commit 611937f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down
7 changes: 4 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -125,7 +123,10 @@ @interface MTRDeviceController () {

@end

@implementation MTRDeviceController
@implementation MTRDeviceController {
MTRP256KeypairBridge _signingKeypairBridge;
MTRP256KeypairBridge _operationalKeypairBridge;
}

- (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error
{
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRP256KeypairBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<MTRKeypair> keypair);

Expand Down

0 comments on commit 611937f

Please sign in to comment.