#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/browser/webauth/authenticator_impl.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <list>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
#include "base/base64url.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/containers/flat_set.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/stack_allocated.h"
#include "base/notreached.h"
#include "base/rand_util.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_command_line.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/cbor/reader.h"
#include "components/cbor/values.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/webauthn/content/browser/internal_authenticator_impl.h"
#include "content/browser/webauth/authenticator_common_impl.h"
#include "content/browser/webauth/authenticator_environment.h"
#include "content/browser/webauth/client_data_json.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_authentication_request_proxy.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_renderer_host.h"
#include "crypto/sha2.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/fido/attested_credential_data.h"
#include "device/fido/authenticator_data.h"
#include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/authenticator_selection_criteria.h"
#include "device/fido/cable/cable_discovery_data.h"
#include "device/fido/cable/fido_tunnel_device.h"
#include "device/fido/cable/v2_authenticator.h"
#include "device/fido/cable/v2_constants.h"
#include "device/fido/cable/v2_discovery.h"
#include "device/fido/cable/v2_handshake.h"
#include "device/fido/cable/v2_test_util.h"
#include "device/fido/discoverable_credential_metadata.h"
#include "device/fido/fake_fido_discovery.h"
#include "device/fido/features.h"
#include "device/fido/fido_authenticator.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_discovery_base.h"
#include "device/fido/fido_parsing_utils.h"
#include "device/fido/fido_request_handler_base.h"
#include "device/fido/fido_transport_protocol.h"
#include "device/fido/fido_types.h"
#include "device/fido/filter.h"
#include "device/fido/large_blob.h"
#include "device/fido/mock_fido_device.h"
#include "device/fido/multiple_virtual_fido_device_factory.h"
#include "device/fido/pin.h"
#include "device/fido/public_key_credential_descriptor.h"
#include "device/fido/public_key_credential_params.h"
#include "device/fido/public_key_credential_rp_entity.h"
#include "device/fido/public_key_credential_user_entity.h"
#include "device/fido/virtual_ctap2_device.h"
#include "device/fido/virtual_fido_device.h"
#include "device/fido/virtual_fido_device_factory.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/functions.h"
#include "services/data_decoder/gzipper.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/webauthn/authenticator.mojom.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ec_key.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/hmac.h"
#include "third_party/boringssl/src/include/openssl/obj.h"
#include "url/origin.h"
#include "url/url_util.h"
#if BUILDFLAG(IS_MAC)
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "crypto/scoped_fake_apple_keychain_v2.h"
#include "device/fido/mac/authenticator_config.h"
#include "device/fido/mac/credential_store.h"
#include "device/fido/mac/icloud_keychain.h"
#include "device/fido/mac/scoped_icloud_keychain_test_environment.h"
#include "device/fido/mac/scoped_touch_id_test_environment.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/resource/resource_scale_factor.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "content/public/test/test_browser_context.h"
#include "device/fido/fido_test_data.h"
#include "device/fido/win/fake_webauthn_api.h"
#include "device/fido/win/util.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chromeos/dbus/tpm_manager/tpm_manager_client.h"
#include "chromeos/dbus/u2f/u2f_client.h"
#endif
namespace content {
_;
GetAssertionOutcome;
MakeCredentialOutcome;
RequestMode;
AttestationConveyancePreference;
AuthenticationExtensionsClientInputs;
AuthenticationExtensionsClientOutputs;
AuthenticatorSelectionCriteria;
AuthenticatorSelectionCriteriaPtr;
AuthenticatorStatus;
AuthenticatorTransport;
CableAuthentication;
CableAuthenticationPtr;
CommonCredentialInfo;
GetAssertionAuthenticatorResponse;
GetAssertionAuthenticatorResponsePtr;
MakeCredentialAuthenticatorResponse;
MakeCredentialAuthenticatorResponsePtr;
PublicKeyCredentialCreationOptions;
PublicKeyCredentialCreationOptionsPtr;
PublicKeyCredentialDescriptor;
PublicKeyCredentialDescriptorPtr;
PublicKeyCredentialParameters;
PublicKeyCredentialParametersPtr;
PublicKeyCredentialReportOptions;
PublicKeyCredentialReportOptionsPtr;
PublicKeyCredentialRequestOptions;
PublicKeyCredentialRequestOptionsPtr;
PublicKeyCredentialRpEntity;
PublicKeyCredentialRpEntityPtr;
PublicKeyCredentialType;
PublicKeyCredentialUserEntity;
PublicKeyCredentialUserEntityPtr;
RemoteDesktopClientOverride;
RemoteDesktopClientOverridePtr;
WebAuthnDOMExceptionDetails;
WebAuthnDOMExceptionDetailsPtr;
Reader;
Value;
VirtualCtap2Device;
VirtualFidoDevice;
Event;
namespace {
InterestingFailureReason;
FailureReasonFuture;
constexpr base::TimeDelta kTestTimeout = …;
constexpr size_t kTestCredentialIdLength = …;
constexpr char kTestOrigin1[] = …;
constexpr char kTestOrigin2[] = …;
constexpr char kTestRelyingPartyId[] = …;
constexpr char kExtensionScheme[] = …;
static constexpr char kCorpCrdOrigin[] = …;
constexpr uint8_t kTestChallengeBytes[] = …;
constexpr char kTestRegisterClientDataJsonString[] = …;
constexpr char kTestSignClientDataJsonString[] = …;
OriginClaimedAuthorityPair;
constexpr OriginClaimedAuthorityPair kValidRelyingPartyTestCases[] = …;
constexpr OriginClaimedAuthorityPair kInvalidRelyingPartyTestCases[] = …;
TestIsUvpaaFuture;
TestMakeCredentialFuture;
TestGetAssertionFuture;
TestRequestStartedFuture;
TestReportFuture;
std::vector<uint8_t> GetTestChallengeBytes() { … }
device::PublicKeyCredentialRpEntity GetTestPublicKeyCredentialRPEntity() { … }
device::PublicKeyCredentialUserEntity GetTestPublicKeyCredentialUserEntity() { … }
std::vector<device::PublicKeyCredentialParams::CredentialInfo>
GetTestPublicKeyCredentialParameters(int32_t algorithm_identifier) { … }
device::AuthenticatorSelectionCriteria GetTestAuthenticatorSelectionCriteria() { … }
std::vector<device::PublicKeyCredentialDescriptor> GetTestCredentials(
size_t num_credentials = 1) { … }
PublicKeyCredentialCreationOptionsPtr
GetTestPublicKeyCredentialCreationOptions() { … }
PublicKeyCredentialRequestOptionsPtr
GetTestPublicKeyCredentialRequestOptions() { … }
PublicKeyCredentialReportOptionsPtr GetTestPublicKeyCredentialReportOptions() { … }
std::vector<device::CableDiscoveryData> GetTestCableExtension() { … }
device::AuthenticatorData AuthDataFromMakeCredentialResponse(
const MakeCredentialAuthenticatorResponsePtr& response) { … }
bool HasUV(const MakeCredentialAuthenticatorResponsePtr& response) { … }
bool HasUV(const GetAssertionAuthenticatorResponsePtr& response) { … }
url::Origin GetTestOrigin() { … }
std::string GetTestClientDataJSON(ClientDataRequestType type) { … }
device::LargeBlob CompressLargeBlob(base::span<const uint8_t> blob) { … }
std::vector<uint8_t> UncompressLargeBlob(device::LargeBlob blob) { … }
device::AttestationConveyancePreference ConvertAttestationConveyancePreference(
AttestationConveyancePreference in) { … }
std::array<uint8_t, crypto::kSHA256Length> EvaluateHMAC(
base::span<const uint8_t> key,
base::span<const uint8_t> salt) { … }
}
class AuthenticatorTestBase : public RenderViewHostTestHarness { … };
class AuthenticatorImplTest : public AuthenticatorTestBase { … };
TEST_F(AuthenticatorImplTest, ClientDataJSONSerialization) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialOriginAndRpIds) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialUserVerification) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialResidentKeyUnsupported) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialPlatformAuthenticator) { … }
static void CheckJSONIsSubsetOfJSON(std::string_view subset_str,
std::string_view test_str) { … }
TEST(ClientDataSerializationTest, Register) { … }
TEST(ClientDataSerializationTest, Sign) { … }
TEST_F(AuthenticatorImplTest, TestMakeCredentialTimeout) { … }
TEST_F(AuthenticatorImplTest, GetAssertionOriginAndRpIds) { … }
TEST_F(AuthenticatorImplTest, ReportOriginAndRpIds) { … }
constexpr OriginClaimedAuthorityPair kValidAppIdCases[] = …;
TEST_F(AuthenticatorImplTest, AppIdExtensionValues) { … }
TEST_F(AuthenticatorImplTest, AppIdExtension) { … }
TEST_F(AuthenticatorImplTest, AppIdExcludeExtension) { … }
TEST_F(AuthenticatorImplTest, TestGetAssertionTimeout) { … }
TEST_F(AuthenticatorImplTest, OversizedCredentialId) { … }
TEST_F(AuthenticatorImplTest, NoSilentAuthenticationForCable) { … }
TEST_F(AuthenticatorImplTest, GuessAtTransportsForCable) { … }
TEST_F(AuthenticatorImplTest, TestGetAssertionU2fDeviceBackwardsCompatibility) { … }
TEST_F(AuthenticatorImplTest, GetAssertionWithEmptyAllowCredentials) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialAlreadyRegistered) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialPendingRequest) { … }
TEST_F(AuthenticatorImplTest, GetAssertionPendingRequest) { … }
TEST_F(AuthenticatorImplTest, ReportPendingRequest) { … }
TEST_F(AuthenticatorImplTest, NavigationDuringOperation) { … }
TEST_F(AuthenticatorImplTest, InvalidResponse) { … }
TEST_F(AuthenticatorImplTest, Ctap2AssertionWithUnknownCredential) { … }
TEST_F(AuthenticatorImplTest, GetAssertionResponseWithAttestedCredentialData) { … }
#if BUILDFLAG(IS_WIN)
TEST_F(AuthenticatorImplTest, Win_IsUVPAA) {
virtual_device_factory_->set_discover_win_webauthn_api_authenticator(true);
NavigateAndCommit(GURL(kTestOrigin1));
mojo::Remote<blink::mojom::Authenticator> authenticator =
ConnectToAuthenticator();
for (const bool enable_win_webauthn_api : {false, true}) {
SCOPED_TRACE(enable_win_webauthn_api ? "enable_win_webauthn_api"
: "!enable_win_webauthn_api");
for (const bool is_uvpaa : {false, true}) {
SCOPED_TRACE(is_uvpaa ? "is_uvpaa" : "!is_uvpaa");
for (bool is_off_the_record : {true, false}) {
SCOPED_TRACE(is_off_the_record ? "off the record" : "on the record");
static_cast<TestBrowserContext*>(GetBrowserContext())
->set_is_off_the_record(is_off_the_record);
fake_win_webauthn_api_.set_available(enable_win_webauthn_api);
fake_win_webauthn_api_.set_is_uvpaa(is_uvpaa);
EXPECT_EQ(AuthenticatorIsUvpaa(), enable_win_webauthn_api && is_uvpaa);
}
}
}
}
#endif
#if BUILDFLAG(IS_CHROMEOS)
TEST_F(AuthenticatorImplTest, IsUVPAA) {
NavigateAndCommit(GURL(kTestOrigin1));
EXPECT_FALSE(AuthenticatorIsUvpaa());
}
#endif
class TestWebAuthenticationRequestProxy : public WebAuthenticationRequestProxy { … };
class TestWebAuthenticationDelegate : public WebAuthenticationDelegate { … };
enum class EnterprisePolicy { … };
enum class AttestationConsent { … };
enum class AttestationType { … };
const char* AttestationConveyancePreferenceToString(
AttestationConveyancePreference v) { … }
const char* AttestationConveyancePreferenceToString(
device::AttestationConveyancePreference v) { … }
const char* AttestationConsentToString(AttestationConsent ac) { … }
class TestAuthenticatorRequestDelegate
: public AuthenticatorRequestClientDelegate { … };
class TestAuthenticatorContentBrowserClient : public ContentBrowserClient { … };
class AuthenticatorContentBrowserClientTest : public AuthenticatorImplTest { … };
TEST_F(AuthenticatorContentBrowserClientTest, MakeCredentialTLSError) { … }
TEST_F(AuthenticatorContentBrowserClientTest, GetAssertionTLSError) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
MakeCredentialSkipTLSCheckWithVirtualEnvironment) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
GetAssertionSkipTLSCheckWithVirtualEnvironment) { … }
TEST_F(AuthenticatorContentBrowserClientTest, TestGetAssertionCancel) { … }
TEST_F(AuthenticatorContentBrowserClientTest, TestMakeCredentialCancel) { … }
TEST_F(AuthenticatorContentBrowserClientTest, ChromeExtensions) { … }
TEST_F(AuthenticatorContentBrowserClientTest, ChromeExtensionBadRpIds) { … }
TEST_F(AuthenticatorContentBrowserClientTest, AttestationBehaviour) { … }
TEST_F(AuthenticatorContentBrowserClientTest, Ctap2EnterpriseAttestation) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
Ctap2EnterpriseAttestationUnsolicited) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
InappropriatelyIdentifyingAttestation) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
PlatformAuthenticatorAttestation) { … }
TEST_F(AuthenticatorContentBrowserClientTest, Ctap2SelfAttestation) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
Ctap2SelfAttestationNonZeroAaguid) { … }
TEST_F(AuthenticatorContentBrowserClientTest, BlockedAttestation) { … }
TEST_F(AuthenticatorContentBrowserClientTest, FilteringMakeCredential) { … }
TEST_F(AuthenticatorContentBrowserClientTest, FilteringGetAssertion) { … }
TEST_F(AuthenticatorContentBrowserClientTest, FilteringFailsOpen) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
MakeCredentialRequestStartedCallback) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
GetAssertionRequestStartedCallback) { … }
TEST_F(AuthenticatorContentBrowserClientTest, MakeCredentialStartOver) { … }
TEST_F(AuthenticatorContentBrowserClientTest, GetAssertionStartOver) { … }
TEST_F(AuthenticatorContentBrowserClientTest, Unfocused) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
NullDelegate_RejectsWithPendingRequest) { … }
TEST_F(AuthenticatorContentBrowserClientTest, IsUVPAAOverride) { … }
TEST_F(AuthenticatorContentBrowserClientTest,
GPMPasskeys_IsConditionalMediationAvailable) { … }
class AuthenticatorImplRemoteDesktopClientOverrideTest
: public AuthenticatorContentBrowserClientTest { … };
TEST_F(AuthenticatorImplRemoteDesktopClientOverrideTest, MakeCredential) { … }
TEST_F(AuthenticatorImplRemoteDesktopClientOverrideTest, GetAssertion) { … }
TEST_F(AuthenticatorImplRemoteDesktopClientOverrideTest, MakeCredentialAppid) { … }
TEST_F(AuthenticatorImplRemoteDesktopClientOverrideTest, GetAssertionAppid) { … }
class MockAuthenticatorRequestDelegateObserver
: public TestAuthenticatorRequestDelegate { … };
class FakeAuthenticatorCommonImpl : public AuthenticatorCommonImpl { … };
class AuthenticatorImplRequestDelegateTest : public AuthenticatorImplTest { … };
TEST_F(AuthenticatorImplRequestDelegateTest,
TestRequestDelegateObservesFidoRequestHandler) { … }
TEST_F(AuthenticatorImplRequestDelegateTest, FailureReasonForTimeout) { … }
TEST_F(AuthenticatorImplRequestDelegateTest,
FailureReasonForDuplicateRegistration) { … }
TEST_F(AuthenticatorImplRequestDelegateTest,
FailureReasonForMissingRegistration) { … }
TEST_F(AuthenticatorImplTest, NoNonAuthoritativeTransports) { … }
TEST_F(AuthenticatorImplTest, TransportsFromGetInfo) { … }
TEST_F(AuthenticatorImplTest, TransportsInAttestationCertificate) { … }
TEST_F(AuthenticatorImplTest, ExtensionHMACSecret) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialWithLargeExcludeList) { … }
TEST_F(AuthenticatorImplTest, GetAssertionResultMetricError) { … }
TEST_F(AuthenticatorImplTest, GetAssertionResultMetricSuccess) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialResultMetricError) { … }
TEST_F(AuthenticatorImplTest, MakeCredentialResultMetricSuccess) { … }
TEST_F(AuthenticatorImplTest, GetAssertionWithLargeAllowList) { … }
TEST_F(AuthenticatorImplTest, GetAssertionSingleElementAllowListDoesNotProbe) { … }
TEST_F(AuthenticatorImplTest, GetAssertionSingleBatchListDoesNotProbe) { … }
TEST_F(AuthenticatorImplTest, OptionalCredentialInAssertionResponse) { … }
TEST_F(AuthenticatorImplTest, AllowListWithOnlyOversizedCredentialIds) { … }
TEST_F(AuthenticatorImplTest, AllowListWithDuplicateCredentialIds) { … }
TEST_F(AuthenticatorImplTest, ExcludeListWithDuplicateCredentialIds) { … }
TEST_F(AuthenticatorImplTest, OversizedAllowList) { … }
TEST_F(AuthenticatorImplTest, OversizedExcludeList) { … }
TEST_F(AuthenticatorImplTest, NoUnexpectedAuthenticatorExtensions) { … }
TEST_F(AuthenticatorImplTest, NoUnexpectedClientExtensions) { … }
TEST_F(AuthenticatorImplTest, ExcludeListBatching) { … }
TEST_F(AuthenticatorImplTest, GetPublicKey) { … }
TEST_F(AuthenticatorImplTest, AlgorithmsOmitted) { … }
TEST_F(AuthenticatorImplTest, VirtualAuthenticatorPublicKeyAlgos) { … }
TEST_F(AuthenticatorImplTest, TestAuthenticationTransport) { … }
TEST_F(AuthenticatorImplTest, ResetDiscoveryFactoryOverride) { … }
TEST_F(AuthenticatorImplTest, InvalidU2FPublicKey) { … }
TEST_F(AuthenticatorImplTest, InvalidU2FSignature) { … }
TEST_F(AuthenticatorImplTest, CredBlob) { … }
TEST_F(AuthenticatorImplTest, MinPINLength) { … }
TEST_F(AuthenticatorImplTest, CancellingAuthenticatorDoesNotTerminateRequest) { … }
TEST_F(AuthenticatorImplTest, PRFWithoutSupport) { … }
static constexpr char kTestPIN[] = …;
static constexpr char16_t kTestPIN16[] = …;
class UVTestAuthenticatorClientDelegate
: public AuthenticatorRequestClientDelegate { … };
class UVTestAuthenticatorContentBrowserClient : public ContentBrowserClient { … };
class UVAuthenticatorImplTest : public AuthenticatorImplTest { … };
PINReason;
PINError;
struct PINExpectation { … };
class PINTestAuthenticatorRequestDelegate
: public AuthenticatorRequestClientDelegate { … };
class PINTestAuthenticatorContentBrowserClient : public ContentBrowserClient { … };
class PINAuthenticatorImplTest : public UVAuthenticatorImplTest { … };
static constexpr device::UserVerificationRequirement kUVLevel[3] = …;
static const char* kUVDescription[3] = …;
static const char* kPINSupportDescription[3] = …;
TEST_F(PINAuthenticatorImplTest, MakeCredential) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialSoftLock) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialHardLock) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialWrongPINFirst) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialSkipPINTouch) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialDontSkipPINTouch) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialAlwaysUv) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialMinPINLengthNewPIN) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialMinPINLengthExistingPIN) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialForcePINChange) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredUvNotRqd) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredUvNotRqdAndAlwaysUv) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialHMACSecret) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertion) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertionSoftLock) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertionHardLock) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertionSkipPINTouch) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertionDontSkipPINTouch) { … }
TEST_F(PINAuthenticatorImplTest, GetAssertionAlwaysUv) { … }
TEST_F(PINAuthenticatorImplTest, MakeCredentialNoSupportedAlgorithm) { … }
TEST_F(PINAuthenticatorImplTest, PRFCreatedOnCTAP2) { … }
TEST_F(PINAuthenticatorImplTest, ExcludeListBatchesIncludePinToken) { … }
TEST_F(PINAuthenticatorImplTest, RemoveSecondAuthenticator) { … }
TEST_F(PINAuthenticatorImplTest, AppIdExcludeExtensionWithPinRequiredError) { … }
class InternalUVAuthenticatorImplTest : public UVAuthenticatorImplTest { … };
TEST_F(InternalUVAuthenticatorImplTest, MakeCredential) { … }
TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialFallBackToPin) { … }
TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialInlineBioEnrollment) { … }
TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialSkipInlineBioEnrollment) { … }
TEST_F(InternalUVAuthenticatorImplTest, MakeCredUvNotRqd) { … }
TEST_F(InternalUVAuthenticatorImplTest, GetAssertion) { … }
TEST_F(InternalUVAuthenticatorImplTest, GetAssertionFallbackToPIN) { … }
class UVTokenAuthenticatorImplTest : public UVAuthenticatorImplTest { … };
TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUVToken) { … }
TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUvFails) { … }
TEST_F(UVTokenAuthenticatorImplTest, GetAssertionFallBackToPin) { … }
TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUvBlockedFallBackToPin) { … }
TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUVToken) { … }
TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUvFails) { … }
TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialFallBackToPin) { … }
TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUvBlockedFallBackToPin) { … }
class BlockingAuthenticatorRequestDelegate
: public AuthenticatorRequestClientDelegate { … };
class BlockingDelegateContentBrowserClient : public ContentBrowserClient { … };
class BlockingDelegateAuthenticatorImplTest : public AuthenticatorImplTest { … };
TEST_F(BlockingDelegateAuthenticatorImplTest, PostCancelMessage) { … }
class ResidentKeyTestAuthenticatorRequestDelegate
: public AuthenticatorRequestClientDelegate { … };
class ResidentKeyTestAuthenticatorContentBrowserClient
: public ContentBrowserClient { … };
class ResidentKeyAuthenticatorImplTest : public UVAuthenticatorImplTest { … };
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialRkRequired) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialRkPreferred) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialRkPreferredStorageFull) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialRkPreferredSetsPIN) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, StorageFull) { … }
TEST_F(ResidentKeyAuthenticatorImplTest,
MakeCredentialEmptyFields_SecurityKey) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialEmptyFields_Phone) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionSingleNoPII) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionUserSelected) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionSingleWithPII) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionMulti) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionUVDiscouraged) { … }
static const char* BlobSupportDescription(device::LargeBlobSupport support) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialLargeBlob) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionLargeBlobRead) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionLargeBlobWrite) { … }
TEST_F(ResidentKeyAuthenticatorImplTest,
GetAssertionLargeBlobExtensionNoSupport) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionLargeBlobExtension) { … }
static const char* ProtectionPolicyDescription(
blink::mojom::ProtectionPolicy p) { … }
static const char* CredProtectDescription(device::CredProtect cred_protect) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, CredProtectRegistration) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, AuthenticatorSetsCredProtect) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, AuthenticatorDefaultCredProtect) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, ProtectedNonResidentCreds) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, WithAppIDExtension) { … }
#if BUILDFLAG(IS_WIN)
TEST_F(ResidentKeyAuthenticatorImplTest, WinCredProtectApiVersion) {
virtual_device_factory_->set_discover_win_webauthn_api_authenticator(true);
fake_win_webauthn_api_.set_available(true);
NavigateAndCommit(GURL("https://acme.com"));
for (const bool supports_cred_protect : {false, true}) {
SCOPED_TRACE(testing::Message()
<< "supports_cred_protect: " << supports_cred_protect);
fake_win_webauthn_api_.set_version(supports_cred_protect
? WEBAUTHN_API_VERSION_2
: WEBAUTHN_API_VERSION_1);
PublicKeyCredentialCreationOptionsPtr options = make_credential_options();
options->relying_party = device::PublicKeyCredentialRpEntity();
options->relying_party.id = device::test_data::kRelyingPartyId;
options->relying_party.name = "";
options->authenticator_selection->user_verification_requirement =
device::UserVerificationRequirement::kRequired;
options->authenticator_selection->resident_key =
device::ResidentKeyRequirement::kRequired;
options->protection_policy =
blink::mojom::ProtectionPolicy::UV_OR_CRED_ID_REQUIRED;
options->enforce_protection_policy = true;
EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status,
supports_cred_protect ? AuthenticatorStatus::SUCCESS
: AuthenticatorStatus::NOT_ALLOWED_ERROR);
}
}
TEST_F(ResidentKeyAuthenticatorImplTest, ConditionalUI_Incognito) {
virtual_device_factory_->set_discover_win_webauthn_api_authenticator(true);
fake_win_webauthn_api_.set_available(true);
fake_win_webauthn_api_.set_version(WEBAUTHN_API_VERSION_4);
fake_win_webauthn_api_.set_supports_silent_discovery(true);
device::PublicKeyCredentialRpEntity rp(kTestRelyingPartyId);
device::PublicKeyCredentialUserEntity user({1, 2, 3, 4});
fake_win_webauthn_api_.InjectDiscoverableCredential(
{{4, 3, 2, 1}}, std::move(rp), std::move(user));
test_client_.delegate_config.expected_accounts = "<invalid>";
test_client_.delegate_config.expect_conditional = true;
for (bool is_off_the_record : {true, false}) {
SCOPED_TRACE(is_off_the_record ? "off the record" : "on the record");
static_cast<TestBrowserContext*>(GetBrowserContext())
->set_is_off_the_record(is_off_the_record);
PublicKeyCredentialRequestOptionsPtr options(get_credential_options());
options->is_conditional = true;
GetAssertionResult result = AuthenticatorGetAssertion(std::move(options));
EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status);
ASSERT_TRUE(fake_win_webauthn_api_.last_get_credentials_options());
EXPECT_EQ(fake_win_webauthn_api_.last_get_credentials_options()
->bBrowserInPrivateMode,
is_off_the_record);
}
}
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialLargeBlobWinPlatform) {
fake_win_webauthn_api_.set_available(true);
fake_win_webauthn_api_.set_version(WEBAUTHN_API_VERSION_3);
PublicKeyCredentialCreationOptionsPtr options =
GetTestPublicKeyCredentialCreationOptions();
options->large_blob_enable = device::LargeBlobSupport::kRequired;
options->authenticator_selection->resident_key =
device::ResidentKeyRequirement::kRequired;
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
MakeCredentialResult result = AuthenticatorMakeCredential(std::move(options));
EXPECT_EQ(result.status, AuthenticatorStatus::NOT_ALLOWED_ERROR);
EXPECT_FALSE(fake_win_webauthn_api_.last_make_credential_options());
}
#endif
TEST_F(ResidentKeyAuthenticatorImplTest, PRFNotSupportedWithPinUvAuthToken) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, PRFExtension) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, PRFEvaluationForMultipleCreds) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, PRFEvaluationDuringMakeCredential) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredentialPRFExtension) { … }
TEST_F(ResidentKeyAuthenticatorImplTest,
PRFExtensionOnUnconfiguredAuthenticator) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, ConditionalUI) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, PreselectDiscoverableCredential) { … }
TEST_F(ResidentKeyAuthenticatorImplTest, PreselectCredentialUserEntity) { … }
class InternalAuthenticatorImplTest : public AuthenticatorTestBase { … };
TEST_F(InternalAuthenticatorImplTest, MakeCredentialSkipTLSCheck) { … }
TEST_F(InternalAuthenticatorImplTest, GetAssertionSkipTLSCheck) { … }
TEST_F(InternalAuthenticatorImplTest, MakeCredentialOriginAndRpIds) { … }
TEST_F(InternalAuthenticatorImplTest, GetAssertionOriginAndRpIds) { … }
#if BUILDFLAG(IS_MAC)
class TouchIdAuthenticatorImplTest : public AuthenticatorImplTest {
protected:
using Credential = device::fido::mac::Credential;
using CredentialMetadata = device::fido::mac::CredentialMetadata;
void SetUp() override {
AuthenticatorImplTest::SetUp();
test_client_.web_authentication_delegate.touch_id_authenticator_config =
config_;
test_client_.web_authentication_delegate.supports_resident_keys = true;
old_client_ = SetBrowserClientForTesting(&test_client_);
}
void TearDown() override {
SetBrowserClientForTesting(old_client_);
AuthenticatorImplTest::TearDown();
}
void ResetVirtualDevice() override {}
std::vector<Credential> GetCredentials(const std::string& rp_id) {
return device::fido::mac::TouchIdCredentialStore::FindCredentialsForTesting(
config_, rp_id);
}
TestAuthenticatorContentBrowserClient test_client_;
raw_ptr<ContentBrowserClient> old_client_ = nullptr;
device::fido::mac::AuthenticatorConfig config_{
.keychain_access_group = "test-keychain-access-group",
.metadata_secret = "TestMetadataSecret"};
device::fido::mac::ScopedTouchIdTestEnvironment touch_id_test_environment_{
config_};
};
TEST_F(TouchIdAuthenticatorImplTest, IsUVPAA) {
NavigateAndCommit(GURL(kTestOrigin1));
for (const bool touch_id_available : {false, true}) {
SCOPED_TRACE(::testing::Message()
<< "touch_id_available=" << touch_id_available);
touch_id_test_environment_.SetTouchIdAvailable(touch_id_available);
EXPECT_EQ(AuthenticatorIsUvpaa(), touch_id_available);
}
}
TEST_F(TouchIdAuthenticatorImplTest, MakeCredential) {
NavigateAndCommit(GURL(kTestOrigin1));
mojo::Remote<blink::mojom::Authenticator> authenticator =
ConnectToAuthenticator();
auto options = GetTestPublicKeyCredentialCreationOptions();
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status,
AuthenticatorStatus::SUCCESS);
auto credentials = GetCredentials(kTestRelyingPartyId);
EXPECT_EQ(credentials.size(), 1u);
const CredentialMetadata& metadata = credentials.at(0).metadata;
EXPECT_TRUE(metadata.is_resident);
auto expected_user = GetTestPublicKeyCredentialUserEntity();
EXPECT_EQ(metadata.ToPublicKeyCredentialUserEntity(), expected_user);
}
TEST_F(TouchIdAuthenticatorImplTest, OptionalUv) {
NavigateAndCommit(GURL(kTestOrigin1));
mojo::Remote<blink::mojom::Authenticator> authenticator =
ConnectToAuthenticator();
touch_id_test_environment_.keychain()->SetUVMethod(
crypto::ScopedFakeAppleKeychainV2::UVMethod::kPasswordOnly);
for (const auto uv : {device::UserVerificationRequirement::kDiscouraged,
device::UserVerificationRequirement::kPreferred,
device::UserVerificationRequirement::kRequired}) {
SCOPED_TRACE(static_cast<int>(uv));
auto options = GetTestPublicKeyCredentialCreationOptions();
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
options->authenticator_selection->resident_key =
device::ResidentKeyRequirement::kRequired;
options->authenticator_selection->user_verification_requirement = uv;
bool requires_uv = uv == device::UserVerificationRequirement::kRequired;
if (requires_uv) {
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
} else {
touch_id_test_environment_.DoNotResolveNextPrompt();
}
auto result = AuthenticatorMakeCredential(std::move(options));
EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS);
EXPECT_EQ(HasUV(result.response), requires_uv);
auto credentials = GetCredentials(kTestRelyingPartyId);
EXPECT_EQ(credentials.size(), 1u);
auto assertion_options = GetTestPublicKeyCredentialRequestOptions();
assertion_options->user_verification = uv;
assertion_options->allow_credentials =
std::vector<device::PublicKeyCredentialDescriptor>(
{{device::CredentialType::kPublicKey,
credentials[0].credential_id}});
if (requires_uv) {
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
} else {
touch_id_test_environment_.DoNotResolveNextPrompt();
}
auto assertion = AuthenticatorGetAssertion(std::move(assertion_options));
EXPECT_EQ(assertion.status, AuthenticatorStatus::SUCCESS);
EXPECT_EQ(HasUV(assertion.response), requires_uv);
}
}
TEST_F(TouchIdAuthenticatorImplTest, MakeCredential_Resident) {
NavigateAndCommit(GURL(kTestOrigin1));
mojo::Remote<blink::mojom::Authenticator> authenticator =
ConnectToAuthenticator();
auto options = GetTestPublicKeyCredentialCreationOptions();
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
options->authenticator_selection->resident_key =
device::ResidentKeyRequirement::kRequired;
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status,
AuthenticatorStatus::SUCCESS);
auto credentials = GetCredentials(kTestRelyingPartyId);
EXPECT_EQ(credentials.size(), 1u);
EXPECT_TRUE(credentials.at(0).metadata.is_resident);
}
TEST_F(TouchIdAuthenticatorImplTest, MakeCredential_Eviction) {
NavigateAndCommit(GURL(kTestOrigin1));
mojo::Remote<blink::mojom::Authenticator> authenticator =
ConnectToAuthenticator();
auto options = GetTestPublicKeyCredentialCreationOptions();
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
options->authenticator_selection->resident_key =
device::ResidentKeyRequirement::kRequired;
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
EXPECT_EQ(AuthenticatorMakeCredential(options->Clone()).status,
AuthenticatorStatus::SUCCESS);
EXPECT_EQ(GetCredentials(kTestRelyingPartyId).size(), 1u);
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
EXPECT_EQ(AuthenticatorMakeCredential(options->Clone()).status,
AuthenticatorStatus::SUCCESS);
EXPECT_EQ(GetCredentials(kTestRelyingPartyId).size(), 1u);
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
options->user.id = std::vector<uint8_t>({99});
EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status,
AuthenticatorStatus::SUCCESS);
EXPECT_EQ(GetCredentials(kTestRelyingPartyId).size(), 2u);
touch_id_test_environment_.SimulateTouchIdPromptSuccess();
options = GetTestPublicKeyCredentialCreationOptions();
options->authenticator_selection->authenticator_attachment =
device::AuthenticatorAttachment::kPlatform;
options->relying_party.id = "a.google.com";
EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status,
AuthenticatorStatus::SUCCESS);
EXPECT_EQ(GetCredentials(kTestRelyingPartyId).size(), 2u);
}
class ICloudKeychainAuthenticatorImplTest : public AuthenticatorImplTest {
protected:
class InspectTAIAuthenticatorRequestDelegate
: public AuthenticatorRequestClientDelegate {
public:
using Callback = base::RepeatingCallback<void(
const device::FidoRequestHandlerBase::TransportAvailabilityInfo&)>;
explicit InspectTAIAuthenticatorRequestDelegate(Callback callback)
: callback_(std::move(callback)) {}
void ConfigureDiscoveries(
const url::Origin& origin,
const std::string& rp_id,
RequestSource request_source,
device::FidoRequestType request_type,
std::optional<device::ResidentKeyRequirement> resident_key_requirement,
device::UserVerificationRequirement user_verification_requirement,
std::optional<std::string_view> user_name,
base::span<const device::CableDiscoveryData> pairings_from_extension,
bool is_enclave_authenticator_available,
device::FidoDiscoveryFactory* fido_discovery_factory) override {
fido_discovery_factory->set_nswindow(
device::fido::icloud_keychain::kFakeNSWindowForTesting);
}
void OnTransportAvailabilityEnumerated(
device::FidoRequestHandlerBase::TransportAvailabilityInfo tai)
override {
callback_.Run(tai);
}
private:
Callback callback_;
};
class InspectTAIContentBrowserClient : public ContentBrowserClient {
public:
explicit InspectTAIContentBrowserClient(
InspectTAIAuthenticatorRequestDelegate::Callback callback)
: callback_(std::move(callback)) {}
std::unique_ptr<AuthenticatorRequestClientDelegate>
GetWebAuthenticationRequestDelegate(
RenderFrameHost* render_frame_host) override {
return std::make_unique<InspectTAIAuthenticatorRequestDelegate>(
callback_);
}
private:
InspectTAIAuthenticatorRequestDelegate::Callback callback_;
};
void SetUp() override {
AuthenticatorImplTest::SetUp();
old_client_ = SetBrowserClientForTesting(&test_client_);
virtual_device_factory_ = nullptr;
AuthenticatorEnvironment::GetInstance()->Reset();
}
void TearDown() override {
SetBrowserClientForTesting(old_client_);
AuthenticatorImplTest::TearDown();
}
void OnTransportAvailabilityEnumerated(
const device::FidoRequestHandlerBase::TransportAvailabilityInfo& tai) {
if (tai_callback_) {
std::move(tai_callback_).Run(tai);
}
}
static std::vector<device::DiscoverableCredentialMetadata> GetCredentials() {
device::DiscoverableCredentialMetadata metadata(
device::AuthenticatorType::kICloudKeychain, kTestRelyingPartyId,
{1, 2, 3, 4}, {{5, 6, 7, 8}, "name", "displayName"});
return {std::move(metadata)};
}
InspectTAIContentBrowserClient test_client_{base::BindRepeating(
&ICloudKeychainAuthenticatorImplTest::OnTransportAvailabilityEnumerated,
base::Unretained(this))};
raw_ptr<ContentBrowserClient> old_client_ = nullptr;
InspectTAIAuthenticatorRequestDelegate::Callback tai_callback_;
};
TEST_F(ICloudKeychainAuthenticatorImplTest, DISABLED_Discovery) {
if (__builtin_available(macOS 13.5, *)) {
NavigateAndCommit(GURL(kTestOrigin1));
device::fido::icloud_keychain::ScopedTestEnvironment test_environment(
GetCredentials());
bool tai_seen = false;
tai_callback_ = base::BindLambdaForTesting(
[&tai_seen](
const device::FidoRequestHandlerBase::TransportAvailabilityInfo&
tai) {
tai_seen = true;
CHECK_EQ(tai.has_icloud_keychain, true);
CHECK_EQ(tai.recognized_credentials.size(), 1u);
CHECK_EQ(tai.has_icloud_keychain_credential,
device::FidoRequestHandlerBase::RecognizedCredential::
kHasRecognizedCredential);
CHECK_EQ(tai.recognized_credentials[0].user.name.value(), "name");
});
auto options = GetTestPublicKeyCredentialRequestOptions();
options->allow_credentials.clear();
options->allow_credentials.push_back(device::PublicKeyCredentialDescriptor(
device::CredentialType::kPublicKey, {1, 2, 3, 4},
{device::FidoTransportProtocol::kInternal}));
const auto result = AuthenticatorGetAssertion(std::move(options));
EXPECT_EQ(result.status, AuthenticatorStatus::NOT_ALLOWED_ERROR);
EXPECT_TRUE(tai_seen);
} else {
GTEST_SKIP() << "Need macOS 13.3 for this test";
}
}
#endif
class AuthenticatorCableV2Test : public AuthenticatorImplRequestDelegateTest { … };
TEST_F(AuthenticatorCableV2Test, QRBasedWithNoPairing) { … }
TEST_F(AuthenticatorCableV2Test, HandshakeError) { … }
TEST_F(AuthenticatorCableV2Test, NetworkServiceCrash) { … }
TEST_F(AuthenticatorCableV2Test, PairingBased) { … }
TEST_F(AuthenticatorCableV2Test, PairingBasedWithConnectionSignal) { … }
static std::unique_ptr<device::cablev2::Pairing> DummyPairing() { … }
TEST_F(AuthenticatorCableV2Test, ContactIDDisabled) { … }
struct ServerLinkValues { … };
static ServerLinkValues CreateServerLink() { … }
TEST_F(AuthenticatorCableV2Test, ServerLink) { … }
TEST_F(AuthenticatorCableV2Test, LateLinking) { … }
class AuthenticatorCableV2AuthenticatorTest
: public AuthenticatorCableV2Test,
public device::cablev2::authenticator::Observer { … };
TEST_F(AuthenticatorCableV2AuthenticatorTest, GetAssertion) { … }
TEST_F(AuthenticatorCableV2AuthenticatorTest, MakeDiscoverableCredential) { … }
TEST_F(AuthenticatorCableV2AuthenticatorTest, EmptyAllowList) { … }
TEST_F(AuthenticatorCableV2AuthenticatorTest, PRFMakeCredential) { … }
static std::vector<uint8_t> HashPRFInput(base::span<const uint8_t> input) { … }
static std::tuple<PublicKeyCredentialRequestOptionsPtr,
std::vector<uint8_t>,
std::vector<uint8_t>>
BuildPRFGetAssertion(device::VirtualCtap2Device& virtual_device,
bool use_eval_by_credential) { … }
TEST_F(AuthenticatorCableV2AuthenticatorTest, PRFGetAssertion) { … }
TEST_F(AuthenticatorCableV2AuthenticatorTest, PRFGetAssertionByCredential) { … }
class AuthenticatorImplWithRequestProxyTest : public AuthenticatorImplTest { … };
TEST_F(AuthenticatorImplWithRequestProxyTest, Inactive) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, IsUVPAA) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, IsConditionalMediationAvailable) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest,
IsConditionalMediationAvailable_MetadataSyncing) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, MakeCredential) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, MakeCredentialOriginAndRpIds) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, MakeCredentialAlreadyProxied) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, AppId) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, MakeCredential_Timeout) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, GetAssertion) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, GetAssertionAlreadyProxied) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, GetAssertionConditionalUI) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, GetAssertionOriginAndRpIds) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest, GetAssertion_Timeout) { … }
TEST_F(AuthenticatorImplWithRequestProxyTest,
VirtualAuthenticatorTakesPrecedence) { … }
}