Skip to content

Commit

Permalink
fix(IoT): Fixing identity not being created
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaland committed Feb 7, 2024
1 parent e209fa3 commit 529ad0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AWSIoT/AWSIoTManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ - (void)createKeysAndCertificateFromCsr:(NSDictionary<NSString *, NSString*> *)c

SecKeyRef publicKeyRef = [AWSIoTKeychain getPublicKeyRef:publicTag];
SecKeyRef privateKeyRef = [AWSIoTKeychain getPrivateKeyRef:privateTag];
SecIdentityRef identityRef = [AWSIoTKeychain getIdentityRef:newPrivateTag certificateLabel:newCertTag];
SecIdentityRef identityRef = nil;

if ([AWSIoTKeychain deleteAsymmetricKeysWithPublicTag:publicTag privateTag:privateTag] &&
[AWSIoTKeychain addPrivateKeyRef:privateKeyRef tag:newPrivateTag] &&
[AWSIoTKeychain addPublicKeyRef:publicKeyRef tag:newPublicTag] &&
[AWSIoTKeychain addCertificateToKeychain:certificatePem tag:newCertTag] &&
identityRef != nil) {
(identityRef = [AWSIoTKeychain getIdentityRef:newPrivateTag certificateLabel:newCertTag])) {
AWSIoTCreateCertificateResponse* resp = [[AWSIoTCreateCertificateResponse alloc] init];
resp.certificateId = certificateId;
resp.certificatePem = certificatePem;
Expand Down

0 comments on commit 529ad0b

Please sign in to comment.