• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Feb-2021-

aoa/H16-Feb-2021-762591

bio/H16-Feb-2021-1,5031,151

cable/H16-Feb-2021-11,0828,395

cros/H16-Feb-2021-613464

hid/H16-Feb-2021-3,2462,358

mac/H16-Feb-2021-3,6642,764

response_data_fuzzer_corpus/H03-May-2022-

strings/H16-Feb-2021-414411

win/H16-Feb-2021-2,1041,608

BUILD.gnH A D16-Feb-202111.3 KiB443412

DEPSH A D16-Feb-2021346 1716

DIR_METADATAH A D16-Feb-2021452 1211

OWNERSH A D16-Feb-2021669 2618

README.mdH A D16-Feb-20215.8 KiB3920

attestation_object.ccH A D16-Feb-20214 KiB11687

attestation_object.hH A D16-Feb-20212.9 KiB9246

attestation_statement.ccH A D16-Feb-20211.1 KiB4729

attestation_statement.hH A D16-Feb-20213 KiB8440

attestation_statement_formats.ccH A D16-Feb-20217.3 KiB221168

attestation_statement_formats.hH A D16-Feb-20212.4 KiB7248

attestation_statement_formats_unittest.ccH A D16-Feb-20216.1 KiB11499

attested_credential_data.ccH A D16-Feb-20218.4 KiB241173

attested_credential_data.hH A D16-Feb-20212.5 KiB8343

auth_token_requester.ccH A D16-Feb-202112 KiB327270

auth_token_requester.hH A D16-Feb-20216.7 KiB17588

auth_token_requester_unittest.ccH A D16-Feb-202113.5 KiB397351

authenticator_data.ccH A D16-Feb-20216.2 KiB174142

authenticator_data.hH A D16-Feb-20214.4 KiB13475

authenticator_get_assertion_response.ccH A D16-Feb-20214 KiB12897

authenticator_get_assertion_response.hH A D16-Feb-20215 KiB13086

authenticator_get_info_response.ccH A D16-Feb-20214.2 KiB131102

authenticator_get_info_response.hH A D16-Feb-20212.2 KiB5940

authenticator_make_credential_response.ccH A D16-Feb-20214.9 KiB136104

authenticator_make_credential_response.hH A D16-Feb-20215.1 KiB13067

authenticator_selection_criteria.ccH A D16-Feb-20211.6 KiB4126

authenticator_selection_criteria.hH A D16-Feb-20212.4 KiB6748

authenticator_supported_options.ccH A D16-Feb-20213.6 KiB11186

authenticator_supported_options.hH A D16-Feb-20215 KiB11655

ble_adapter_manager.ccH A D16-Feb-20211.6 KiB5437

ble_adapter_manager.hH A D16-Feb-20211.7 KiB5431

ble_adapter_manager_unittest.ccH A D16-Feb-20217.2 KiB201158

cbor_extract.ccH A D16-Feb-20216.4 KiB213167

cbor_extract.hH A D16-Feb-202111.9 KiB340206

cbor_extract_unittest.ccH A D16-Feb-20215.9 KiB192155

client_data.ccH A D16-Feb-20216.9 KiB219178

client_data.hH A D16-Feb-20212.4 KiB6940

credential_management.ccH A D16-Feb-202113.4 KiB370314

credential_management.hH A D16-Feb-20217.8 KiB226167

credential_management_handler.ccH A D16-Feb-202111.3 KiB324270

credential_management_handler.hH A D16-Feb-20215.3 KiB14599

credential_management_handler_unittest.ccH A D16-Feb-20217.4 KiB179140

ctap2_device_operation.hH A D16-Feb-20218.1 KiB215155

ctap_get_assertion_request.ccH A D16-Feb-202111.6 KiB334270

ctap_get_assertion_request.hH A D16-Feb-20215.6 KiB15198

ctap_make_credential_request.ccH A D16-Feb-202111.6 KiB346283

ctap_make_credential_request.hH A D16-Feb-20214.7 KiB11872

ctap_request_unittest.ccH A D16-Feb-20213.4 KiB7660

ctap_response_fuzzer.ccH A D16-Feb-20212.6 KiB7352

ctap_response_unittest.ccH A D16-Feb-202130.6 KiB873597

device_operation.hH A D16-Feb-20212.6 KiB8254

device_response_converter.ccH A D16-Feb-202124.3 KiB767608

device_response_converter.hH A D16-Feb-20212.4 KiB6231

