tree: cf314ceb03e5516419faebdbfbce0c823ed6572b [path history] [tgz]
  1. bio/
  2. ble/
  3. cable/
  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. credential_management.cc
  35. credential_management.h
  36. credential_management_handler.cc
  37. credential_management_handler.h
  38. credential_management_handler_unittest.cc
  39. ctap2_device_operation.h
  40. ctap_empty_authenticator_request.cc
  41. ctap_empty_authenticator_request.h
  42. ctap_get_assertion_request.cc
  43. ctap_get_assertion_request.h
  44. ctap_make_credential_request.cc
  45. ctap_make_credential_request.h
  46. ctap_request_unittest.cc
  47. ctap_response_fuzzer.cc
  48. ctap_response_unittest.cc
  49. DEPS
  50. device_operation.h
  51. device_response_converter.cc
  52. device_response_converter.h
  53. ec_public_key.cc
  54. ec_public_key.h
  55. fake_fido_discovery.cc
  56. fake_fido_discovery.h
  57. fake_fido_discovery_unittest.cc
  58. features.cc
  59. features.h
  60. fido_authenticator.cc
  61. fido_authenticator.h
  62. fido_constants.cc
  63. fido_constants.h
  64. fido_device.cc
  65. fido_device.h
  66. fido_device_authenticator.cc
  67. fido_device_authenticator.h
  68. fido_device_discovery.cc
  69. fido_device_discovery.h
  70. fido_device_discovery_unittest.cc
  71. fido_discovery_base.cc
  72. fido_discovery_base.h
  73. fido_discovery_factory.cc
  74. fido_discovery_factory.h
  75. fido_parsing_utils.cc
  76. fido_parsing_utils.h
  77. fido_parsing_utils_unittest.cc
  78. fido_request_handler_base.cc
  79. fido_request_handler_base.h
  80. fido_request_handler_unittest.cc
  81. fido_strings.grd
  82. fido_task.cc
  83. fido_task.h
  84. fido_test_data.h
  85. fido_transport_protocol.cc
  86. fido_transport_protocol.h
  87. fido_types.h
  88. get_assertion_handler_unittest.cc
  89. get_assertion_request_handler.cc
  90. get_assertion_request_handler.h
  91. get_assertion_task.cc
  92. get_assertion_task.h
  93. get_assertion_task_unittest.cc
  94. make_credential_handler_unittest.cc
  95. make_credential_request_handler.cc
  96. make_credential_request_handler.h
  97. make_credential_task.cc
  98. make_credential_task.h
  99. make_credential_task_unittest.cc
  100. mock_fido_device.cc
  101. mock_fido_device.h
  102. mock_fido_discovery_observer.cc
  103. mock_fido_discovery_observer.h
  104. opaque_attestation_statement.cc
  105. opaque_attestation_statement.h
  106. opaque_public_key.cc
  107. opaque_public_key.h
  108. OWNERS
  109. pin.cc
  110. pin.h
  111. pin_internal.h
  112. platform_credential_store.h
  113. public_key.cc
  114. public_key.h
  115. public_key_credential_descriptor.cc
  116. public_key_credential_descriptor.h
  117. public_key_credential_params.cc
  118. public_key_credential_params.h
  119. public_key_credential_rp_entity.cc
  120. public_key_credential_rp_entity.h
  121. public_key_credential_user_entity.cc
  122. public_key_credential_user_entity.h
  123. README.md
  124. reset_request_handler.cc
  125. reset_request_handler.h
  126. response_data.cc
  127. response_data.h
  128. set_pin_request_handler.cc
  129. set_pin_request_handler.h
  130. test_callback_receiver.h
  131. test_callback_receiver_unittest.cc
  132. u2f_command_constructor.cc
  133. u2f_command_constructor.h
  134. u2f_command_constructor_unittest.cc
  135. u2f_register_operation.cc
  136. u2f_register_operation.h
  137. u2f_register_operation_unittest.cc
  138. u2f_sign_operation.cc
  139. u2f_sign_operation.h
  140. u2f_sign_operation_unittest.cc
  141. virtual_ctap2_device.cc
  142. virtual_ctap2_device.h
  143. virtual_fido_device.cc
  144. virtual_fido_device.h
  145. virtual_fido_device_factory.cc
  146. virtual_fido_device_factory.h
  147. virtual_u2f_device.cc
  148. virtual_u2f_device.h
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.