Changeset 245262 in webkit
- Timestamp:
- May 13, 2019 4:09:39 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245257 r245262 1 2019-05-13 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] InvalidStateError should be reported to sites 4 https://bugs.webkit.org/show_bug.cgi?id=193269 5 <rdar://problem/48298264> 6 7 Reviewed by Brent Fulgham. 8 9 * http/wpt/webauthn/ctap-hid-failure.https.html: 10 * http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https-expected.txt: 11 * http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html: 12 * http/wpt/webauthn/public-key-credential-create-failure-hid.https-expected.txt: 13 * http/wpt/webauthn/public-key-credential-create-failure-hid.https.html: 14 * http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html: 15 * http/wpt/webauthn/resources/util.js: 16 1 17 2019-05-13 Devin Rousso <drousso@apple.com> 2 18 -
trunk/LayoutTests/http/wpt/webauthn/ctap-hid-failure.https.html
r239752 r245262 66 66 if (window.testRunner) 67 67 testRunner.setWebAuthenticationMockConfiguration({ hid: { stage: "request", subStage: "msg", error: "wrong-channel-id", payloadBase64:[testDummyMessagePayloadBase64] } }); 68 return promiseRejects(t, "UnknownError", navigator.credentials.create(defaultOptions), "Unknown internal error. Error code: -1");68 return promiseRejects(t, "UnknownError", navigator.credentials.create(defaultOptions), "Unknown internal error. Error code: 18"); 69 69 }, "CTAP HID with request::msg stage wrong channel id error in a mock hid authenticator."); 70 70 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https-expected.txt
r238166 r245262 4 4 PASS PublicKeyCredential's [[create]] with unsupported options in a mock hid authenticator. 2 5 5 PASS PublicKeyCredential's [[create]] with mixed options in a mock hid authenticator. 6 PASS PublicKeyCredential's [[create]] with InvalidStateError in a mock hid authenticator. 6 7 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
r239752 r245262 95 95 return promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "Operation timed out."); 96 96 }, "PublicKeyCredential's [[create]] with mixed options in a mock hid authenticator."); 97 98 promise_test(function(t) { 99 const options = { 100 publicKey: { 101 rp: { 102 name: "example.com" 103 }, 104 user: { 105 name: "John Appleseed", 106 id: asciiToUint8Array("123456"), 107 displayName: "John", 108 }, 109 challenge: asciiToUint8Array("123456"), 110 pubKeyCredParams: [{ type: "public-key", alg: -7 }] 111 } 112 }; 113 114 if (window.testRunner) 115 testRunner.setWebAuthenticationMockConfiguration({ hid: { stage: "request", subStage: "msg", error: "malicious-payload", payloadBase64: [testCtapErrCredentialExcludedOnlyResponseBase64] } }); 116 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the authenticator."); 117 }, "PublicKeyCredential's [[create]] with InvalidStateError in a mock hid authenticator."); 97 118 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-hid.https-expected.txt
r238166 r245262 6 6 PASS PublicKeyCredential's [[create]] with mixed options in a mock hid authenticator. 7 7 PASS PublicKeyCredential's [[create]] with mixed options in a mock hid authenticator. 2 8 PASS PublicKeyCredential's [[create]] with InvalidStateError in a mock hid authenticator. 8 9 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
r239752 r245262 48 48 if (window.testRunner) 49 49 testRunner.setWebAuthenticationMockConfiguration({ hid: { stage: "request", subStage: "msg", error: "malicious-payload", payloadBase64: [testDummyMessagePayloadBase64] } }); 50 return promiseRejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error. Error code: -1");50 return promiseRejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error. Error code: 255"); 51 51 }, "PublicKeyCredential's [[create]] with malicious payload in a mock hid authenticator."); 52 52 … … 139 139 return promiseRejects(t, "UnknownError", navigator.credentials.create(options), "Unknown internal error. Error code: 43"); 140 140 }, "PublicKeyCredential's [[create]] with mixed options in a mock hid authenticator. 2"); 141 142 promise_test(function(t) { 143 const options = { 144 publicKey: { 145 rp: { 146 name: "example.com" 147 }, 148 user: { 149 name: "John Appleseed", 150 id: asciiToUint8Array("123456"), 151 displayName: "John", 152 }, 153 challenge: asciiToUint8Array("123456"), 154 pubKeyCredParams: [{ type: "public-key", alg: -7 }] 155 } 156 }; 157 158 if (window.testRunner) 159 testRunner.setWebAuthenticationMockConfiguration({ hid: { stage: "request", subStage: "msg", error: "malicious-payload", payloadBase64: [testCtapErrCredentialExcludedOnlyResponseBase64] } }); 160 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the authenticator."); 161 }, "PublicKeyCredential's [[create]] with InvalidStateError in a mock hid authenticator."); 141 162 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
r239752 r245262 114 114 if (window.testRunner) 115 115 testRunner.setWebAuthenticationMockConfiguration({ silentFailure: true, hid: { stage: "request", subStage: "msg", error: "malicious-payload", isU2f: true, payloadBase64: [testU2fApduNoErrorOnlyResponseBase64, testU2fApduNoErrorOnlyResponseBase64] } }); 116 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "Operation timed out.");116 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the authenticator."); 117 117 }, "PublicKeyCredential's [[create]] with first exclude credential matched in a mock hid authenticator."); 118 118 … … 138 138 if (window.testRunner) 139 139 testRunner.setWebAuthenticationMockConfiguration({ silentFailure: true, hid: { stage: "request", subStage: "msg", error: "malicious-payload", isU2f: true, payloadBase64: [testU2fApduWrongDataOnlyResponseBase64, testU2fApduNoErrorOnlyResponseBase64, testU2fApduNoErrorOnlyResponseBase64] } }); 140 return promiseRejects(t, " NotAllowedError", navigator.credentials.create(options), "Operation timed out.");140 return promiseRejects(t, "InvalidStateError", navigator.credentials.create(options), "At least one credential matches an entry of the excludeCredentials list in the authenticator."); 141 141 }, "PublicKeyCredential's [[create]] with second exclude credential matched in a mock hid authenticator."); 142 142 -
trunk/LayoutTests/http/wpt/webauthn/resources/util.js
r239752 r245262 98 98 "AQAAADswRAIge94KUqwfTIsn4AOjcM1mpMcRjdItVEeDX0W5nGhCP/cCIDxRe0eH" + 99 99 "f4V4LeEAhqeD0effTjY553H19q+jWq1Tc4WOkAA="; 100 const testCtapErrCredentialExcludedOnlyResponseBase64 = "GQ=="; 100 101 101 102 const RESOURCES_DIR = "/WebKit/webauthn/resources/"; -
trunk/Source/WebKit/ChangeLog
r245255 r245262 1 2019-05-13 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] InvalidStateError should be reported to sites 4 https://bugs.webkit.org/show_bug.cgi?id=193269 5 <rdar://problem/48298264> 6 7 Reviewed by Brent Fulgham. 8 9 This patch implements step 20 about InvalidStateError of the spec: 10 https://www.w3.org/TR/webauthn/#createCredential. 11 12 * UIProcess/WebAuthentication/AuthenticatorManager.cpp: 13 (WebKit::AuthenticatorManager::respondReceived): 14 * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: 15 (WebKit::CtapHidAuthenticator::continueMakeCredentialAfterResponseReceived const): 16 1 17 2019-05-13 Jer Noble <jer.noble@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp
r245043 r245262 195 195 if (!m_requestTimeOutTimer.isActive()) 196 196 return; 197 198 197 ASSERT(m_pendingCompletionHandler); 199 if (WTF::holds_alternative<PublicKeyCredentialData>(respond)) { 198 199 auto shouldComplete = WTF::holds_alternative<PublicKeyCredentialData>(respond); 200 if (!shouldComplete) 201 shouldComplete = WTF::get<ExceptionData>(respond).code == InvalidStateError; 202 if (shouldComplete) { 200 203 m_pendingCompletionHandler(WTFMove(respond)); 201 204 clearStateAsync(); -
trunk/Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp
r239852 r245262 63 63 auto response = readCTAPMakeCredentialResponse(data); 64 64 if (!response) { 65 receiveRespond(ExceptionData { UnknownError, makeString("Unknown internal error. Error code: ", data.size() == 1 ? data[0] : -1) }); 65 auto error = getResponseCode(data); 66 if (error == CtapDeviceResponseCode::kCtap2ErrCredentialExcluded) 67 receiveRespond(ExceptionData { InvalidStateError, "At least one credential matches an entry of the excludeCredentials list in the authenticator."_s }); 68 else 69 receiveRespond(ExceptionData { UnknownError, makeString("Unknown internal error. Error code: ", static_cast<uint8_t>(error)) }); 66 70 return; 67 71 }
Note: See TracChangeset
for help on using the changeset viewer.