ed25519_public_key.ccH A D16-Feb-20213.1 KiB9058

ed25519_public_key.hH A D16-Feb-2021755 2918

fake_fido_discovery.ccH A D16-Feb-20213.4 KiB10478

fake_fido_discovery.hH A D16-Feb-20214.5 KiB13054

fake_fido_discovery_unittest.ccH A D16-Feb-20215.3 KiB160119

features.ccH A D16-Feb-20212.6 KiB7858

features.hH A D16-Feb-20212.1 KiB6737

fido_authenticator.ccH A D16-Feb-20214.8 KiB177138

fido_authenticator.hH A D16-Feb-202112.8 KiB276175

fido_constants.ccH A D16-Feb-20213.1 KiB8263

fido_constants.hH A D16-Feb-202118.9 KiB480300

fido_device.ccH A D16-Feb-20212.7 KiB9167

fido_device.hH A D16-Feb-20215.7 KiB14269

fido_device_authenticator.ccH A D16-Feb-202141 KiB1,069895

fido_device_authenticator.hH A D16-Feb-202111.7 KiB269231

fido_device_authenticator_unittest.ccH A D16-Feb-20218.5 KiB219177

fido_device_discovery.ccH A D16-Feb-20214.2 KiB135103

fido_device_discovery.hH A D16-Feb-20212.7 KiB9559

fido_device_discovery_unittest.ccH A D16-Feb-20216.6 KiB181138

fido_discovery_base.ccH A D16-Feb-2021465 189

fido_discovery_base.hH A D16-Feb-20212.2 KiB7242

fido_discovery_factory.ccH A D16-Feb-20216.3 KiB193156

fido_discovery_factory.hH A D16-Feb-20214.7 KiB13085

fido_parsing_utils.ccH A D16-Feb-20213.9 KiB11791

fido_parsing_utils.hH A D16-Feb-20215.9 KiB157101

fido_parsing_utils_unittest.ccH A D16-Feb-202111.2 KiB287228

fido_request_handler_base.ccH A D16-Feb-202112.7 KiB349246

fido_request_handler_base.hH A D16-Feb-202111.9 KiB295148

fido_request_handler_unittest.ccH A D16-Feb-202125 KiB641481

fido_strings.grdH A D16-Feb-202111.9 KiB195184

fido_task.ccH A D16-Feb-2021723 2716

fido_task.hH A D16-Feb-20211.5 KiB5628

fido_test_data.hH A D16-Feb-202184.3 KiB1,8691,240

fido_transport_protocol.ccH A D16-Feb-20212 KiB5643

fido_transport_protocol.hH A D16-Feb-20211.5 KiB4929

fido_types.hH A D16-Feb-20212.5 KiB8543

get_assertion_handler_unittest.ccH A D16-Feb-202134.2 KiB824654

get_assertion_request_handler.ccH A D16-Feb-202134.6 KiB941767

get_assertion_request_handler.hH A D16-Feb-20216.3 KiB161122

get_assertion_task.ccH A D16-Feb-202116.1 KiB414312

get_assertion_task.hH A D16-Feb-20214 KiB11774

get_assertion_task_unittest.ccH A D16-Feb-202111.5 KiB284225

large_blob.ccH A D16-Feb-202110.8 KiB301253

large_blob.hH A D16-Feb-20216.6 KiB198135

large_blob_unittest.ccH A D16-Feb-20215.7 KiB145109

make_credential_handler_unittest.ccH A D16-Feb-202130.3 KiB749586

make_credential_request_handler.ccH A D16-Feb-202134.2 KiB899721

make_credential_request_handler.hH A D16-Feb-20218.1 KiB219148

make_credential_task.ccH A D16-Feb-202116 KiB402277

make_credential_task.hH A D16-Feb-20213.9 KiB10765

make_credential_task_unittest.ccH A D16-Feb-20217.7 KiB199160

mock_fido_device.ccH A D16-Feb-20216.8 KiB208168

mock_fido_device.hH A D16-Feb-20214.7 KiB11674

mock_fido_discovery_observer.ccH A D16-Feb-2021398 135

mock_fido_discovery_observer.hH A D16-Feb-20211.4 KiB4430

opaque_attestation_statement.ccH A D16-Feb-20212.1 KiB6949

opaque_attestation_statement.hH A D16-Feb-20211.2 KiB4024

p256_public_key.ccH A D16-Feb-20216.3 KiB175123

p256_public_key.hH A D16-Feb-20211 KiB3923

