File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2 Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -507,8 +507,8 @@ - (void)getAssertionWithClientDataHash:(NSData *)clientDataHash
507
507
NSString *base64EncodedFirst = extensions[@" prf" ][@" eval" ][@" first" ];
508
508
NSString *base64EncodedSecond = extensions[@" prf" ][@" eval" ][@" second" ];
509
509
510
- NSData *first = [[[NSData alloc ] initWithBase64EncodedString : base64EncodedFirst options: 0 ] ykf_prfSaltData ];
511
- NSData *second = [[[NSData alloc ] initWithBase64EncodedString : base64EncodedSecond options: 0 ] ykf_prfSaltData ];
510
+ NSData *first = [[[NSData alloc ] ykf_initWithWebsafeBase64EncodedString : base64EncodedFirst dataLength: base64EncodedFirst.length ] ykf_prfSaltData ];
511
+ NSData *second = [[[NSData alloc ] ykf_initWithWebsafeBase64EncodedString : base64EncodedSecond dataLength: base64EncodedFirst.length ] ykf_prfSaltData ];
512
512
513
513
if (first.length != 32 || (second && second.length != 32 )) {
514
514
[NSException raise: @" Invalid input" format: @" Salt is not 32 bytes long." ];
@@ -559,6 +559,11 @@ - (void)getAssertionWithClientDataHash:(NSData *)clientDataHash
559
559
ykf_weak_self ();
560
560
[self executeFIDO2Command: apdu retryCount: 0 completion: ^(NSData * _Nullable data, NSError * _Nullable error) {
561
561
ykf_safe_strong_self ();
562
+ if (error) {
563
+ completion (nil , error);
564
+ return ;
565
+ }
566
+
562
567
NSLog (@" %@ " , data.ykf_hexadecimalString );
563
568
NSData *cborData = [strongSelf cborFromKeyResponseData: data];
564
569
YKFFIDO2GetAssertionResponse *getAssertionResponse = [[YKFFIDO2GetAssertionResponse alloc ] initWithCBORData: cborData sharedSecret: sharedSecret];
You can’t perform that action at this time.
0 commit comments