[u2f] Introduce U2F Discovery

Desktop / Chromium - jdoerrie [chromium.org] - 13 October 2017 05:52 EDT

This change makes |U2fRequest| transport agnostic by introducing the concept of U2F discoveries and moving HID specific code into a |U2fHidDiscovery| class.

U2fDiscovery is designed as a general interface, which can be used to support other methods of transportation as well, such as BLE.

Bug: 763303 Change-Id: If6976a9e3c786f2df5713c5d00219dc6df63c665 Reviewed-on: https://chromium-review.googlesource.com/700637 Commit-Queue: Jan Wilken Dörrie

c625ef8 [u2f] Introduce U2F Discovery
device/BUILD.gn | 8 +-
device/u2f/BUILD.gn | 18 ++-
device/u2f/mock_u2f_device.h | 8 +-
device/u2f/mock_u2f_discovery.cc | 70 ++++++++++++
device/u2f/mock_u2f_discovery.h | 60 ++++++++++
device/u2f/u2f_device.h | 8 +-
device/u2f/u2f_discovery.cc | 19 ++++
device/u2f/u2f_discovery.h | 45 ++++++++
device/u2f/u2f_discovery_unittest.cc | 24 ++++
device/u2f/u2f_hid_device.cc | 14 ++-
device/u2f/u2f_hid_device.h | 9 +-
device/u2f/u2f_hid_discovery.cc | 71 ++++++++++++
device/u2f/u2f_hid_discovery.h | 55 ++++++++++
device/u2f/u2f_hid_discovery_unittest.cc | 120 ++++++++++++++++++++
device/u2f/u2f_register.cc | 18 +--
device/u2f/u2f_register.h | 15 ++-
device/u2f/u2f_register_unittest.cc | 63 ++++++-----
device/u2f/u2f_request.cc | 117 +++++++-------------
device/u2f/u2f_request.h | 58 +++++-----
device/u2f/u2f_request_unittest.cc | 183 ++++++++-----------------------
device/u2f/u2f_sign.cc | 17 +--
device/u2f/u2f_sign.h | 15 ++-
device/u2f/u2f_sign_unittest.cc | 86 +++++++++------
23 files changed, 740 insertions(+), 361 deletions(-)

Upstream: git.chromium.org


  • Share