pin.ccH A D16-Feb-202119.7 KiB553426

pin.hH A D16-Feb-202110.7 KiB325205

pin_internal.ccH A D16-Feb-202112.5 KiB324259

pin_internal.hH A D16-Feb-20214.3 KiB13377

pin_unittest.ccH A D16-Feb-20214 KiB10883

platform_credential_store.hH A D16-Feb-20211.4 KiB3917

public_key.ccH A D16-Feb-2021737 2414

public_key.hH A D16-Feb-20211.3 KiB4522

public_key_credential_descriptor.ccH A D16-Feb-20213.1 KiB9164

public_key_credential_descriptor.hH A D16-Feb-20212.5 KiB7151

public_key_credential_params.ccH A D16-Feb-20213 KiB8258

public_key_credential_params.hH A D16-Feb-20211.9 KiB5838

public_key_credential_rp_entity.ccH A D16-Feb-20212.9 KiB9269

public_key_credential_rp_entity.hH A D16-Feb-20211.7 KiB5133

public_key_credential_user_entity.ccH A D16-Feb-20213.4 KiB10778

public_key_credential_user_entity.hH A D16-Feb-20212 KiB5536

reset_request_handler.ccH A D16-Feb-20212.3 KiB7253

reset_request_handler.hH A D16-Feb-20212.6 KiB7344

response_data.ccH A D16-Feb-20211.1 KiB3621

response_data.hH A D16-Feb-20211.2 KiB5230

rsa_public_key.ccH A D16-Feb-20212.8 KiB8862

rsa_public_key.hH A D16-Feb-2021775 3120

set_pin_request_handler.ccH A D16-Feb-20214.7 KiB148115

set_pin_request_handler.hH A D16-Feb-20214.2 KiB11061

test_callback_receiver.hH A D16-Feb-20214.1 KiB13581

test_callback_receiver_unittest.ccH A D16-Feb-20215.2 KiB172122

u2f_command_constructor.ccH A D16-Feb-20215.2 KiB138108

u2f_command_constructor.hH A D16-Feb-20213.5 KiB8344

u2f_command_constructor_unittest.ccH A D16-Feb-20216.5 KiB167127

u2f_register_operation.ccH A D16-Feb-20217.2 KiB211163

u2f_register_operation.hH A D16-Feb-20212.3 KiB7144

u2f_register_operation_unittest.ccH A D16-Feb-202111 KiB273200

u2f_sign_operation.ccH A D16-Feb-20217.1 KiB202155

u2f_sign_operation.hH A D16-Feb-20212.2 KiB6744

u2f_sign_operation_unittest.ccH A D16-Feb-202116.3 KiB401305

virtual_ctap2_device.ccH A D16-Feb-202199.6 KiB2,5582,138

virtual_ctap2_device.hH A D16-Feb-202111.2 KiB264131

virtual_ctap2_device_unittest.ccH A D16-Feb-20217.8 KiB203163

virtual_fido_device.ccH A D16-Feb-202123.8 KiB654509

virtual_fido_device.hH A D16-Feb-202114 KiB355160

virtual_fido_device_factory.ccH A D16-Feb-20213 KiB9877

virtual_fido_device_factory.hH A D16-Feb-20212 KiB5934

virtual_u2f_device.ccH A D16-Feb-20218.9 KiB257183

virtual_u2f_device.hH A D16-Feb-20211.6 KiB5736

virtual_u2f_device_unittest.ccH A D16-Feb-20211.8 KiB6342

README.md

