File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
YubiKit/YubiKit/Connections/Shared/Sessions/FIDO2 Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -525,10 +525,19 @@ - (void)getAssertionWithClientNoFilterDataHash:(NSData *)clientDataHash
525
525
if (extensions) {
526
526
[self executeGetSharedSecretWithCompletion: ^(NSData * _Nullable sharedSecret, YKFCBORMap * _Nullable cosePlatformPublicKey, NSError * _Nullable error) {
527
527
NSMutableDictionary *authenticatorInputs = [NSMutableDictionary new ];
528
- if (extensions[@" prf" ] && extensions[ @" prf " ][ @" eval " ] ) {
529
- NSString *base64EncodedFirst = extensions[@" prf" ][ @" eval " ][ @" first " ];
530
- NSString *base64EncodedSecond = extensions[ @" prf" ] [@" eval" ][ @" second " ];
528
+ if (extensions[@" prf" ]) {
529
+ NSDictionary * prf = ( NSDictionary *) extensions[@" prf" ];
530
+ NSDictionary * secrets = ( NSDictionary *) prf[@" eval" ];
531
531
532
+ NSDictionary * evalByCred = (NSDictionary *)prf[@" evalByCredential" ];
533
+ if (evalByCred) {
534
+ YKFFIDO2PublicKeyCredentialDescriptor *credentialDescriptor = allowList[0 ];
535
+ NSString *selectedCredentialId = [credentialDescriptor.credentialId ykf_websafeBase64EncodedString ];
536
+ secrets = evalByCred[selectedCredentialId] ? evalByCred[selectedCredentialId] : secrets;
537
+ }
538
+
539
+ NSString *base64EncodedFirst = secrets[@" first" ];
540
+ NSString *base64EncodedSecond = secrets[@" second" ];
532
541
NSData *first = [[[NSData alloc ] ykf_initWithWebsafeBase64EncodedString: base64EncodedFirst dataLength: base64EncodedFirst.length] ykf_prfSaltData ];
533
542
NSData *second = [[[NSData alloc ] ykf_initWithWebsafeBase64EncodedString: base64EncodedSecond dataLength: base64EncodedFirst.length] ykf_prfSaltData ];
534
543
You can’t perform that action at this time.
0 commit comments