Commit 173b8417 authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

fido: make GetAssertionRequestHandler use AuthTokenRequester

This replaces the bits of GetAssertionRequestHandler that request a
PIN/UV Auth Token by calling out to AuthTokenRequester instead. See
CL:2469445 for the equivalent CL for MakeCredential.

Bug: 1139111
Change-Id: I1669258ffabc679a5b6d0592ed14fbdaa710dc3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2536930Reviewed-by: default avatarNina Satragno <nsatragno@chromium.org>
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/master@{#829271}
parent 93bac529
...@@ -73,18 +73,18 @@ void FidoAuthenticator::ChangePIN(const std::string& old_pin, ...@@ -73,18 +73,18 @@ void FidoAuthenticator::ChangePIN(const std::string& old_pin,
NOTREACHED(); NOTREACHED();
} }
FidoAuthenticator::MakeCredentialPINUVDisposition FidoAuthenticator::PINUVDisposition
FidoAuthenticator::PINUVDispositionForMakeCredential( FidoAuthenticator::PINUVDispositionForMakeCredential(
const CtapMakeCredentialRequest& request, const CtapMakeCredentialRequest& request,
const FidoRequestHandlerBase::Observer* observer) { const FidoRequestHandlerBase::Observer* observer) {
return MakeCredentialPINUVDisposition::kNoUV; return PINUVDisposition::kNoUV;
} }
FidoAuthenticator::GetAssertionPINDisposition FidoAuthenticator::PINUVDisposition
FidoAuthenticator::WillNeedPINToGetAssertion( FidoAuthenticator::PINUVDispositionForGetAssertion(
const CtapGetAssertionRequest& request, const CtapGetAssertionRequest& request,
const FidoRequestHandlerBase::Observer* observer) { const FidoRequestHandlerBase::Observer* observer) {
return GetAssertionPINDisposition::kNoPIN; return PINUVDisposition::kNoUV;
} }
void FidoAuthenticator::GetCredentialsMetadata( void FidoAuthenticator::GetCredentialsMetadata(
......
...@@ -146,9 +146,9 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAuthenticator { ...@@ -146,9 +146,9 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAuthenticator {
const std::string& new_pin, const std::string& new_pin,
SetPINCallback callback); SetPINCallback callback);
// MakeCredentialPINUVDisposition enumerates the possible options for // PINUVDisposition enumerates the possible options for obtaining user
// obtaining user verification when making a credential. // verification when making a CTAP2 request.
enum class MakeCredentialPINUVDisposition { enum class PINUVDisposition {
// No UV (neither clientPIN nor internal) is needed to make this // No UV (neither clientPIN nor internal) is needed to make this
// credential. // credential.
kNoUV, kNoUV,
...@@ -165,31 +165,17 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAuthenticator { ...@@ -165,31 +165,17 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoAuthenticator {
// The request cannot be satisfied by this authenticator. // The request cannot be satisfied by this authenticator.
kUnsatisfiable, kUnsatisfiable,
}; };
// PINUVDispositionForMakeCredential returns whether and how user verification
// PINUVDisposition returns whether and how user verification
// should be obtained in order to serve the given request on this // should be obtained in order to serve the given request on this
// authenticator. // authenticator.
virtual MakeCredentialPINUVDisposition PINUVDispositionForMakeCredential( virtual PINUVDisposition PINUVDispositionForMakeCredential(
const CtapMakeCredentialRequest& request, const CtapMakeCredentialRequest& request,
const FidoRequestHandlerBase::Observer* observer); const FidoRequestHandlerBase::Observer* observer);
// GetAssertionPINDisposition enumerates the possible interactions between
// a user-verification level and the PIN support of an authenticator when
// getting an assertion.
enum class GetAssertionPINDisposition {
// kNoPIN means that a PIN will not be needed for this assertion.
kNoPIN,
// kUsePIN means that a PIN must be gathered and used for this assertion.
kUsePIN,
// kUsePINForFallback means that a PIN may be used for fallback if internal
// user verification fails.
kUsePINForFallback,
// kUnsatisfiable means that the request cannot be satisfied by this
// authenticator.
kUnsatisfiable,
};
// WillNeedPINToGetAssertion returns whether a PIN prompt will be needed to // WillNeedPINToGetAssertion returns whether a PIN prompt will be needed to
// serve the given request on this authenticator. // serve the given request on this authenticator.
virtual GetAssertionPINDisposition WillNeedPINToGetAssertion( virtual PINUVDisposition PINUVDispositionForGetAssertion(
const CtapGetAssertionRequest& request, const CtapGetAssertionRequest& request,
const FidoRequestHandlerBase::Observer* observer); const FidoRequestHandlerBase::Observer* observer);
......
...@@ -349,7 +349,7 @@ void FidoDeviceAuthenticator::OnHaveEphemeralKeyForChangePIN( ...@@ -349,7 +349,7 @@ void FidoDeviceAuthenticator::OnHaveEphemeralKeyForChangePIN(
std::move(callback), base::BindOnce(&pin::EmptyResponse::Parse)); std::move(callback), base::BindOnce(&pin::EmptyResponse::Parse));
} }
FidoAuthenticator::MakeCredentialPINUVDisposition FidoAuthenticator::PINUVDisposition
FidoDeviceAuthenticator::PINUVDispositionForMakeCredential( FidoDeviceAuthenticator::PINUVDispositionForMakeCredential(
const CtapMakeCredentialRequest& request, const CtapMakeCredentialRequest& request,
const FidoRequestHandlerBase::Observer* observer) { const FidoRequestHandlerBase::Observer* observer) {
...@@ -363,9 +363,6 @@ FidoDeviceAuthenticator::PINUVDispositionForMakeCredential( ...@@ -363,9 +363,6 @@ FidoDeviceAuthenticator::PINUVDispositionForMakeCredential(
Options()->user_verification_availability == Options()->user_verification_availability ==
UserVerificationAvailability::kSupportedAndConfigured; UserVerificationAvailability::kSupportedAndConfigured;
const bool can_get_token =
(can_collect_pin && pin_supported) || CanGetUvToken();
// CTAP 2.0 requires a PIN for credential creation once a PIN has been set. // CTAP 2.0 requires a PIN for credential creation once a PIN has been set.
// Thus, if fallback to U2F isn't possible, a PIN will be needed if set. // Thus, if fallback to U2F isn't possible, a PIN will be needed if set.
const bool u2f_fallback_possible = const bool u2f_fallback_possible =
...@@ -373,73 +370,74 @@ FidoDeviceAuthenticator::PINUVDispositionForMakeCredential( ...@@ -373,73 +370,74 @@ FidoDeviceAuthenticator::PINUVDispositionForMakeCredential(
device()->device_info()->versions.contains(ProtocolVersion::kU2f) && device()->device_info()->versions.contains(ProtocolVersion::kU2f) &&
IsConvertibleToU2fRegisterCommand(request) && IsConvertibleToU2fRegisterCommand(request) &&
!ShouldPreferCTAP2EvenIfItNeedsAPIN(request); !ShouldPreferCTAP2EvenIfItNeedsAPIN(request);
const bool uv_required =
request.user_verification == UserVerificationRequirement::kRequired || const UserVerificationRequirement uv_requirement =
(pin_configured && !u2f_fallback_possible); (pin_configured && !u2f_fallback_possible)
const bool uv_preferred = ? UserVerificationRequirement::kRequired
request.user_verification == UserVerificationRequirement::kPreferred; : request.user_verification;
if (!uv_required && !(uv_preferred && (pin_configured || uv_configured))) { if (uv_requirement == UserVerificationRequirement::kDiscouraged ||
return MakeCredentialPINUVDisposition::kNoUV; (uv_requirement == UserVerificationRequirement::kPreferred &&
((!pin_configured || !can_collect_pin) && !uv_configured))) {
return PINUVDisposition::kNoUV;
} }
// Authenticators with built-in UV that don't support UV token should try // Authenticators with built-in UV that don't support UV token should try
// sending the request as-is with uv=true first. // sending the request as-is with uv=true first.
if (uv_configured && !CanGetUvToken()) { if (uv_configured && !CanGetUvToken()) {
return (can_collect_pin && pin_supported) return (can_collect_pin && pin_supported)
? MakeCredentialPINUVDisposition::kNoTokenInternalUVPINFallback ? PINUVDisposition::kNoTokenInternalUVPINFallback
: MakeCredentialPINUVDisposition::kNoTokenInternalUV; : PINUVDisposition::kNoTokenInternalUV;
} }
const bool can_get_token =
(can_collect_pin && pin_supported) || CanGetUvToken();
if (can_get_token) { if (can_get_token) {
return MakeCredentialPINUVDisposition::kGetToken; return PINUVDisposition::kGetToken;
} }
return MakeCredentialPINUVDisposition::kUnsatisfiable; return PINUVDisposition::kUnsatisfiable;
} }
FidoAuthenticator::GetAssertionPINDisposition FidoAuthenticator::PINUVDisposition
FidoDeviceAuthenticator::WillNeedPINToGetAssertion( FidoDeviceAuthenticator::PINUVDispositionForGetAssertion(
const CtapGetAssertionRequest& request, const CtapGetAssertionRequest& request,
const FidoRequestHandlerBase::Observer* observer) { const FidoRequestHandlerBase::Observer* observer) {
const bool can_use_pin = (Options()->client_pin_availability == // TODO(crbug.com/1149405): GetAssertion requests don't allow in-line UV
AuthenticatorSupportedOptions:: // enrollment. Perhaps we should change this and align with MakeCredential
ClientPinAvailability::kSupportedAndPinSet) && // behavior.
// The PIN is effectively unavailable if there's no const bool can_collect_pin = observer && observer->SupportsPIN();
// UI support for collecting it. const bool pin_configured = Options()->client_pin_availability ==
observer && observer->SupportsPIN(); ClientPinAvailability::kSupportedAndPinSet;
// Authenticators with built-in UV can use that. const bool uv_configured =
if (Options()->user_verification_availability == Options()->user_verification_availability ==
UserVerificationAvailability::kSupportedAndConfigured) { UserVerificationAvailability::kSupportedAndConfigured;
return can_use_pin ? GetAssertionPINDisposition::kUsePINForFallback
: GetAssertionPINDisposition::kNoPIN;
}
const bool resident_key_request = request.allow_list.empty(); const UserVerificationRequirement uv_requirement =
request.allow_list.empty() ? UserVerificationRequirement::kRequired
: request.user_verification;
if (resident_key_request) { if (uv_requirement == UserVerificationRequirement::kDiscouraged ||
if (can_use_pin) { (uv_requirement == UserVerificationRequirement::kPreferred &&
return GetAssertionPINDisposition::kUsePIN; ((!pin_configured || !can_collect_pin) && !uv_configured))) {
} return PINUVDisposition::kNoUV;
return GetAssertionPINDisposition::kUnsatisfiable;
} }
// If UV is required then the PIN must be used if set, or else this request // Authenticators with built-in UV that don't support UV token should try
// cannot be satisfied. // sending the request as-is with uv=true first.
if (request.user_verification == UserVerificationRequirement::kRequired) { if (uv_configured && !CanGetUvToken()) {
if (can_use_pin) { return (can_collect_pin && pin_configured)
return GetAssertionPINDisposition::kUsePIN; ? PINUVDisposition::kNoTokenInternalUVPINFallback
} : PINUVDisposition::kNoTokenInternalUV;
return GetAssertionPINDisposition::kUnsatisfiable;
} }
// If UV is preferred and a PIN is set, use it. if ((can_collect_pin && pin_configured) || CanGetUvToken()) {
if (request.user_verification == UserVerificationRequirement::kPreferred && return PINUVDisposition::kGetToken;
can_use_pin) {
return GetAssertionPINDisposition::kUsePIN;
} }
return GetAssertionPINDisposition::kNoPIN;
return PINUVDisposition::kUnsatisfiable;
} }
void FidoDeviceAuthenticator::GetCredentialsMetadata( void FidoDeviceAuthenticator::GetCredentialsMetadata(
......
...@@ -67,13 +67,13 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoDeviceAuthenticator ...@@ -67,13 +67,13 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoDeviceAuthenticator
void ChangePIN(const std::string& old_pin, void ChangePIN(const std::string& old_pin,
const std::string& new_pin, const std::string& new_pin,
SetPINCallback callback) override; SetPINCallback callback) override;
MakeCredentialPINUVDisposition PINUVDispositionForMakeCredential( PINUVDisposition PINUVDispositionForMakeCredential(
const CtapMakeCredentialRequest& request, const CtapMakeCredentialRequest& request,
const FidoRequestHandlerBase::Observer* observer) override; const FidoRequestHandlerBase::Observer* observer) override;
// WillNeedPINToGetAssertion returns whether a PIN prompt will be needed to // WillNeedPINToGetAssertion returns whether a PIN prompt will be needed to
// serve the given request on this authenticator. // serve the given request on this authenticator.
GetAssertionPINDisposition WillNeedPINToGetAssertion( PINUVDisposition PINUVDispositionForGetAssertion(
const CtapGetAssertionRequest& request, const CtapGetAssertionRequest& request,
const FidoRequestHandlerBase::Observer* observer) override; const FidoRequestHandlerBase::Observer* observer) override;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define DEVICE_FIDO_GET_ASSERTION_REQUEST_HANDLER_H_ #define DEVICE_FIDO_GET_ASSERTION_REQUEST_HANDLER_H_
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/optional.h" #include "base/optional.h"
#include "device/fido/auth_token_requester.h"
#include "device/fido/authenticator_get_assertion_response.h" #include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/ctap_get_assertion_request.h" #include "device/fido/ctap_get_assertion_request.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
...@@ -29,7 +31,6 @@ class FidoAuthenticator; ...@@ -29,7 +31,6 @@ class FidoAuthenticator;
class FidoDiscoveryFactory; class FidoDiscoveryFactory;
namespace pin { namespace pin {
struct RetriesResponse;
class TokenResponse; class TokenResponse;
} // namespace pin } // namespace pin
...@@ -51,7 +52,8 @@ enum class GetAssertionStatus { ...@@ -51,7 +52,8 @@ enum class GetAssertionStatus {
}; };
class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
: public FidoRequestHandlerBase { : public FidoRequestHandlerBase,
public AuthTokenRequester::Delegate {
public: public:
using CompletionCallback = base::OnceCallback<void( using CompletionCallback = base::OnceCallback<void(
GetAssertionStatus, GetAssertionStatus,
...@@ -70,10 +72,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler ...@@ -70,10 +72,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
private: private:
enum class State { enum class State {
kWaitingForTouch, kWaitingForTouch,
kWaitingForSecondTouch, kWaitingForToken,
kGettingRetries, kWaitingForResponseWithToken,
kWaitingForPIN,
kRequestWithPIN,
kReadingMultipleResponses, kReadingMultipleResponses,
kFinished, kFinished,
}; };
...@@ -89,6 +89,24 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler ...@@ -89,6 +89,24 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
void AuthenticatorRemoved(FidoDiscoveryBase* discovery, void AuthenticatorRemoved(FidoDiscoveryBase* discovery,
FidoAuthenticator* authenticator) override; FidoAuthenticator* authenticator) override;
// AuthTokenRequester::Delegate:
void AuthenticatorSelectedForPINUVAuthToken(
FidoAuthenticator* authenticator) override;
void CollectNewPIN(uint32_t min_pin_length,
ProvidePINCallback provide_pin_cb) override;
void CollectExistingPIN(int attempts,
uint32_t min_pin_length,
ProvidePINCallback provide_pin_cb) override;
void PromptForInternalUVRetry(int attempts) override;
void InternalUVLockedForAuthToken() override;
void HavePINUVAuthTokenResultForAuthenticator(
FidoAuthenticator* authenticator,
AuthTokenRequester::Result result,
base::Optional<pin::TokenResponse> response) override;
void ObtainPINUVAuthToken(FidoAuthenticator* authenticator,
std::set<pin::Permissions> permissions,
bool skip_pin_touch);
void HandleResponse( void HandleResponse(
FidoAuthenticator* authenticator, FidoAuthenticator* authenticator,
CtapGetAssertionRequest request, CtapGetAssertionRequest request,
...@@ -100,22 +118,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler ...@@ -100,22 +118,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
CtapGetAssertionRequest request, CtapGetAssertionRequest request,
CtapDeviceResponseCode response_code, CtapDeviceResponseCode response_code,
base::Optional<AuthenticatorGetAssertionResponse> response); base::Optional<AuthenticatorGetAssertionResponse> response);
void CollectPINThenSendRequest(FidoAuthenticator* authenticator);
void StartPINFallbackForInternalUv(FidoAuthenticator* authenticator);
void TerminateUnsatisfiableRequestPostTouch(FidoAuthenticator* authenticator); void TerminateUnsatisfiableRequestPostTouch(FidoAuthenticator* authenticator);
void OnPinRetriesResponse(CtapDeviceResponseCode status,
base::Optional<pin::RetriesResponse> response);
void OnHavePIN(std::string pin);
void OnHavePINToken(CtapDeviceResponseCode status,
base::Optional<pin::TokenResponse> response);
void OnStartUvTokenOrFallback(FidoAuthenticator* authenticator,
CtapDeviceResponseCode status,
base::Optional<pin::RetriesResponse> response);
void OnUvRetriesResponse(CtapDeviceResponseCode status,
base::Optional<pin::RetriesResponse> response);
void OnHaveUvToken(FidoAuthenticator* authenticator,
CtapDeviceResponseCode status,
base::Optional<pin::TokenResponse> response);
void DispatchRequestWithToken(pin::TokenResponse token); void DispatchRequestWithToken(pin::TokenResponse token);
void OnGetAssertionSuccess(FidoAuthenticator* authenticator, void OnGetAssertionSuccess(FidoAuthenticator* authenticator,
CtapGetAssertionRequest request); CtapGetAssertionRequest request);
...@@ -132,23 +135,32 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler ...@@ -132,23 +135,32 @@ class COMPONENT_EXPORT(DEVICE_FIDO) GetAssertionRequestHandler
CtapGetAssertionRequest request_; CtapGetAssertionRequest request_;
CtapGetAssertionOptions options_; CtapGetAssertionOptions options_;
base::Optional<pin::TokenResponse> pin_token_; base::Optional<pin::TokenResponse> pin_token_;
// If true, and if at the time the request is dispatched to the first // If true, and if at the time the request is dispatched to the first
// authenticator no other authenticators are available, the request handler // authenticator no other authenticators are available, the request handler
// will skip the initial touch that is usually required to select a PIN // will skip the initial touch that is usually required to select a PIN
// protected authenticator. // protected authenticator.
bool allow_skipping_pin_touch_; bool allow_skipping_pin_touch_;
// authenticator_ points to the authenticator that will be used for this
// operation. It's only set after the user touches an authenticator to select // selected_authenticator_for_pin_uv_auth_token_ points to the authenticator
// it, after which point that authenticator will be used exclusively through // that was tapped by the user while requesting a pinUvAuthToken from
// requesting PIN etc. The object is owned by the underlying discovery object // connected authenticators. The object is owned by the underlying discovery
// and this pointer is cleared if it's removed during processing. // object and this pointer is cleared if it's removed during processing.
FidoAuthenticator* authenticator_ = nullptr; FidoAuthenticator* selected_authenticator_for_pin_uv_auth_token_ = nullptr;
// responses_ holds the set of responses while they are incrementally read // responses_ holds the set of responses while they are incrementally read
// from the device. Only used when more than one response is returned. // from the device. Only used when more than one response is returned.
std::vector<AuthenticatorGetAssertionResponse> responses_; std::vector<AuthenticatorGetAssertionResponse> responses_;
// remaining_responses_ contains the number of responses that remain to be // remaining_responses_ contains the number of responses that remain to be
// read when multiple responses are returned. // read when multiple responses are returned.
size_t remaining_responses_ = 0; size_t remaining_responses_ = 0;
// auth_token_requester_map_ holds active AuthTokenRequesters for
// authenticators that need a pinUvAuthToken to service the request.
std::map<FidoAuthenticator*, std::unique_ptr<AuthTokenRequester>>
auth_token_requester_map_;
SEQUENCE_CHECKER(my_sequence_checker_); SEQUENCE_CHECKER(my_sequence_checker_);
base::WeakPtrFactory<GetAssertionRequestHandler> weak_factory_{this}; base::WeakPtrFactory<GetAssertionRequestHandler> weak_factory_{this};
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
namespace device { namespace device {
using MakeCredentialPINUVDisposition = using PINUVDisposition = FidoAuthenticator::PINUVDisposition;
FidoAuthenticator::MakeCredentialPINUVDisposition;
using BioEnrollmentAvailability = using BioEnrollmentAvailability =
AuthenticatorSupportedOptions::BioEnrollmentAvailability; AuthenticatorSupportedOptions::BioEnrollmentAvailability;
...@@ -130,7 +129,7 @@ MakeCredentialStatus IsCandidateAuthenticatorPostTouch( ...@@ -130,7 +129,7 @@ MakeCredentialStatus IsCandidateAuthenticatorPostTouch(
} }
if (authenticator->PINUVDispositionForMakeCredential(request, observer) == if (authenticator->PINUVDispositionForMakeCredential(request, observer) ==
MakeCredentialPINUVDisposition::kUnsatisfiable) { PINUVDisposition::kUnsatisfiable) {
return MakeCredentialStatus::kAuthenticatorMissingUserVerification; return MakeCredentialStatus::kAuthenticatorMissingUserVerification;
} }
...@@ -428,14 +427,14 @@ void MakeCredentialRequestHandler::DispatchRequest( ...@@ -428,14 +427,14 @@ void MakeCredentialRequestHandler::DispatchRequest(
auto uv_disposition = authenticator->PINUVDispositionForMakeCredential( auto uv_disposition = authenticator->PINUVDispositionForMakeCredential(
*request.get(), observer()); *request.get(), observer());
switch (uv_disposition) { switch (uv_disposition) {
case MakeCredentialPINUVDisposition::kNoUV: case PINUVDisposition::kNoUV:
case MakeCredentialPINUVDisposition::kNoTokenInternalUV: case PINUVDisposition::kNoTokenInternalUV:
case MakeCredentialPINUVDisposition::kNoTokenInternalUVPINFallback: case PINUVDisposition::kNoTokenInternalUVPINFallback:
break; break;
case MakeCredentialPINUVDisposition::kGetToken: case PINUVDisposition::kGetToken:
ObtainPINUVAuthToken(authenticator, skip_pin_touch); ObtainPINUVAuthToken(authenticator, skip_pin_touch);
return; return;
case MakeCredentialPINUVDisposition::kUnsatisfiable: case PINUVDisposition::kUnsatisfiable:
// |IsCandidateAuthenticatorPostTouch| should have handled this case. // |IsCandidateAuthenticatorPostTouch| should have handled this case.
NOTREACHED(); NOTREACHED();
return; return;
...@@ -529,8 +528,8 @@ void MakeCredentialRequestHandler::HavePINUVAuthTokenResultForAuthenticator( ...@@ -529,8 +528,8 @@ void MakeCredentialRequestHandler::HavePINUVAuthTokenResultForAuthenticator(
<< authenticator->GetId(); << authenticator->GetId();
return; return;
case AuthTokenRequester::Result::kPostTouchAuthenticatorInternalUVLock: case AuthTokenRequester::Result::kPostTouchAuthenticatorInternalUVLock:
HandleInternalUvLocked(authenticator); error = MakeCredentialStatus::kAuthenticatorMissingUserVerification;
return; break;
case AuthTokenRequester::Result::kPostTouchAuthenticatorResponseInvalid: case AuthTokenRequester::Result::kPostTouchAuthenticatorResponseInvalid:
error = MakeCredentialStatus::kAuthenticatorResponseInvalid; error = MakeCredentialStatus::kAuthenticatorResponseInvalid;
break; break;
...@@ -641,7 +640,7 @@ void MakeCredentialRequestHandler::HandleResponse( ...@@ -641,7 +640,7 @@ void MakeCredentialRequestHandler::HandleResponse(
(status == CtapDeviceResponseCode::kCtap2ErrPinAuthInvalid || (status == CtapDeviceResponseCode::kCtap2ErrPinAuthInvalid ||
status == CtapDeviceResponseCode::kCtap2ErrPinRequired) && status == CtapDeviceResponseCode::kCtap2ErrPinRequired) &&
authenticator->PINUVDispositionForMakeCredential(*request, observer()) == authenticator->PINUVDispositionForMakeCredential(*request, observer()) ==
MakeCredentialPINUVDisposition::kNoTokenInternalUVPINFallback) { PINUVDisposition::kNoTokenInternalUVPINFallback) {
// Authenticators without uvToken support will return this error immediately // Authenticators without uvToken support will return this error immediately
// without user interaction when internal UV is locked. // without user interaction when internal UV is locked.
const base::TimeDelta response_time = request_timer.Elapsed(); const base::TimeDelta response_time = request_timer.Elapsed();
...@@ -718,15 +717,6 @@ void MakeCredentialRequestHandler::HandleResponse( ...@@ -718,15 +717,6 @@ void MakeCredentialRequestHandler::HandleResponse(
.Run(MakeCredentialStatus::kSuccess, std::move(*response), authenticator); .Run(MakeCredentialStatus::kSuccess, std::move(*response), authenticator);
} }
void MakeCredentialRequestHandler::HandleInternalUvLocked(
FidoAuthenticator* authenticator) {
state_ = State::kFinished;
CancelActiveAuthenticators(authenticator->GetId());
std::move(completion_callback_)
.Run(MakeCredentialStatus::kAuthenticatorMissingUserVerification,
base::nullopt, nullptr);
}
void MakeCredentialRequestHandler::HandleInapplicableAuthenticator( void MakeCredentialRequestHandler::HandleInapplicableAuthenticator(
FidoAuthenticator* authenticator, FidoAuthenticator* authenticator,
std::unique_ptr<CtapMakeCredentialRequest> request) { std::unique_ptr<CtapMakeCredentialRequest> request) {
......
...@@ -178,7 +178,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) MakeCredentialRequestHandler ...@@ -178,7 +178,6 @@ class COMPONENT_EXPORT(DEVICE_FIDO) MakeCredentialRequestHandler
base::ElapsedTimer request_timer, base::ElapsedTimer request_timer,
CtapDeviceResponseCode response_code, CtapDeviceResponseCode response_code,
base::Optional<AuthenticatorMakeCredentialResponse> response); base::Optional<AuthenticatorMakeCredentialResponse> response);
void HandleInternalUvLocked(FidoAuthenticator* authenticator);
void HandleInapplicableAuthenticator( void HandleInapplicableAuthenticator(
FidoAuthenticator* authenticator, FidoAuthenticator* authenticator,
std::unique_ptr<CtapMakeCredentialRequest> request); std::unique_ptr<CtapMakeCredentialRequest> 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