Commit c3d10e4d authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

fido: mark transport unavailable if a FidoDiscovery fails to start

A FidoRequestHandler currently reports a FidoTransportProtocol to its
Observer (i.e. the UI layer) as available, even if the FidoDiscovery for
that transport invoked DiscoveryStated() with success=false. It seems
logical in this case to act as if the discovery never had been
instantiated in the first place.

Change-Id: I50c2832f3b5bc321f2b9454e90770204c229b311
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087955
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748874}
parent d08f91aa
......@@ -279,8 +279,13 @@ void FidoRequestHandlerBase::DiscoveryStarted(
FidoDiscoveryBase* discovery,
bool success,
std::vector<FidoAuthenticator*> authenticators) {
for (auto* authenticator : authenticators) {
AuthenticatorAdded(discovery, authenticator);
if (!success) {
transport_availability_info_.available_transports.erase(
discovery->transport());
} else {
for (auto* authenticator : authenticators) {
AuthenticatorAdded(discovery, authenticator);
}
}
DCHECK(notify_observer_callback_);
notify_observer_callback_.Run();
......
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