Commit 63c078d5 authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

fido: make register requests resolve on timeout when using the Win WebAuthn API

When U2F requests that go through the native WebAuthn API on Windows time out,
the modal OS dialog for the request gets dimissed but the JS request promise
never gets resolved because the originating tab fails the focus check in
sendResponseToActiveTabOnly(). This appears to be caused by a race between the
cryptotoken-side focus check racing against Windows dismissing its dialog after
receiving the WebAuthNCancelCurrentOperation() call.

As a workaround, skip the focus check for all register timeouts.

Bug: 930015
Change-Id: I8f44e44a4a26d499e6681331d808af58eabbb573
Reviewed-on: https://chromium-review.googlesource.com/c/1461331
Commit-Queue: Martin Kreichgauer <martinkr@chromium.org>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630586}
parent 65117aaf
...@@ -77,6 +77,15 @@ function defaultResponseCallback(request, sendResponse, response) { ...@@ -77,6 +77,15 @@ function defaultResponseCallback(request, sendResponse, response) {
* @param {*} response The response to return. * @param {*} response The response to return.
*/ */
function sendResponseToActiveTabOnly(request, sender, sendResponse, response) { function sendResponseToActiveTabOnly(request, sender, sendResponse, response) {
// For WebAuthn-proxied requests on Windows, dismissing the native Windows
// UI after a timeout races with the error being returned here. Hence, skip
// the focus check for all timeouts.
if (response.responseData &&
response.responseData.errorCode == ErrorCodes.TIMEOUT) {
defaultResponseCallback(request, sendResponse, response);
return;
}
tabInForeground(sender.tab.id).then(function(result) { tabInForeground(sender.tab.id).then(function(result) {
// If the tab is no longer in the foreground, drop the result: the user // If the tab is no longer in the foreground, drop the result: the user
// is no longer interacting with the tab that originated the request. // is no longer interacting with the tab that originated the request.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment