Changeset 284838 in webkit
- Timestamp:
- Oct 25, 2021, 2:51:24 PM (5 years ago)
- Location:
- branches/safari-612-branch
- Files:
-
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html (modified) (2 diffs)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html (modified) (2 diffs)
-
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
-
branches/safari-612-branch/LayoutTests/ChangeLog
r284836 r284838 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r284532. rdar://problem/84625267 4 5 Source/WebKit: 6 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 7 https://bugs.webkit.org/show_bug.cgi?id=219813 8 <rdar://problem/72484635> 9 10 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 11 Reviewed by Brent Fulgham. 12 13 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 14 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 15 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 16 and return a different error depending on consent was obtained. 17 18 A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch 19 20 Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent 21 22 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 23 (WebKit::LocalAuthenticator::makeCredential): 24 25 Tools: 26 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 27 https://bugs.webkit.org/show_bug.cgi?id=219813 28 <rdar://problem/72484635> 29 30 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 31 Reviewed by Brent Fulgham. 32 33 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 34 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 35 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 36 and return a different error depending on consent was obtained. 37 38 This adds a test to confirm a different path is taken whenever consent is obtained. 39 40 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 41 (TestWebKitAPI::TEST): 42 43 LayoutTests: 44 WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 45 https://bugs.webkit.org/show_bug.cgi?id=219813 46 <rdar://problem/72484635> 47 48 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 49 Reviewed by Brent Fulgham. 50 51 Modify layout tests to reflect different exception returned when consent is provided 52 53 * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html: 54 * http/wpt/webauthn/public-key-credential-create-failure-local.https.html: 55 56 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284532 268f45cc-cd09-0410-ab3c-d52691b4dbfc 57 58 2021-10-20 John Pascoe <j_pascoe@apple.com> 59 60 WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 61 https://bugs.webkit.org/show_bug.cgi?id=219813 62 <rdar://problem/72484635> 63 64 Reviewed by Brent Fulgham. 65 66 Modify layout tests to reflect different exception returned when consent is provided 67 68 * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html: 69 * http/wpt/webauthn/public-key-credential-create-failure-local.https.html: 70 1 71 2021-10-25 Null <null@apple.com> 2 72 -
branches/safari-612-branch/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
r270619 r284838 51 51 if (window.testRunner) 52 52 testRunner.addTestKeyToKeychain(privateKeyBase64, testRpId, testUserEntityBundleBase64); 53 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "Operation timed out.").then(() => {53 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => { 54 54 if (window.testRunner) 55 55 testRunner.cleanUpKeychain(testRpId, credentialIDBase64); … … 85 85 if (window.testRunner) 86 86 testRunner.addTestKeyToKeychain(privateKeyBase64, testRpId, testUserEntityBundleBase64); 87 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "Operation timed out.").then(() => {87 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => { 88 88 if (window.testRunner) 89 89 testRunner.cleanUpKeychain(testRpId, credentialIDBase64); -
branches/safari-612-branch/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-local.https.html
r269360 r284838 49 49 if (window.testRunner) 50 50 testRunner.addTestKeyToKeychain(privateKeyBase64, testRpId, testUserEntityBundleBase64); 51 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {51 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => { 52 52 if (window.testRunner) 53 53 testRunner.cleanUpKeychain(testRpId, credentialIDBase64); … … 82 82 if (window.testRunner) 83 83 testRunner.addTestKeyToKeychain(privateKeyBase64, testRpId, testUserEntityBundleBase64); 84 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => {84 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.").then(() => { 85 85 if (window.testRunner) 86 86 testRunner.cleanUpKeychain(testRpId, credentialIDBase64); -
branches/safari-612-branch/Source/WebKit/ChangeLog
r284837 r284838 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r284532. rdar://problem/84625267 4 5 Source/WebKit: 6 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 7 https://bugs.webkit.org/show_bug.cgi?id=219813 8 <rdar://problem/72484635> 9 10 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 11 Reviewed by Brent Fulgham. 12 13 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 14 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 15 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 16 and return a different error depending on consent was obtained. 17 18 A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch 19 20 Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent 21 22 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 23 (WebKit::LocalAuthenticator::makeCredential): 24 25 Tools: 26 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 27 https://bugs.webkit.org/show_bug.cgi?id=219813 28 <rdar://problem/72484635> 29 30 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 31 Reviewed by Brent Fulgham. 32 33 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 34 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 35 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 36 and return a different error depending on consent was obtained. 37 38 This adds a test to confirm a different path is taken whenever consent is obtained. 39 40 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 41 (TestWebKitAPI::TEST): 42 43 LayoutTests: 44 WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 45 https://bugs.webkit.org/show_bug.cgi?id=219813 46 <rdar://problem/72484635> 47 48 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 49 Reviewed by Brent Fulgham. 50 51 Modify layout tests to reflect different exception returned when consent is provided 52 53 * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html: 54 * http/wpt/webauthn/public-key-credential-create-failure-local.https.html: 55 56 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284532 268f45cc-cd09-0410-ab3c-d52691b4dbfc 57 58 2021-10-20 John Pascoe <j_pascoe@apple.com> 59 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 60 https://bugs.webkit.org/show_bug.cgi?id=219813 61 <rdar://problem/72484635> 62 63 Reviewed by Brent Fulgham. 64 65 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 66 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 67 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 68 and return a different error depending on consent was obtained. 69 70 A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch 71 72 Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent 73 74 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 75 (WebKit::LocalAuthenticator::makeCredential): 76 1 77 2021-10-25 Null <null@apple.com> 2 78 -
branches/safari-612-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
r278358 r284838 236 236 return excludeCredentialIds.contains(base64EncodeToString(rawId->data(), rawId->byteLength())); 237 237 })) { 238 receiveException({ NotAllowedError, "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator."_s }, WebAuthenticationStatus::LAExcludeCredentialsMatched); 238 // Obtain consent per Step 3.1 239 auto callback = [weakThis = WeakPtr { *this }] (LocalAuthenticatorPolicy policy) { 240 ASSERT(RunLoop::isMain()); 241 if (!weakThis) 242 return; 243 244 if (policy == LocalAuthenticatorPolicy::Allow) 245 weakThis->receiveException({ InvalidStateError, "At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator."_s }, WebAuthenticationStatus::LAExcludeCredentialsMatched); 246 else 247 weakThis->receiveException({ NotAllowedError, "This request has been cancelled by the user."_s }); 248 }; 249 observer()->decidePolicyForLocalAuthenticator(WTFMove(callback)); 239 250 return; 240 251 } -
branches/safari-612-branch/Tools/ChangeLog
r284824 r284838 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r284532. rdar://problem/84625267 4 5 Source/WebKit: 6 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 7 https://bugs.webkit.org/show_bug.cgi?id=219813 8 <rdar://problem/72484635> 9 10 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 11 Reviewed by Brent Fulgham. 12 13 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 14 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 15 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 16 and return a different error depending on consent was obtained. 17 18 A fixme to add this was inadvertently removed in https://bugs.webkit.org/attachment.cgi?id=393180&action=prettypatch 19 20 Added api test TestWebKitAPI.WebAuthenticationPanel.LADuplicateCredentialWithConsent 21 22 * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: 23 (WebKit::LocalAuthenticator::makeCredential): 24 25 Tools: 26 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 27 https://bugs.webkit.org/show_bug.cgi?id=219813 28 <rdar://problem/72484635> 29 30 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 31 Reviewed by Brent Fulgham. 32 33 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 34 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 35 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 36 and return a different error depending on consent was obtained. 37 38 This adds a test to confirm a different path is taken whenever consent is obtained. 39 40 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 41 (TestWebKitAPI::TEST): 42 43 LayoutTests: 44 WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 45 https://bugs.webkit.org/show_bug.cgi?id=219813 46 <rdar://problem/72484635> 47 48 Patch by John Pascoe <j_pascoe@apple.com> on 2021-10-20 49 Reviewed by Brent Fulgham. 50 51 Modify layout tests to reflect different exception returned when consent is provided 52 53 * http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html: 54 * http/wpt/webauthn/public-key-credential-create-failure-local.https.html: 55 56 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284532 268f45cc-cd09-0410-ab3c-d52691b4dbfc 57 58 2021-10-20 John Pascoe <j_pascoe@apple.com> 59 [WebAuthn] Obtain consent to create new credential when platform authenticator in excludedCredentials 60 https://bugs.webkit.org/show_bug.cgi?id=219813 61 <rdar://problem/72484635> 62 63 Reviewed by Brent Fulgham. 64 65 Currently, whenever the platform authenticator is within excludedCredentials during makeCredential we 66 always return NotAllowedError and merely flash a consent screen. This does not match the spec per Step 3.1 67 of makeCredential (https://w3c.github.io/webauthn/#sctn-op-make-cred). Instead, we should always obtain consent 68 and return a different error depending on consent was obtained. 69 70 This adds a test to confirm a different path is taken whenever consent is obtained. 71 72 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 73 (TestWebKitAPI::TEST): 74 1 75 2021-10-25 Null <null@apple.com> 2 76 -
branches/safari-612-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm
r284824 r284838 1385 1385 ASSERT_TRUE(addKeyToKeychain(testES256PrivateKeyBase64, "", testUserEntityBundleBase64)); 1386 1386 [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; 1387 Util::run(&webAuthenticationPanelFailed); 1388 cleanUpKeychain(""); 1389 } 1390 1391 TEST(WebAuthenticationPanel, LADuplicateCredentialWithConsent) 1392 { 1393 reset(); 1394 RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"web-authentication-make-credential-la-duplicate-credential" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 1395 1396 auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES]; 1397 [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationExperimentalFeature()]; 1398 [[configuration preferences] _setEnabled:NO forExperimentalFeature:webAuthenticationModernExperimentalFeature()]; 1399 1400 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]); 1401 auto delegate = adoptNS([[TestWebAuthenticationPanelUIDelegate alloc] init]); 1402 [webView setUIDelegate:delegate.get()]; 1403 [webView focus]; 1404 1405 ASSERT_TRUE(addKeyToKeychain(testES256PrivateKeyBase64, "", testUserEntityBundleBase64)); 1406 1407 localAuthenticatorPolicy = _WKLocalAuthenticatorPolicyAllow; 1408 1409 [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; 1387 1410 Util::run(&webAuthenticationPanelUpdateLAExcludeCredentialsMatched); 1388 1411 cleanUpKeychain("");
Note:
See TracChangeset
for help on using the changeset viewer.