Commit 8e5ee16d authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

fido: fix a Touch ID assertion regression

CL:1800725 changed the way TouchIdAuthenticator was injected into the
FidoRequestHandlerBase. As a result, the code in GetAssertionRequestHandler
that was supposed to set
|transport_availability_info().has_recognized_mac_touch_id_credential| to
indicate to the UI whether it may dispatch a request to the Touch ID
authenticator or not was never executed. As a result, all GetAssertion
requests to Touch ID resulted in an immediate UI error.

To fix, unify the two code paths for adding authenticators in
FidoRequestHandlerBase.

Fixed: 1012500
Change-Id: I3e6a4e84892c1843f2ca2acd947eaf68269089f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850799Reviewed-by: default avatarNina Satragno <nsatragno@chromium.org>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/master@{#704702}
parent 9ec83db6
...@@ -231,13 +231,6 @@ void FidoRequestHandlerBase::Start() { ...@@ -231,13 +231,6 @@ void FidoRequestHandlerBase::Start() {
discovery->Start(); discovery->Start();
} }
void FidoRequestHandlerBase::AuthenticatorAdded(
FidoDiscoveryBase* discovery,
FidoAuthenticator* authenticator) {
DCHECK(!base::Contains(active_authenticators(), authenticator->GetId()));
AddAuthenticator(authenticator);
}
void FidoRequestHandlerBase::AuthenticatorRemoved( void FidoRequestHandlerBase::AuthenticatorRemoved(
FidoDiscoveryBase* discovery, FidoDiscoveryBase* discovery,
FidoAuthenticator* authenticator) { FidoAuthenticator* authenticator) {
...@@ -288,14 +281,15 @@ void FidoRequestHandlerBase::DiscoveryStarted( ...@@ -288,14 +281,15 @@ void FidoRequestHandlerBase::DiscoveryStarted(
FidoDiscoveryBase* discovery, FidoDiscoveryBase* discovery,
bool success, bool success,
std::vector<FidoAuthenticator*> authenticators) { std::vector<FidoAuthenticator*> authenticators) {
for (auto* authenticator : authenticators) for (auto* authenticator : authenticators) {
AddAuthenticator(authenticator); AuthenticatorAdded(discovery, authenticator);
}
DCHECK(notify_observer_callback_); DCHECK(notify_observer_callback_);
notify_observer_callback_.Run(); notify_observer_callback_.Run();
} }
void FidoRequestHandlerBase::AddAuthenticator( void FidoRequestHandlerBase::AuthenticatorAdded(
FidoDiscoveryBase* discovery,
FidoAuthenticator* authenticator) { FidoAuthenticator* authenticator) {
DCHECK(authenticator && DCHECK(authenticator &&
!base::Contains(active_authenticators(), authenticator->GetId())); !base::Contains(active_authenticators(), authenticator->GetId()));
......
...@@ -262,7 +262,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoRequestHandlerBase ...@@ -262,7 +262,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoRequestHandlerBase
const base::flat_set<FidoTransportProtocol>& available_transports); const base::flat_set<FidoTransportProtocol>& available_transports);
#endif #endif
void AddAuthenticator(FidoAuthenticator* authenticator);
void NotifyObserverTransportAvailability(); void NotifyObserverTransportAvailability();
// Invokes FidoAuthenticator::InitializeAuthenticator(), followed by // Invokes FidoAuthenticator::InitializeAuthenticator(), followed by
......
...@@ -321,6 +321,9 @@ void GetAssertionRequestHandler::AuthenticatorAdded( ...@@ -321,6 +321,9 @@ void GetAssertionRequestHandler::AuthenticatorAdded(
DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(my_sequence_checker_);
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Indicate to the UI whether a GetAssertion call to Touch ID would succeed
// or not. This needs to happen before the base AuthenticatorAdded()
// implementation runs |notify_observer_callback_| for this callback.
if (authenticator->IsTouchIdAuthenticator()) { if (authenticator->IsTouchIdAuthenticator()) {
transport_availability_info().has_recognized_mac_touch_id_credential = transport_availability_info().has_recognized_mac_touch_id_credential =
static_cast<fido::mac::TouchIdAuthenticator*>(authenticator) static_cast<fido::mac::TouchIdAuthenticator*>(authenticator)
......
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