tree: c7199c345f0b22743144a18f86320991e64394d2 [path history] [tgz]
  1. bio/
  2. cable/
  3. cros/
  4. hid/
  5. mac/
  6. response_data_fuzzer_corpus/
  7. strings/
  8. win/
  9. attestation_object.cc
  10. attestation_object.h
  11. attestation_statement.cc
  12. attestation_statement.h
  13. attestation_statement_formats.cc
  14. attestation_statement_formats.h
  15. attestation_statement_formats_unittest.cc
  16. attested_credential_data.cc
  17. attested_credential_data.h
  18. authenticator_data.cc
  19. authenticator_data.h
  20. authenticator_get_assertion_response.cc
  21. authenticator_get_assertion_response.h
  22. authenticator_get_info_response.cc
  23. authenticator_get_info_response.h
  24. authenticator_make_credential_response.cc
  25. authenticator_make_credential_response.h
  26. authenticator_selection_criteria.cc
  27. authenticator_selection_criteria.h
  28. authenticator_supported_options.cc
  29. authenticator_supported_options.h
  30. ble_adapter_manager.cc
  31. ble_adapter_manager.h
  32. ble_adapter_manager_unittest.cc
  33. BUILD.gn
  34. cbor_extract.cc
  35. cbor_extract.h
  36. cbor_extract_unittest.cc
  37. client_data.cc
  38. client_data.h
  39. credential_management.cc
  40. credential_management.h
  41. credential_management_handler.cc
  42. credential_management_handler.h
  43. credential_management_handler_unittest.cc
  44. ctap2_device_operation.h
  45. ctap_empty_authenticator_request.cc
  46. ctap_empty_authenticator_request.h
  47. ctap_get_assertion_request.cc
  48. ctap_get_assertion_request.h
  49. ctap_make_credential_request.cc
  50. ctap_make_credential_request.h
  51. ctap_request_unittest.cc
  52. ctap_response_fuzzer.cc
  53. ctap_response_unittest.cc
  54. DEPS
  55. device_operation.h
  56. device_response_converter.cc
  57. device_response_converter.h
  58. ed25519_public_key.cc
  59. ed25519_public_key.h
  60. fake_fido_discovery.cc
  61. fake_fido_discovery.h
  62. fake_fido_discovery_unittest.cc
  63. features.cc
  64. features.h
  65. fido_authenticator.cc
  66. fido_authenticator.h
  67. fido_constants.cc
  68. fido_constants.h
  69. fido_device.cc
  70. fido_device.h
  71. fido_device_authenticator.cc
  72. fido_device_authenticator.h
  73. fido_device_discovery.cc
  74. fido_device_discovery.h
  75. fido_device_discovery_unittest.cc
  76. fido_discovery_base.cc
  77. fido_discovery_base.h
  78. fido_discovery_factory.cc
  79. fido_discovery_factory.h
  80. fido_parsing_utils.cc
  81. fido_parsing_utils.h
  82. fido_parsing_utils_unittest.cc
  83. fido_request_handler_base.cc
  84. fido_request_handler_base.h
  85. fido_request_handler_unittest.cc
  86. fido_strings.grd
  87. fido_task.cc
  88. fido_task.h
  89. fido_test_data.h
  90. fido_transport_protocol.cc
  91. fido_transport_protocol.h
  92. fido_types.h
  93. get_assertion_handler_unittest.cc
  94. get_assertion_request_handler.cc
  95. get_assertion_request_handler.h
  96. get_assertion_task.cc
  97. get_assertion_task.h
  98. get_assertion_task_unittest.cc
  99. make_credential_handler_unittest.cc
  100. make_credential_request_handler.cc
  101. make_credential_request_handler.h
  102. make_credential_task.cc
  103. make_credential_task.h
  104. make_credential_task_unittest.cc
  105. mock_fido_device.cc
  106. mock_fido_device.h
  107. mock_fido_discovery_observer.cc
  108. mock_fido_discovery_observer.h
  109. opaque_attestation_statement.cc
  110. opaque_attestation_statement.h
  111. OWNERS
  112. p256_public_key.cc
  113. p256_public_key.h
  114. pin.cc
  115. pin.h
  116. pin_internal.h
  117. platform_credential_store.h
  118. public_key.cc
  119. public_key.h
  120. public_key_credential_descriptor.cc
  121. public_key_credential_descriptor.h
  122. public_key_credential_params.cc
  123. public_key_credential_params.h
  124. public_key_credential_rp_entity.cc
  125. public_key_credential_rp_entity.h
  126. public_key_credential_user_entity.cc
  127. public_key_credential_user_entity.h
  128. README.md
  129. reset_request_handler.cc
  130. reset_request_handler.h
  131. response_data.cc
  132. response_data.h
  133. rsa_public_key.cc
  134. rsa_public_key.h
  135. set_pin_request_handler.cc
  136. set_pin_request_handler.h
  137. test_callback_receiver.h
  138. test_callback_receiver_unittest.cc
  139. u2f_command_constructor.cc
  140. u2f_command_constructor.h
  141. u2f_command_constructor_unittest.cc
  142. u2f_register_operation.cc
  143. u2f_register_operation.h
  144. u2f_register_operation_unittest.cc
  145. u2f_sign_operation.cc
  146. u2f_sign_operation.h
  147. u2f_sign_operation_unittest.cc
  148. virtual_ctap2_device.cc
  149. virtual_ctap2_device.h
  150. virtual_ctap2_device_unittest.cc
  151. virtual_fido_device.cc
  152. virtual_fido_device.h
  153. virtual_fido_device_factory.cc
  154. virtual_fido_device_factory.h
  155. virtual_u2f_device.cc
  156. virtual_u2f_device.h
  157. virtual_u2f_device_unittest.cc
device/fido/README.md

Security Keys

Security 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.

Websites interact with them via two APIs: the older U2F API and the modern W3C Webauthn API. In Chromium, the U2F API is not directly supported but it can be used by using postMessage with an internal extension called cryptotoken. Webauthn is supported by Blink and is part of CredMan.

(Historically cryptotoken contained a complete stack that interacted with USB devices directly. Now, however, it's a wrapper layer over the Webauthn APIs.)

Several different types of security keys are supported. Older security keys implement the U2F protocol while more modern ones implement CTAP2. 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.

Life of a request

This section provides a coarse roadmap for understanding the code involved in security key support by highlighting the path that a login request might take.

Firstly, the CredMan get call ends up in CredentialsContainer::get. CredMan supports several types of credentials but the code dealing with publicKey relates to security key support.

The request is packaged into a Mojo call defined in 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; specifically it'll call AuthenticatorCommon::GetAssertion.

AuthenticatorCommon is part of Chromium‘s content layer and so calls into the embedder to get a delegate object 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 from this directory.

The Handler classes manage a specific user action and their first job is to initiate discovery of possible security keys. The discovery process will find candidate USB, BLE, Touch ID, etc devices, each of which will be fed into DispatchRequest. 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 interface.

If a per-authenticator operation is complex and requires several steps it will be handled by a “task”. In this example, a GetAssertionTask will likely be created by a FidoDeviceAuthenticator, the implementation of FidoAuthenticator used by physical devices.

The 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 because U2F has a historical authenticator model.

If interaction with UI is required, for example to prompt for a PIN, the handler will make calls via the Observer interface, which is implemented by the embedder's UI objects that were created by AuthenticatorCommon.

Settings

It'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, which then operates in the same way as AuthenticatorCommon, albeit without creating any native UI.

Fuzzers

libFuzzer tests are in *_fuzzer.cc files. They test for bad input from devices, e.g. when parsing responses to register or sign operations.