Changeset 290539 in webkit
- Timestamp:
- Feb 25, 2022 5:47:04 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r290535 r290539 1 2022-02-25 J Pascoe <j_pascoe@apple.com> 2 3 [WebAuthn] Fallback to attestation=none whenever attestation fails 4 https://bugs.webkit.org/show_bug.cgi?id=237223 5 rdar://88767812 6 7 Reviewed by Brent Fulgham. 8 9 Whenever attestation is requested by a RP and it fails to complete, 10 we previously errored out of the registration. The more correct platform 11 behavior in this case is to provide attestation=none. 12 13 Created API test for this behavior. 14 15 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 16 (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): 17 1 18 2022-02-25 Per Arne Vollan <pvollan@apple.com> 2 19 -
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
r290381 r290539 466 466 467 467 if (error) { 468 receiveException({ UnknownError, makeString("Couldn't attest: ", String(error.localizedDescription)) }); 468 LOG_ERROR("Couldn't attest: %s", String(error.localizedDescription).utf8().data()); 469 auto attestationObject = buildAttestationObject(WTFMove(authData), "", { }, AttestationConveyancePreference::None); 470 receiveRespond(AuthenticatorAttestationResponse::create(credentialId, attestationObject, AuthenticatorAttachment::Platform)); 469 471 return; 470 472 } -
trunk/Tools/ChangeLog
r290534 r290539 1 2022-02-25 J Pascoe <j_pascoe@apple.com> 2 3 [WebAuthn] Fallback to attestation=none whenever attestation fails 4 https://bugs.webkit.org/show_bug.cgi?id=237223 5 rdar://88767812 6 7 Reviewed by Brent Fulgham. 8 9 Add test for local authenticator attestation fallback behavior. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 12 (TestWebKitAPI::TEST): 13 1 14 2022-02-25 Brent Fulgham <bfulgham@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm
r290381 r290539 1929 1929 Util::run(&webAuthenticationPanelRan); 1930 1930 } 1931 1932 TEST(WebAuthenticationPanel, MakeCredentialLAAttestationFalback) 1933 { 1934 reset(); 1935 1936 uint8_t identifier[] = { 0x01, 0x02, 0x03, 0x04 }; 1937 uint8_t hash[] = { 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04, 0x01, 0x02, 0x03, 0x04 }; 1938 NSData *nsIdentifier = [NSData dataWithBytes:identifier length:sizeof(identifier)]; 1939 auto nsHash = adoptNS([[NSData alloc] initWithBytes:hash length:sizeof(hash)]); 1940 auto parameters = adoptNS([[_WKPublicKeyCredentialParameters alloc] initWithAlgorithm:@-7]); 1941 1942 auto rp = adoptNS([[_WKPublicKeyCredentialRelyingPartyEntity alloc] initWithName:@"example.com"]); 1943 [rp setIdentifier:@"example.com"]; 1944 auto user = adoptNS([[_WKPublicKeyCredentialUserEntity alloc] initWithName:@"jappleseed@example.com" identifier:nsIdentifier displayName:@"J Appleseed"]); 1945 NSArray<_WKPublicKeyCredentialParameters *> *publicKeyCredentialParamaters = @[ parameters.get() ]; 1946 auto options = adoptNS([[_WKPublicKeyCredentialCreationOptions alloc] initWithRelyingParty:rp.get() user:user.get() publicKeyCredentialParamaters:publicKeyCredentialParamaters]); 1947 options.get().attestation = _WKAttestationConveyancePreferenceDirect; 1948 1949 auto panel = adoptNS([[_WKWebAuthenticationPanel alloc] init]); 1950 [panel setMockConfiguration:@{ @"privateKeyBase64": testES256PrivateKeyBase64 }]; 1951 auto delegate = adoptNS([[TestWebAuthenticationPanelDelegate alloc] init]); 1952 [panel setDelegate:delegate.get()]; 1953 1954 [panel makeCredentialWithClientDataHash:nsHash.get() options:options.get() completionHandler:^(_WKAuthenticatorAttestationResponse *response, NSError *error) { 1955 webAuthenticationPanelRan = true; 1956 cleanUpKeychain("example.com"); 1957 1958 EXPECT_NOT_NULL(response); 1959 // {"fmt": "none", "attStmt": {}, "authData": ...} 1960 EXPECT_WK_STREQ([response.attestationObject base64EncodedStringWithOptions:0], "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YViYo3mm9u6vuaVeN4wRgDTidR5oL6ufLTCrE9ISVYbOGUdFAAAAAAAAAAAAAAAAAAAAAAAAAAAAFEjElx54Be4RDrBJQO9wt0WPvG0epQECAyYgASFYIDj/zxSkzKgaBuS3cdWDF558of8AaIpgFpsjF/Qm1749IlggVBJPgqUIwfhWHJ91nb7UPH76c0+WFOzZKslPyyFse4g="); 1961 }]; 1962 Util::run(&webAuthenticationPanelRan); 1963 } 1931 1964 #endif 1932 1965
Note: See TracChangeset
for help on using the changeset viewer.