1# Security Keys
2
3Security keys are physical devices that often connect via USB and have a button. They can generate public keys and sign with them to authenticate a user and are most often used as a second factor for security.
4
5Websites interact with them via two APIs: the older [U2F API](https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-javascript-api-v1.2-ps-20170411.html) and the modern [W3C Webauthn API](https://www.w3.org/TR/webauthn/). In Chromium, the U2F API is not directly supported but it can be used by using `postMessage` with an internal extension called [cryptotoken](/chrome/browser/resources/cryptotoken/). Webauthn is supported by Blink and is part of [CredMan](https://www.w3.org/TR/credential-management-1/).
6
7(Historically cryptotoken contained a complete stack that interacted with USB devices directly. Now, however, it's a wrapper layer over the Webauthn APIs.)
8
9Several different types of security keys are supported. Older security keys implement the [U2F protocol](https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html) while more modern ones implement [CTAP2](https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html). These devices can work over USB, Bluetooth Low Energy (BLE), or NFC (not supported). Additionally Chromium contains support for using Touch ID on macOS as a security key as well support for forwarding requests to the native libraries on modern versions of Windows.
10
11## Life of a request
12
13This section provides a coarse roadmap for understanding the code involved in security key support by highlighting the path that a login request might take.
14
15Firstly, the CredMan `get` call ends up in [`CredentialsContainer::get`](https://cs.chromium.org/search/?q=symbol:CredentialsContainer::get+exact:yes&det=matsel&sq=package:chromium&type=cs). CredMan supports several types of credentials but the code dealing with `publicKey` relates to security key support.
16
17The request is packaged into a Mojo call defined in [authenticator.mojom](/third_party/blink/public/mojom/webauthn/authenticator.mojom). On Android, that Mojo request is handled by Android-specific code and is forwarded to support libraries in Google Play Services. Otherwise the Mojo interface will be bound to [`AuthenticatorCommon`](/content/browser/webauth/authenticator_common.cc); specifically it'll call [`AuthenticatorCommon::GetAssertion`](https://cs.chromium.org/search/?q=symbol:AuthenticatorCommon::GetAssertion+exact:yes&sq=package:chromium).
18
19AuthenticatorCommon is part of Chromium's [content layer](https://www.chromium.org/developers/content-module) and so [calls into the embedder](https://cs.chromium.org/search/?q=symbol:GetWebAuthenticationRequestDelegate+exact:yes&sq=package:chromium) to get a [delegate object](https://cs.chromium.org/search/?q=symbol:AuthenticatorRequestClientDelegate+exact:yes) that allows it to perform actions like showing UI. It also triggers the lower-level code to start the process of finding an authenticator to handle the request. For an assertion request it'll create a [`GetAssertionRequestHandler`](https://cs.chromium.org/search/?q=symbol:GetAssertionRequestHandler+exact:yes) from this directory.
20
21The `Handler` classes manage a specific user action and their first job is to [initiate discovery](https://cs.chromium.org/search/?q=symbol:FidoRequestHandlerBase::InitDiscoveries+exact:yes) of possible security keys. The discovery process will find candidate USB, BLE, Touch ID, etc devices, each of which will be fed into [`DispatchRequest`](https://cs.chromium.org/search/?q=symbol:GetAssertionRequestHandler::DispatchRequest+exact:yes). Different actions may be taken depending on features of the discovered authenticator. For example, an authenticator which cannot handle the request may be asked to wait for a touch so that the user can still select it, even though it'll cause the request to fail. These per-authenticator operations will be dispatched via the abstract [`FidoAuthenticator`](https://cs.chromium.org/search/?q=symbol:FidoAuthenticator+exact:yes) interface.
22
23If a per-authenticator operation is complex and requires several steps it will be handled by a “task”. In this example, a [`GetAssertionTask`](https://cs.chromium.org/search/?q=symbol:device::GetAssertionTask+exact:yes) will likely be created by a [`FidoDeviceAuthenticator`](https://cs.chromium.org/search/?q=symbol:device::FidoDeviceAuthenticator+exact:yes), the implementation of `FidoAuthenticator` used by physical devices.
24
25The assertion task knows how to sequence a series of U2F or CTAP2 operations to implement an assertion request. In the case of U2F, there will be another layer of state machines in, e.g., [`U2fSignOperation`](https://cs.chromium.org/search/?q=symbol:device::U2FSignOperation+exact:yes) because U2F has a historical authenticator model.
26
27If interaction with UI is required, for example to prompt for a PIN, the handler will make calls via the [`Observer`](https://cs.chromium.org/search/?q=symbol:device::FidoRequestHandlerBase::Observer+exact:yes) interface, which is implemented by the embedder's UI objects that were created by `AuthenticatorCommon`.
28
29## Settings
30
31It's also possible for security key operations to be triggered by actions in the Settings UI: there are several security key actions that can be taken on `chrome://settings/securityKeys`. In this case, calls from the Javascript that implements the Settings UI end up in [`SecurityKeysHandler`](https://cs.chromium.org/search/?q=symbol:settings::SecurityKeysHandler+exact:yes), which then operates in the same way as `AuthenticatorCommon`, albeit without creating any native UI.
32
33## Fuzzers
34
35[libFuzzer] tests are in `*_fuzzer.cc` files. They test for bad input from
36devices, e.g. when parsing responses to register or sign operations.
37
38[libFuzzer]: /testing/libfuzzer/README.md
39