Changeset 245043 in webkit
- Timestamp:
- May 7, 2019, 4:43:18 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 20 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https.html (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https.html (modified) (1 diff)
-
LayoutTests/http/wpt/webauthn/resources/new-page.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp (modified) (4 diffs)
-
Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp (modified) (5 diffs)
-
Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in (modified) (1 diff)
-
Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245033 r245043 1 2019-05-07 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] A new request should always suppress the pending request if any 4 https://bugs.webkit.org/show_bug.cgi?id=191517 5 <rdar://problem/46888222> 6 7 Reviewed by Brent Fulgham. 8 9 * http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt: 10 * http/wpt/webauthn/public-key-credential-create-failure.https.html: 11 * http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt: 12 * http/wpt/webauthn/public-key-credential-create-success-hid.https.html: 13 * http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt: 14 * http/wpt/webauthn/public-key-credential-get-failure.https.html: 15 * http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt: 16 * http/wpt/webauthn/public-key-credential-get-success-hid.https.html: 17 * http/wpt/webauthn/resources/new-page.html: Added. 18 1 19 2019-05-07 Youenn Fablet <youenn@apple.com> 2 20 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https-expected.txt
r236842 r245043 3 3 PASS PublicKeyCredential's [[create]] with a mismatched RP ID 4 4 PASS PublicKeyCredential's [[create]] with an empty pubKeyCredParams 5 PASS PublicKeyCredential's [[create]] with two consecutive requests 6 PASS PublicKeyCredential's [[create]] with two consecutive requests (2) 7 PASS PublicKeyCredential's [[create]] with new requests in a new page 8 PASS PublicKeyCredential's [[create]] with new requests in a new page (2) 5 9 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-failure.https.html
r244863 r245043 71 71 navigator.credentials.create(options), "No desired properties of the to be created credential are provided."); 72 72 }, "PublicKeyCredential's [[create]] with an empty pubKeyCredParams"); 73 74 promise_test(function(t) { 75 const options = { 76 publicKey: { 77 rp: { 78 name: "example.com" 79 }, 80 user: { 81 name: "John Appleseed", 82 id: asciiToUint8Array("123456"), 83 displayName: "John", 84 }, 85 challenge: asciiToUint8Array("123456"), 86 pubKeyCredParams: [{ type: "public-key", alg: -7 }], 87 } 88 }; 89 90 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "This request has been voided by a new request."); 91 promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "This request has been voided by a new request."); 92 return result; 93 }, "PublicKeyCredential's [[create]] with two consecutive requests"); 94 95 promise_test(function(t) { 96 const creationOptions = { 97 publicKey: { 98 rp: { 99 name: "example.com" 100 }, 101 user: { 102 name: "John Appleseed", 103 id: asciiToUint8Array("123456"), 104 displayName: "John", 105 }, 106 challenge: asciiToUint8Array("123456"), 107 pubKeyCredParams: [{ type: "public-key", alg: -7 }], 108 } 109 }; 110 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.create(creationOptions), "This request has been voided by a new request."); 111 112 const requestOptions = { 113 publicKey: { 114 challenge: asciiToUint8Array("123456") 115 } 116 }; 117 promiseRejects(t, "NotAllowedError", navigator.credentials.get(requestOptions), "This request has been voided by a new request."); 118 return result; 119 }, "PublicKeyCredential's [[create]] with two consecutive requests (2)"); 120 121 promise_test(function(t) { 122 const options = { 123 publicKey: { 124 rp: { 125 name: "example.com" 126 }, 127 user: { 128 name: "John Appleseed", 129 id: asciiToUint8Array("123456"), 130 displayName: "John", 131 }, 132 challenge: asciiToUint8Array("123456"), 133 pubKeyCredParams: [{ type: "public-key", alg: -7 }], 134 } 135 }; 136 137 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "This request has been cancelled by a new request."); 138 window.open("./resources/new-page.html?isCreation=true"); 139 return result; 140 }, "PublicKeyCredential's [[create]] with new requests in a new page"); 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 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "This request has been cancelled by a new request."); 159 window.open("./resources/new-page.html?isCreation=false"); 160 return result; 161 }, "PublicKeyCredential's [[create]] with new requests in a new page (2)"); 73 162 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https-expected.txt
r238166 r245043 6 6 PASS PublicKeyCredential's [[create]] with userVerification { 'discouraged' } in a mock local authenticator. 7 7 PASS PublicKeyCredential's [[create]] with mixed options in a mock local authenticator. 8 PASS PublicKeyCredential's [[create]] with two consecutive requests. 8 9 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https.html
r243193 r245043 171 171 }); 172 172 }, "PublicKeyCredential's [[create]] with mixed options in a mock local authenticator."); 173 174 promise_test(t => { 175 const options = { 176 publicKey: { 177 rp: { 178 name: "localhost", 179 }, 180 user: { 181 name: "John Appleseed", 182 id: Base64URL.parse(testUserhandleBase64), 183 displayName: "Appleseed", 184 }, 185 challenge: Base64URL.parse("MTIzNDU2"), 186 pubKeyCredParams: [{ type: "public-key", alg: -7 }], 187 timeout: 100 188 } 189 }; 190 191 promiseRejects(t, "NotAllowedError", navigator.credentials.create(options), "This request is suppressed by a new request."); 192 return navigator.credentials.create(options).then(credential => { 193 checkResult(credential); 194 }); 195 }, "PublicKeyCredential's [[create]] with two consecutive requests."); 173 196 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https-expected.txt
r243193 r245043 6 6 PASS PublicKeyCredential's [[get]] with a mismatched APP ID (different sites 1) 7 7 PASS PublicKeyCredential's [[get]] with a mismatched APP ID (different sites 2) 8 PASS PublicKeyCredential's [[get]] with two consecutive requests 9 PASS PublicKeyCredential's [[get]] with two consecutive requests (2) 10 PASS PublicKeyCredential's [[get]] with new requests in a new page 11 PASS PublicKeyCredential's [[get]] with new requests in a new page (2) 8 12 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-failure.https.html
r244863 r245043 80 80 navigator.credentials.get(options), "The origin of the document is not authorized for the provided App ID."); 81 81 }, "PublicKeyCredential's [[get]] with a mismatched APP ID (different sites 2)"); 82 83 promise_test(t => { 84 const options = { 85 publicKey: { 86 challenge: asciiToUint8Array("123456") 87 } 88 }; 89 90 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "This request has been voided by a new request."); 91 promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "This request has been voided by a new request."); 92 return result; 93 }, "PublicKeyCredential's [[get]] with two consecutive requests"); 94 95 promise_test(function(t) { 96 const requestOptions = { 97 publicKey: { 98 challenge: asciiToUint8Array("123456") 99 } 100 }; 101 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.get(requestOptions), "This request has been voided by a new request."); 102 103 const creationOptions = { 104 publicKey: { 105 rp: { 106 name: "example.com" 107 }, 108 user: { 109 name: "John Appleseed", 110 id: asciiToUint8Array("123456"), 111 displayName: "John", 112 }, 113 challenge: asciiToUint8Array("123456"), 114 pubKeyCredParams: [{ type: "public-key", alg: -7 }], 115 } 116 }; 117 promiseRejects(t, "NotAllowedError", navigator.credentials.create(creationOptions), "This request has been voided by a new request."); 118 119 return result; 120 }, "PublicKeyCredential's [[get]] with two consecutive requests (2)"); 121 122 promise_test(t => { 123 const options = { 124 publicKey: { 125 challenge: asciiToUint8Array("123456") 126 } 127 }; 128 129 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "This request has been cancelled by a new request."); 130 window.open("./resources/new-page.html?isCreation=false"); 131 return result; 132 }, "PublicKeyCredential's [[get]] with new requests in a new page"); 133 134 promise_test(t => { 135 const options = { 136 publicKey: { 137 challenge: asciiToUint8Array("123456") 138 } 139 }; 140 141 const result = promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "This request has been cancelled by a new request."); 142 window.open("./resources/new-page.html?isCreation=true"); 143 return result; 144 }, "PublicKeyCredential's [[get]] with new requests in a new page (2)"); 82 145 </script> -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https-expected.txt
r238166 r245043 5 5 PASS PublicKeyCredential's [[get]] with userVerification { discouraged } in a mock hid authenticator. 6 6 PASS PublicKeyCredential's [[get]] with mixed options in a mock hid authenticator. 7 PASS PublicKeyCredential's [[get]] with two consecutive requests. 7 8 -
trunk/LayoutTests/http/wpt/webauthn/public-key-credential-get-success-hid.https.html
r243193 r245043 99 99 }); 100 100 }, "PublicKeyCredential's [[get]] with mixed options in a mock hid authenticator."); 101 102 promise_test(t => { 103 const options = { 104 publicKey: { 105 challenge: Base64URL.parse("MTIzNDU2"), 106 timeout: 100 107 } 108 }; 109 110 promiseRejects(t, "NotAllowedError", navigator.credentials.get(options), "This request is suppressed by a new request."); 111 return navigator.credentials.get(options).then(credential => { 112 return checkResult(credential); 113 }); 114 }, "PublicKeyCredential's [[get]] with two consecutive requests."); 101 115 </script> -
trunk/Source/WebCore/ChangeLog
r245039 r245043 1 2019-05-07 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] A new request should always suppress the pending request if any 4 https://bugs.webkit.org/show_bug.cgi?id=191517 5 <rdar://problem/46888222> 6 7 Reviewed by Brent Fulgham. 8 9 Blocking new requests from the same page when there is a pending request could DoS the 10 WebAuthN API in the period between [the page is refreshed, the pending request is 11 hanedled/timeout]. Therefore, the policy will be to always cancel any pending requests 12 whenever a new request is made. This will enforce the policy of handling only one 13 request at a time. 14 15 Covered by new tests in existing files. 16 17 * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: 18 (WebCore::AuthenticatorCoordinatorClient::requestReply): 19 (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler): 20 (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler): 21 * Modules/webauthn/AuthenticatorCoordinatorClient.h: 22 1 23 2019-05-07 Eric Carlson <eric.carlson@apple.com> 2 24 -
trunk/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.cpp
r238166 r245043 33 33 namespace WebCore { 34 34 35 void AuthenticatorCoordinatorClient::requestReply( const WebCore::PublicKeyCredentialData& data, const WebCore::ExceptionData& exception)35 void AuthenticatorCoordinatorClient::requestReply(uint64_t messageId, const WebCore::PublicKeyCredentialData& data, const WebCore::ExceptionData& exception) 36 36 { 37 if (messageId != m_accumulatedRequestMessageId - 1) 38 return; 37 39 m_pendingCompletionHandler(data, exception); 38 40 } … … 44 46 } 45 47 46 boolAuthenticatorCoordinatorClient::setRequestCompletionHandler(RequestCompletionHandler&& handler)48 uint64_t AuthenticatorCoordinatorClient::setRequestCompletionHandler(RequestCompletionHandler&& handler) 47 49 { 48 if (m_pendingCompletionHandler) { 49 handler({ }, { NotAllowedError, "A request is pending."_s }); 50 return false; 51 } 50 if (m_pendingCompletionHandler) 51 m_pendingCompletionHandler({ }, { NotAllowedError, "This request has been voided by a new request."_s }); 52 52 53 53 m_pendingCompletionHandler = WTFMove(handler); 54 return true;54 return m_accumulatedRequestMessageId++; 55 55 } 56 56 57 57 uint64_t AuthenticatorCoordinatorClient::addQueryCompletionHandler(QueryCompletionHandler&& handler) 58 58 { 59 uint64_t messageId = m_accumulated MessageId++;59 uint64_t messageId = m_accumulatedQueryMessageId++; 60 60 auto addResult = m_pendingQueryCompletionHandlers.add(messageId, WTFMove(handler)); 61 61 ASSERT_UNUSED(addResult, addResult.isNewEntry); -
trunk/Source/WebCore/Modules/webauthn/AuthenticatorCoordinatorClient.h
r238166 r245043 57 57 58 58 // Receivers. 59 void requestReply( const WebCore::PublicKeyCredentialData&, const WebCore::ExceptionData&);59 void requestReply(uint64_t messageId, const WebCore::PublicKeyCredentialData&, const WebCore::ExceptionData&); 60 60 void isUserVerifyingPlatformAuthenticatorAvailableReply(uint64_t messageId, bool); 61 61 62 62 protected: 63 // Only one request is allowed at one time. It returns false whenever there is an existingpending request.64 // A nd invokes the provided handler with NotAllowedError.65 boolsetRequestCompletionHandler(RequestCompletionHandler&&);63 // Only one request is allowed at one time. A new request will cancel any pending request. 64 // A message id that is tied to the request wil be generated each time to prevent mismatching responses. 65 uint64_t setRequestCompletionHandler(RequestCompletionHandler&&); 66 66 uint64_t addQueryCompletionHandler(QueryCompletionHandler&&); 67 67 68 68 private: 69 uint64_t m_accumulatedRequestMessageId { 1 }; 69 70 RequestCompletionHandler m_pendingCompletionHandler; 70 uint64_t m_accumulated MessageId { 1 };71 uint64_t m_accumulatedQueryMessageId { 1 }; 71 72 HashMap<uint64_t, QueryCompletionHandler> m_pendingQueryCompletionHandlers; 72 73 }; -
trunk/Source/WebKit/ChangeLog
r245041 r245043 1 2019-05-07 Jiewen Tan <jiewen_tan@apple.com> 2 3 [WebAuthN] A new request should always suppress the pending request if any 4 https://bugs.webkit.org/show_bug.cgi?id=191517 5 <rdar://problem/46888222> 6 7 Reviewed by Brent Fulgham. 8 9 Previously we blocked new WebAuthN requests whenever a pending request was in progress 10 to prevent background tabs from DoS foreground tabs. However, in r244938, the WebAuthN 11 API was changed to restrict request handling to the focused document. Therefore, we no 12 longer have a risk of DoS. 13 14 Apart from the vanished benefit, this behavoir actually blocks new pages to use 15 WebAuthN API in the period between [the previous initating page is closed, the pending 16 request is hanedled/timeout]. 17 18 Also, it makes sense to have the current focused document preempt the pending request. 19 Therefore, the policy will be to always cancel any pending requests whenever a new 20 request is made. This will enforce the policy of handling only one request at a time. 21 22 Note that the current implementation doesn't explicitly cancel pending requests in the 23 Authenticators, which means that we could receive responses from the Authenticator that 24 were meant for a previous (now cancelled) request. A follow-up patch (see Bug 191523) 25 will implement an Authenticator feature to support immediate cancellation. 26 27 In the meantime, to protect the atomicity of the request/response pair, i.e., preventing an old 28 response being used for a new request, there are two safeguards: 29 1) In web process, each request to UI process is paired with an incremental ID, and therefore an old 30 response from UI process would have a different ID than the current request, which will then be ignored. 31 2) In UI process, all responses from authenticators will be piped to the main run loop for processing. 32 Therefore, when the new request comes in, the old response is either processed or waiting in the pipe. 33 To prevent the latter being processed, the new request will immediately destroy any authenticators bound 34 to the old response in the current run loop. Hence, in the next run loop when dealing the old response, 35 the lambda will have no where to hand the response over. 36 37 * UIProcess/WebAuthentication/AuthenticatorManager.cpp: 38 (WebKit::AuthenticatorManager::makeCredential): 39 (WebKit::AuthenticatorManager::getAssertion): 40 (WebKit::AuthenticatorManager::clearStateAsync): 41 (WebKit::AuthenticatorManager::clearState): 42 (WebKit::AuthenticatorManager::timeOutTimerFired): 43 * UIProcess/WebAuthentication/AuthenticatorManager.h: 44 * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: 45 (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): 46 (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): 47 (WebKit::WebAuthenticatorCoordinatorProxy::requestReply): 48 * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: 49 * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: 50 * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: 51 (WebKit::WebAuthenticatorCoordinator::makeCredential): 52 (WebKit::WebAuthenticatorCoordinator::getAssertion): 53 * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: 54 1 55 2019-05-07 Per Arne Vollan <pvollan@apple.com> 2 56 -
trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp
r239852 r245043 130 130 131 131 if (m_pendingCompletionHandler) { 132 callback(ExceptionData { NotAllowedError, "A request is pending."_s }); 133 return; 132 m_pendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by a new request."_s }); 133 clearState(); 134 m_requestTimeOutTimer.stop(); 134 135 } 135 136 … … 148 149 149 150 if (m_pendingCompletionHandler) { 150 callback(ExceptionData { NotAllowedError, "A request is pending."_s }); 151 return; 151 m_pendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by a new request."_s }); 152 clearState(); 153 m_requestTimeOutTimer.stop(); 152 154 } 153 155 … … 167 169 if (!weakThis) 168 170 return; 169 weakThis->m_pendingRequestData = { }; 170 ASSERT(!weakThis->m_pendingCompletionHandler); 171 weakThis->m_services.clear(); 172 weakThis->m_authenticators.clear(); 171 weakThis->clearState(); 173 172 }); 173 } 174 175 void AuthenticatorManager::clearState() 176 { 177 m_pendingRequestData = { }; 178 ASSERT(!m_pendingCompletionHandler); 179 m_services.clear(); 180 m_authenticators.clear(); 174 181 } 175 182 … … 232 239 ASSERT(m_requestTimeOutTimer.isActive()); 233 240 m_pendingCompletionHandler((ExceptionData { NotAllowedError, "Operation timed out."_s })); 234 clearState Async();241 clearState(); 235 242 } 236 243 -
trunk/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h
r239427 r245043 63 63 RunLoop::Timer<AuthenticatorManager>& requestTimeOutTimer() { return m_requestTimeOutTimer; } 64 64 void clearStateAsync(); // To void cyclic dependence. 65 void clearState(); 65 66 66 67 private: … … 80 81 void timeOutTimerFired(); 81 82 82 // Request: We only allow one request per time. 83 // Request: We only allow one request per time. A new request will cancel any pending ones. 83 84 WebAuthenticationRequestData m_pendingRequestData; 84 85 Callback m_pendingCompletionHandler; -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp
r238221 r245043 54 54 } 55 55 56 void WebAuthenticatorCoordinatorProxy::makeCredential( const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions& options)56 void WebAuthenticatorCoordinatorProxy::makeCredential(uint64_t messageId, const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions& options) 57 57 { 58 auto callback = [ weakThis = makeWeakPtr(*this)] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) {58 auto callback = [messageId, weakThis = makeWeakPtr(*this)] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { 59 59 ASSERT(RunLoop::isMain()); 60 60 if (!weakThis) … … 62 62 63 63 WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData& data) { 64 weakThis->requestReply( data, { });64 weakThis->requestReply(messageId, data, { }); 65 65 }, [&](const WebCore::ExceptionData& exception) { 66 weakThis->requestReply( { }, exception);66 weakThis->requestReply(messageId, { }, exception); 67 67 }); 68 68 }; … … 70 70 } 71 71 72 void WebAuthenticatorCoordinatorProxy::getAssertion( const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions& options)72 void WebAuthenticatorCoordinatorProxy::getAssertion(uint64_t messageId, const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions& options) 73 73 { 74 auto callback = [ weakThis = makeWeakPtr(*this)] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) {74 auto callback = [messageId, weakThis = makeWeakPtr(*this)] (Variant<WebCore::PublicKeyCredentialData, WebCore::ExceptionData>&& result) { 75 75 ASSERT(RunLoop::isMain()); 76 76 if (!weakThis) … … 78 78 79 79 WTF::switchOn(result, [&](const WebCore::PublicKeyCredentialData& data) { 80 weakThis->requestReply( data, { });80 weakThis->requestReply(messageId, data, { }); 81 81 }, [&](const WebCore::ExceptionData& exception) { 82 weakThis->requestReply( { }, exception);82 weakThis->requestReply(messageId, { }, exception); 83 83 }); 84 84 }; … … 91 91 } 92 92 93 void WebAuthenticatorCoordinatorProxy::requestReply( const WebCore::PublicKeyCredentialData& data, const WebCore::ExceptionData& exception)93 void WebAuthenticatorCoordinatorProxy::requestReply(uint64_t messageId, const WebCore::PublicKeyCredentialData& data, const WebCore::ExceptionData& exception) 94 94 { 95 m_webPageProxy.send(Messages::WebAuthenticatorCoordinator::RequestReply( data, exception));95 m_webPageProxy.send(Messages::WebAuthenticatorCoordinator::RequestReply(messageId, data, exception)); 96 96 } 97 97 -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h
r236481 r245043 55 55 56 56 // Receivers. 57 void makeCredential( const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions&);58 void getAssertion( const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions&);57 void makeCredential(uint64_t messageId, const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions&); 58 void getAssertion(uint64_t messageId, const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions&); 59 59 void isUserVerifyingPlatformAuthenticatorAvailable(uint64_t messageId); 60 60 61 61 // Senders. 62 void requestReply( const WebCore::PublicKeyCredentialData&, const WebCore::ExceptionData&);62 void requestReply(uint64_t messageId, const WebCore::PublicKeyCredentialData&, const WebCore::ExceptionData&); 63 63 64 64 WebPageProxy& m_webPageProxy; -
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in
r235888 r245043 27 27 messages -> WebAuthenticatorCoordinatorProxy { 28 28 29 MakeCredential( Vector<uint8_t> hash, struct WebCore::PublicKeyCredentialCreationOptions options);30 GetAssertion( Vector<uint8_t> hash, struct WebCore::PublicKeyCredentialRequestOptions options);29 MakeCredential(uint64_t messageId, Vector<uint8_t> hash, struct WebCore::PublicKeyCredentialCreationOptions options); 30 GetAssertion(uint64_t messageId, Vector<uint8_t> hash, struct WebCore::PublicKeyCredentialRequestOptions options); 31 31 IsUserVerifyingPlatformAuthenticatorAvailable(uint64_t messageId); 32 32 } -
trunk/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp
r235888 r245043 51 51 void WebAuthenticatorCoordinator::makeCredential(const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialCreationOptions& options, WebCore::RequestCompletionHandler&& handler) 52 52 { 53 if (!setRequestCompletionHandler(WTFMove(handler))) 54 return; 55 56 m_webPage.send(Messages::WebAuthenticatorCoordinatorProxy::MakeCredential(hash, options)); 53 auto messageId = setRequestCompletionHandler(WTFMove(handler)); 54 m_webPage.send(Messages::WebAuthenticatorCoordinatorProxy::MakeCredential(messageId, hash, options)); 57 55 } 58 56 59 57 void WebAuthenticatorCoordinator::getAssertion(const Vector<uint8_t>& hash, const WebCore::PublicKeyCredentialRequestOptions& options, WebCore::RequestCompletionHandler&& handler) 60 58 { 61 if (!setRequestCompletionHandler(WTFMove(handler))) 62 return; 63 64 m_webPage.send(Messages::WebAuthenticatorCoordinatorProxy::GetAssertion(hash, options)); 59 auto messageId = setRequestCompletionHandler(WTFMove(handler)); 60 m_webPage.send(Messages::WebAuthenticatorCoordinatorProxy::GetAssertion(messageId, hash, options)); 65 61 } 66 62 -
trunk/Source/WebKit/WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in
r235888 r245043 27 27 messages -> WebAuthenticatorCoordinator { 28 28 29 RequestReply( struct WebCore::PublicKeyCredentialData data, struct WebCore::ExceptionData exception);29 RequestReply(uint64_t messageId, struct WebCore::PublicKeyCredentialData data, struct WebCore::ExceptionData exception); 30 30 IsUserVerifyingPlatformAuthenticatorAvailableReply(uint64_t messageId, bool result); 31 31 }
Note:
See TracChangeset
for help on using the changeset viewer.