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