Commit f497c3fa authored by Nina Satragno's avatar Nina Satragno Committed by Commit Bot

[webauthn] Remove erroneous DCHECK

Do not DCHECK on
ChromeAuthenticatorRequestDelegate::DoesBlockRequestOnFailure if the
authenticator is nullptr. This situation could arise if the user e.g.
disconnects the authenticator while setting the pin.

Bug: 990136
Change-Id: Iea8c509ef7ae2d74feabbc7d8e66cde51a266a69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733023
Auto-Submit: Nina Satragno <nsatragno@chromium.org>
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683696}
parent bf681b5e
...@@ -130,8 +130,6 @@ bool ChromeAuthenticatorRequestDelegate::DoesBlockRequestOnFailure( ...@@ -130,8 +130,6 @@ bool ChromeAuthenticatorRequestDelegate::DoesBlockRequestOnFailure(
if (!weak_dialog_model_) if (!weak_dialog_model_)
return false; return false;
DCHECK(authenticator || reason == InterestingFailureReason::kTimeout);
#if defined(OS_WIN) #if defined(OS_WIN)
if (authenticator && authenticator->IsWinNativeApiAuthenticator()) { if (authenticator && authenticator->IsWinNativeApiAuthenticator()) {
// Do not display a Chrome error dialog if the user cancels out of the // Do not display a Chrome error dialog if the user cancels out of the
......
...@@ -86,6 +86,17 @@ TEST_F(ChromeAuthenticatorRequestDelegateTest, ...@@ -86,6 +86,17 @@ TEST_F(ChromeAuthenticatorRequestDelegateTest,
EXPECT_EQ(kTestPairedDeviceAddress2, second_address_value.GetString()); EXPECT_EQ(kTestPairedDeviceAddress2, second_address_value.GetString());
} }
// Checks that DoesBlockRequestOnFailure does not crash if authenticator is
// nullptr and reason is not kTimeout. Regression test for crbug.com/990136.
TEST_F(ChromeAuthenticatorRequestDelegateTest,
DoesBlockRequestOnFailure__NullAuthenticator) {
ChromeAuthenticatorRequestDelegate delegate(main_rfh(), kRelyingPartyID);
EXPECT_TRUE(delegate.DoesBlockRequestOnFailure(
/*authenticator=*/nullptr,
ChromeAuthenticatorRequestDelegate::InterestingFailureReason::
kUserConsentDenied));
}
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
API_AVAILABLE(macos(10.12.2)) API_AVAILABLE(macos(10.12.2))
std::string TouchIdMetadataSecret( std::string TouchIdMetadataSecret(
......
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