Changeset 287315 in webkit
- Timestamp:
- Dec 21, 2021 8:09:07 AM (7 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp (modified) (4 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-hid-internal-uv-pin-fallback.html (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r287313 r287315 1 2021-12-21 J Pascoe <j_pascoe@apple.com> 2 3 [WebAuthn] Authenticator is not falling back to clientPIN after internal verification fails and is blocked. 4 https://bugs.webkit.org/show_bug.cgi?id=232501 5 <rdar://problem/84913636> 6 7 Reviewed by Darin Adler. 8 9 Whenever internal uv gets blocked, the user agent should fall back to using a pin for user verification. This 10 patch starts doing that by going into the pin flow whenever the authenticator returns the pin required error 11 code. 12 13 Added API test for fallback. 14 15 * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: 16 (WebKit::CtapAuthenticator::makeCredential): 17 (WebKit::CtapAuthenticator::getAssertion): 18 (WebKit::CtapAuthenticator::tryRestartPin): 19 1 20 2021-12-21 Kimmo Kinnunen <kkinnunen@apple.com> 2 21 -
trunk/Source/WebKit/UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp
r284095 r287315 74 74 case CtapDeviceResponseCode::kCtap2ErrPinInvalid: 75 75 case CtapDeviceResponseCode::kCtap2ErrPinBlocked: 76 case CtapDeviceResponseCode::kCtap2ErrPinRequired: 76 77 return true; 77 78 default: … … 97 98 auto internalUVAvailability = m_info.options().userVerificationAvailability(); 98 99 // If UV is required, then either built-in uv or a pin will work. 99 if (internalUVAvailability == UVAvailability::kSupportedAndConfigured && (!options.authenticatorSelection || options.authenticatorSelection->userVerification != UserVerificationRequirement::Discouraged) )100 if (internalUVAvailability == UVAvailability::kSupportedAndConfigured && (!options.authenticatorSelection || options.authenticatorSelection->userVerification != UserVerificationRequirement::Discouraged) && m_pinAuth.isEmpty()) 100 101 cborCmd = encodeMakeCredenitalRequestAsCBOR(requestData().hash, options, internalUVAvailability); 101 102 else if (m_info.options().clientPinAvailability() == AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet) … … 142 143 auto internalUVAvailability = m_info.options().userVerificationAvailability(); 143 144 // If UV is required, then either built-in uv or a pin will work. 144 if (internalUVAvailability == UVAvailability::kSupportedAndConfigured && options.userVerification != UserVerificationRequirement::Discouraged )145 if (internalUVAvailability == UVAvailability::kSupportedAndConfigured && options.userVerification != UserVerificationRequirement::Discouraged && m_pinAuth.isEmpty()) 145 146 cborCmd = encodeGetAssertionRequestAsCBOR(requestData().hash, options, internalUVAvailability); 146 147 else if (m_info.options().clientPinAvailability() == AuthenticatorSupportedOptions::ClientPinAvailability::kSupportedAndPinSet && options.userVerification != UserVerificationRequirement::Discouraged) … … 344 345 case CtapDeviceResponseCode::kCtap2ErrPinAuthInvalid: 345 346 case CtapDeviceResponseCode::kCtap2ErrPinInvalid: 347 case CtapDeviceResponseCode::kCtap2ErrPinRequired: 346 348 getRetries(); 347 349 return true; -
trunk/Tools/ChangeLog
r287310 r287315 1 2021-12-21 J Pascoe <j_pascoe@apple.com> 2 3 [WebAuthn] Authenticator is not falling back to clientPIN after internal verification fails and is blocked. 4 https://bugs.webkit.org/show_bug.cgi?id=232501 5 <rdar://problem/84913636> 6 7 Reviewed by Darin Adler. 8 9 Whenever internal uv gets blocked, the user agent should fall back to using a pin for user verification. This 10 adds an API test to verify this behavior. 11 12 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 13 * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm: 14 (TestWebKitAPI::TEST): 15 1 16 2021-12-21 Sam Weinig <weinig@apple.com> 2 17 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r287223 r287315 299 299 51EB126724CB8753000CB030 /* SunLightApplicationGenericNES.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51EB126624CB8493000CB030 /* SunLightApplicationGenericNES.mm */; }; 300 300 520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */; }; 301 521D1B7327713E80003900C5 /* web-authentication-get-assertion-hid-internal-uv-pin-fallback.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 521D1B7227713E80003900C5 /* web-authentication-get-assertion-hid-internal-uv-pin-fallback.html */; }; 301 302 5245178721B9F57B0082CB34 /* RenderingProgressPlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5D6BE21B9F1B20046ABA6 /* RenderingProgressPlugIn.mm */; }; 302 303 524BBC9E19DF72C0002F1AF1 /* file-with-video.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 524BBC9B19DF3714002F1AF1 /* file-with-video.html */; }; … … 1580 1581 CD577799211CE0E4001B371E /* web-audio-only.html in Copy Resources */, 1581 1582 57663DF32357E48900E85E09 /* web-authentication-get-assertion-hid-cancel.html in Copy Resources */, 1583 521D1B7327713E80003900C5 /* web-authentication-get-assertion-hid-internal-uv-pin-fallback.html in Copy Resources */, 1582 1584 52C8C13A2706439000BDF3B7 /* web-authentication-get-assertion-hid-internal-uv.html in Copy Resources */, 1583 1585 579F1C0123C93AF500C7D4B4 /* web-authentication-get-assertion-hid-multiple-accounts.html in Copy Resources */, … … 2092 2094 520BCF4A141EB09E00937EA8 /* WebArchive_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebArchive_Bundle.cpp; sourceTree = "<group>"; }; 2093 2095 520BCF4B141EB09E00937EA8 /* WebArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebArchive.cpp; sourceTree = "<group>"; }; 2096 521D1B7227713E80003900C5 /* web-authentication-get-assertion-hid-internal-uv-pin-fallback.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = "web-authentication-get-assertion-hid-internal-uv-pin-fallback.html"; path = "Tests/WebKitCocoa/web-authentication-get-assertion-hid-internal-uv-pin-fallback.html"; sourceTree = "<group>"; }; 2094 2097 524BBC9B19DF3714002F1AF1 /* file-with-video.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "file-with-video.html"; sourceTree = "<group>"; }; 2095 2098 524BBC9C19DF377A002F1AF1 /* WKPageIsPlayingAudio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageIsPlayingAudio.cpp; sourceTree = "<group>"; }; … … 3165 3168 isa = PBXGroup; 3166 3169 children = ( 3170 521D1B7227713E80003900C5 /* web-authentication-get-assertion-hid-internal-uv-pin-fallback.html */, 3167 3171 52C8C1392706439000BDF3B7 /* web-authentication-get-assertion-hid-internal-uv.html */, 3168 3172 52C8C1372706437C00BDF3B7 /* web-authentication-make-credential-hid-internal-uv.html */, -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm
r287278 r287315 1252 1252 } 1253 1253 1254 TEST(WebAuthenticationPanel, GetAssertionInternalUVPinFallback) 1255 { 1256 reset(); 1257 RetainPtr<NSURL> testURL = [[NSBundle mainBundle] URLForResource:@"web-authentication-get-assertion-hid-internal-uv-pin-fallback" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 1258 1259 auto *configuration = [WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"WebProcessPlugInWithInternals" configureJSCForTesting:YES]; 1260 [[configuration preferences] _setEnabled:YES forExperimentalFeature:webAuthenticationExperimentalFeature()]; 1261 [[configuration preferences] _setEnabled:NO forExperimentalFeature:webAuthenticationModernExperimentalFeature()]; 1262 1263 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSZeroRect configuration:configuration]); 1264 auto delegate = adoptNS([[TestWebAuthenticationPanelUIDelegate alloc] init]); 1265 [webView setUIDelegate:delegate.get()]; 1266 [webView focus]; 1267 1268 webAuthenticationPanelPin = "1234"; 1269 [webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]]; 1270 [webView waitForMessage:@"Succeeded!"]; 1271 } 1272 1254 1273 TEST(WebAuthenticationPanel, GetAssertionPinAuthBlockedError) 1255 1274 {
Note: See TracChangeset
for help on using the changeset viewer.