diff --git a/YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2/YKFFIDO2Session.m b/YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2/YKFFIDO2Session.m index 60b9f62e..5e664efc 100644 --- a/YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2/YKFFIDO2Session.m +++ b/YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2/YKFFIDO2Session.m @@ -271,18 +271,18 @@ - (void)changePin:(nonnull NSString *)oldPin to:(nonnull NSString *)newPin compl NSData *oldPinData = [oldPin dataUsingEncoding:NSUTF8StringEncoding]; NSData *newPinData = [[newPin dataUsingEncoding:NSUTF8StringEncoding] ykf_fido2PaddedPinData]; - changePinRequest.pinProtocol = 1; + changePinRequest.pinProtocol = self.pinProtocol; changePinRequest.subCommand = YKFFIDO2ClientPinRequestSubCommandChangePIN; changePinRequest.keyAgreement = cosePlatformPublicKey; NSData *oldPinHash = [[oldPinData ykf_SHA256] subdataWithRange:NSMakeRange(0, 16)]; - changePinRequest.pinHashEnc = [oldPinHash ykf_aes256EncryptedDataWithKey:sharedSecret]; + changePinRequest.pinHashEnc = [oldPinHash ykf_encryptDataWithKey:sharedSecret pinProtocol:self.pinProtocol]; - changePinRequest.pinEnc = [newPinData ykf_aes256EncryptedDataWithKey:sharedSecret]; + changePinRequest.pinEnc = [newPinData ykf_encryptDataWithKey:sharedSecret pinProtocol:self.pinProtocol]; NSMutableData *pinAuthData = [NSMutableData dataWithData:changePinRequest.pinEnc]; [pinAuthData appendData:changePinRequest.pinHashEnc]; - changePinRequest.pinAuth = [[pinAuthData ykf_fido2HMACWithKey:sharedSecret] subdataWithRange:NSMakeRange(0, 16)]; + changePinRequest.pinAuth = [pinAuthData ykf_authenticateDataWithKey:sharedSecret pinProtocol:self.pinProtocol]; [strongSelf executeClientPinRequest:changePinRequest completion:^(YKFFIDO2ClientPinResponse *response, NSError *error) { if (error) { @@ -340,7 +340,7 @@ - (void)getPinRetriesWithCompletion:(YKFFIDO2SessionGetPinRetriesCompletionBlock YKFParameterAssertReturn(completion); YKFFIDO2ClientPinRequest *pinRetriesRequest = [[YKFFIDO2ClientPinRequest alloc] init]; - pinRetriesRequest.pinProtocol = 1; + pinRetriesRequest.pinProtocol = self.pinProtocol; pinRetriesRequest.subCommand = YKFFIDO2ClientPinRequestSubCommandGetRetries; [self executeClientPinRequest:pinRetriesRequest completion:^(YKFFIDO2ClientPinResponse *response, NSError *error) { diff --git a/YubiKitDemo/YubiKitDemo-Bridging-Header.h b/YubiKitDemo/YubiKitDemo-Bridging-Header.h index f27d7ee4..083a82f3 100644 --- a/YubiKitDemo/YubiKitDemo-Bridging-Header.h +++ b/YubiKitDemo/YubiKitDemo-Bridging-Header.h @@ -2,5 +2,5 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import +#import #import diff --git a/YubiKitDemo/YubiKitDemo.xcodeproj/project.pbxproj b/YubiKitDemo/YubiKitDemo.xcodeproj/project.pbxproj index 9227d440..5848756e 100644 --- a/YubiKitDemo/YubiKitDemo.xcodeproj/project.pbxproj +++ b/YubiKitDemo/YubiKitDemo.xcodeproj/project.pbxproj @@ -754,6 +754,7 @@ DEVELOPMENT_TEAM = LQA3CS5MM7; HEADER_SEARCH_PATHS = "../YubiKit/**"; INFOPLIST_FILE = YubiKitDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 16.6; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 2.9.2; PRODUCT_BUNDLE_IDENTIFIER = com.yubico.YubiKitDemoApp; @@ -775,6 +776,7 @@ DEVELOPMENT_TEAM = LQA3CS5MM7; HEADER_SEARCH_PATHS = "../YubiKit/**"; INFOPLIST_FILE = YubiKitDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 16.6; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 2.9.2; PRODUCT_BUNDLE_IDENTIFIER = com.yubico.YubiKitDemoApp;