Commit 7d7d488c authored by Adam Langley's avatar Adam Langley Committed by Commit Bot

device/fido: rename some caBLE constants.

As suggested in https://chromium-review.googlesource.com/c/chromium/src/+/1752937/3/chrome/browser/ui/views/webauthn/authenticator_qr_sheet_view.cc#222

Change-Id: I3401c7c77f6b3989383ecda1d8e68c173aa5ff92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1754709
Commit-Queue: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarKen Buchanan <kenrb@chromium.org>
Reviewed-by: default avatarMartin Kreichgauer <martinkr@google.com>
Auto-Submit: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687317}
parent 4f833444
...@@ -189,17 +189,17 @@ struct BLINK_COMMON_EXPORT ...@@ -189,17 +189,17 @@ struct BLINK_COMMON_EXPORT
return in.version; return in.version;
} }
static const device::EidArray& client_eid( static const device::CableEidArray& client_eid(
const device::CableDiscoveryData& in) { const device::CableDiscoveryData& in) {
return in.client_eid; return in.client_eid;
} }
static const device::EidArray& authenticator_eid( static const device::CableEidArray& authenticator_eid(
const device::CableDiscoveryData& in) { const device::CableDiscoveryData& in) {
return in.authenticator_eid; return in.authenticator_eid;
} }
static const device::SessionPreKeyArray& session_pre_key( static const device::CableSessionPreKeyArray& session_pre_key(
const device::CableDiscoveryData& in) { const device::CableDiscoveryData& in) {
return in.session_pre_key; return in.session_pre_key;
} }
......
...@@ -26,28 +26,28 @@ namespace mojo { ...@@ -26,28 +26,28 @@ namespace mojo {
using device::AuthenticatorAttachment; using device::AuthenticatorAttachment;
using device::AuthenticatorSelectionCriteria; using device::AuthenticatorSelectionCriteria;
using device::CableDiscoveryData; using device::CableDiscoveryData;
using device::CableEidArray;
using device::CableSessionPreKeyArray;
using device::CoseAlgorithmIdentifier; using device::CoseAlgorithmIdentifier;
using device::CredentialType; using device::CredentialType;
using device::EidArray;
using device::FidoTransportProtocol; using device::FidoTransportProtocol;
using device::PublicKeyCredentialDescriptor; using device::PublicKeyCredentialDescriptor;
using device::PublicKeyCredentialParams; using device::PublicKeyCredentialParams;
using device::PublicKeyCredentialRpEntity; using device::PublicKeyCredentialRpEntity;
using device::PublicKeyCredentialUserEntity; using device::PublicKeyCredentialUserEntity;
using device::SessionPreKeyArray;
using device::UserVerificationRequirement; using device::UserVerificationRequirement;
const std::vector<uint8_t> kDescriptorId = {'d', 'e', 's', 'c'}; const std::vector<uint8_t> kDescriptorId = {'d', 'e', 's', 'c'};
constexpr char kRpId[] = "google.com"; constexpr char kRpId[] = "google.com";
constexpr char kRpName[] = "Google"; constexpr char kRpName[] = "Google";
constexpr char kTestURL[] = "https://gstatic.com/fakeurl2.png"; constexpr char kTestURL[] = "https://gstatic.com/fakeurl2.png";
constexpr EidArray kClientEid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, constexpr CableEidArray kClientEid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15}}; 0x14, 0x15}};
constexpr EidArray kAuthenticatorEid = {{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, constexpr CableEidArray kAuthenticatorEid = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01}}; 0x01, 0x01, 0x01, 0x01}};
constexpr SessionPreKeyArray kSessionPreKey = { constexpr CableSessionPreKeyArray kSessionPreKey = {
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}; 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
namespace device { namespace device {
constexpr size_t kEphemeralIdSize = 16; constexpr size_t kCableEphemeralIdSize = 16;
constexpr size_t kSessionPreKeySize = 32; constexpr size_t kCableSessionPreKeySize = 32;
using EidArray = std::array<uint8_t, kEphemeralIdSize>; using CableEidArray = std::array<uint8_t, kCableEphemeralIdSize>;
using SessionPreKeyArray = std::array<uint8_t, kSessionPreKeySize>; using CableSessionPreKeyArray = std::array<uint8_t, kCableSessionPreKeySize>;
// Encapsulates information required to discover Cable device per single // Encapsulates information required to discover Cable device per single
// credential. When multiple credentials are enrolled to a single account // credential. When multiple credentials are enrolled to a single account
...@@ -27,9 +27,9 @@ using SessionPreKeyArray = std::array<uint8_t, kSessionPreKeySize>; ...@@ -27,9 +27,9 @@ using SessionPreKeyArray = std::array<uint8_t, kSessionPreKeySize>;
// See: https://crbug.com/837088 // See: https://crbug.com/837088
struct COMPONENT_EXPORT(DEVICE_FIDO) CableDiscoveryData { struct COMPONENT_EXPORT(DEVICE_FIDO) CableDiscoveryData {
CableDiscoveryData(uint8_t version, CableDiscoveryData(uint8_t version,
const EidArray& client_eid, const CableEidArray& client_eid,
const EidArray& authenticator_eid, const CableEidArray& authenticator_eid,
const SessionPreKeyArray& session_pre_key); const CableSessionPreKeyArray& session_pre_key);
CableDiscoveryData(); CableDiscoveryData();
CableDiscoveryData(const CableDiscoveryData& data); CableDiscoveryData(const CableDiscoveryData& data);
CableDiscoveryData& operator=(const CableDiscoveryData& other); CableDiscoveryData& operator=(const CableDiscoveryData& other);
...@@ -37,9 +37,9 @@ struct COMPONENT_EXPORT(DEVICE_FIDO) CableDiscoveryData { ...@@ -37,9 +37,9 @@ struct COMPONENT_EXPORT(DEVICE_FIDO) CableDiscoveryData {
~CableDiscoveryData(); ~CableDiscoveryData();
uint8_t version; uint8_t version;
EidArray client_eid; CableEidArray client_eid;
EidArray authenticator_eid; CableEidArray authenticator_eid;
SessionPreKeyArray session_pre_key; CableSessionPreKeyArray session_pre_key;
}; };
} // namespace device } // namespace device
......
...@@ -35,7 +35,7 @@ namespace { ...@@ -35,7 +35,7 @@ namespace {
// with the EID as its UUID. // with the EID as its UUID.
std::unique_ptr<BluetoothAdvertisement::Data> ConstructAdvertisementData( std::unique_ptr<BluetoothAdvertisement::Data> ConstructAdvertisementData(
uint8_t version_number, uint8_t version_number,
base::span<const uint8_t, kEphemeralIdSize> client_eid) { base::span<const uint8_t, kCableEphemeralIdSize> client_eid) {
auto advertisement_data = std::make_unique<BluetoothAdvertisement::Data>( auto advertisement_data = std::make_unique<BluetoothAdvertisement::Data>(
BluetoothAdvertisement::AdvertisementType::ADVERTISEMENT_TYPE_BROADCAST); BluetoothAdvertisement::AdvertisementType::ADVERTISEMENT_TYPE_BROADCAST);
...@@ -57,7 +57,7 @@ std::unique_ptr<BluetoothAdvertisement::Data> ConstructAdvertisementData( ...@@ -57,7 +57,7 @@ std::unique_ptr<BluetoothAdvertisement::Data> ConstructAdvertisementData(
static constexpr uint8_t kCableFlags = 0x20; static constexpr uint8_t kCableFlags = 0x20;
static constexpr uint8_t kCableGoogleManufacturerDataLength = static constexpr uint8_t kCableGoogleManufacturerDataLength =
3u + kEphemeralIdSize; 3u + kCableEphemeralIdSize;
std::array<uint8_t, 4> kCableGoogleManufacturerDataHeader = { std::array<uint8_t, 4> kCableGoogleManufacturerDataHeader = {
kCableGoogleManufacturerDataLength, kCableGoogleManufacturerDataType, kCableGoogleManufacturerDataLength, kCableGoogleManufacturerDataType,
kCableFlags, version_number}; kCableFlags, version_number};
...@@ -104,9 +104,9 @@ CableDiscoveryData::CableDiscoveryData() = default; ...@@ -104,9 +104,9 @@ CableDiscoveryData::CableDiscoveryData() = default;
CableDiscoveryData::CableDiscoveryData( CableDiscoveryData::CableDiscoveryData(
uint8_t version, uint8_t version,
const EidArray& client_eid, const CableEidArray& client_eid,
const EidArray& authenticator_eid, const CableEidArray& authenticator_eid,
const SessionPreKeyArray& session_pre_key) const CableSessionPreKeyArray& session_pre_key)
: version(version), : version(version),
client_eid(client_eid), client_eid(client_eid),
authenticator_eid(authenticator_eid), authenticator_eid(authenticator_eid),
...@@ -151,7 +151,7 @@ FidoCableDiscovery::~FidoCableDiscovery() { ...@@ -151,7 +151,7 @@ FidoCableDiscovery::~FidoCableDiscovery() {
std::unique_ptr<FidoCableHandshakeHandler> std::unique_ptr<FidoCableHandshakeHandler>
FidoCableDiscovery::CreateHandshakeHandler( FidoCableDiscovery::CreateHandshakeHandler(
FidoCableDevice* device, FidoCableDevice* device,
base::span<const uint8_t, kSessionPreKeySize> session_pre_key, base::span<const uint8_t, kCableSessionPreKeySize> session_pre_key,
base::span<const uint8_t, 8> nonce) { base::span<const uint8_t, 8> nonce) {
return std::make_unique<FidoCableHandshakeHandler>(device, nonce, return std::make_unique<FidoCableHandshakeHandler>(device, nonce,
session_pre_key); session_pre_key);
...@@ -260,7 +260,7 @@ void FidoCableDiscovery::StopAdvertisements(base::OnceClosure callback) { ...@@ -260,7 +260,7 @@ void FidoCableDiscovery::StopAdvertisements(base::OnceClosure callback) {
} }
void FidoCableDiscovery::OnAdvertisementRegistered( void FidoCableDiscovery::OnAdvertisementRegistered(
const EidArray& client_eid, const CableEidArray& client_eid,
scoped_refptr<BluetoothAdvertisement> advertisement) { scoped_refptr<BluetoothAdvertisement> advertisement) {
FIDO_LOG(DEBUG) << "Advertisement registered."; FIDO_LOG(DEBUG) << "Advertisement registered.";
advertisements_.emplace(client_eid, std::move(advertisement)); advertisements_.emplace(client_eid, std::move(advertisement));
...@@ -317,7 +317,7 @@ void FidoCableDiscovery::CableDeviceFound(BluetoothAdapter* adapter, ...@@ -317,7 +317,7 @@ void FidoCableDiscovery::CableDeviceFound(BluetoothAdapter* adapter,
void FidoCableDiscovery::ConductEncryptionHandshake( void FidoCableDiscovery::ConductEncryptionHandshake(
std::unique_ptr<FidoCableDevice> cable_device, std::unique_ptr<FidoCableDevice> cable_device,
base::span<const uint8_t, kSessionPreKeySize> session_pre_key, base::span<const uint8_t, kCableSessionPreKeySize> session_pre_key,
base::span<const uint8_t, 8> nonce) { base::span<const uint8_t, 8> nonce) {
auto handshake_handler = auto handshake_handler =
CreateHandshakeHandler(cable_device.get(), session_pre_key, nonce); CreateHandshakeHandler(cable_device.get(), session_pre_key, nonce);
...@@ -376,7 +376,7 @@ FidoCableDiscovery::GetCableDiscoveryDataFromServiceData( ...@@ -376,7 +376,7 @@ FidoCableDiscovery::GetCableDiscoveryDataFromServiceData(
if (service_data->empty() || !(service_data->at(0) >> 5 & 1u)) if (service_data->empty() || !(service_data->at(0) >> 5 & 1u))
return nullptr; return nullptr;
EidArray received_authenticator_eid; CableEidArray received_authenticator_eid;
bool extract_success = fido_parsing_utils::ExtractArray( bool extract_success = fido_parsing_utils::ExtractArray(
*service_data, 2, &received_authenticator_eid); *service_data, 2, &received_authenticator_eid);
if (!extract_success) if (!extract_success)
......
...@@ -37,7 +37,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery ...@@ -37,7 +37,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery
protected: protected:
virtual std::unique_ptr<FidoCableHandshakeHandler> CreateHandshakeHandler( virtual std::unique_ptr<FidoCableHandshakeHandler> CreateHandshakeHandler(
FidoCableDevice* device, FidoCableDevice* device,
base::span<const uint8_t, kSessionPreKeySize> session_pre_key, base::span<const uint8_t, kCableSessionPreKeySize> session_pre_key,
base::span<const uint8_t, 8> nonce); base::span<const uint8_t, 8> nonce);
private: private:
...@@ -62,7 +62,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery ...@@ -62,7 +62,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery
void StartCableDiscovery(); void StartCableDiscovery();
void StartAdvertisement(); void StartAdvertisement();
void OnAdvertisementRegistered( void OnAdvertisementRegistered(
const EidArray& client_eid, const CableEidArray& client_eid,
scoped_refptr<BluetoothAdvertisement> advertisement); scoped_refptr<BluetoothAdvertisement> advertisement);
void OnAdvertisementRegisterError( void OnAdvertisementRegisterError(
BluetoothAdvertisement::ErrorCode error_code); BluetoothAdvertisement::ErrorCode error_code);
...@@ -78,7 +78,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery ...@@ -78,7 +78,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery
void CableDeviceFound(BluetoothAdapter* adapter, BluetoothDevice* device); void CableDeviceFound(BluetoothAdapter* adapter, BluetoothDevice* device);
void ConductEncryptionHandshake( void ConductEncryptionHandshake(
std::unique_ptr<FidoCableDevice> device, std::unique_ptr<FidoCableDevice> device,
base::span<const uint8_t, kSessionPreKeySize> session_pre_key, base::span<const uint8_t, kCableSessionPreKeySize> session_pre_key,
base::span<const uint8_t, 8> nonce); base::span<const uint8_t, 8> nonce);
void ValidateAuthenticatorHandshakeMessage( void ValidateAuthenticatorHandshakeMessage(
std::unique_ptr<FidoCableDevice> cable_device, std::unique_ptr<FidoCableDevice> cable_device,
...@@ -96,7 +96,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery ...@@ -96,7 +96,7 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery
// active_authenticator_eids_ contains authenticator EIDs for which a // active_authenticator_eids_ contains authenticator EIDs for which a
// handshake is currently running. Further advertisements for the same EIDs // handshake is currently running. Further advertisements for the same EIDs
// will be ignored. // will be ignored.
std::set<EidArray> active_authenticator_eids_; std::set<CableEidArray> active_authenticator_eids_;
// active_devices_ contains the BLE addresses of devices for which a handshake // active_devices_ contains the BLE addresses of devices for which a handshake
// is already running. Further advertisements from these devices will be // is already running. Further advertisements from these devices will be
// ignored. However, devices may rotate their BLE address at will so this is // ignored. However, devices may rotate their BLE address at will so this is
...@@ -104,7 +104,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery ...@@ -104,7 +104,8 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoCableDiscovery
std::set<std::string> active_devices_; std::set<std::string> active_devices_;
size_t advertisement_success_counter_ = 0; size_t advertisement_success_counter_ = 0;
size_t advertisement_failure_counter_ = 0; size_t advertisement_failure_counter_ = 0;
std::map<EidArray, scoped_refptr<BluetoothAdvertisement>> advertisements_; std::map<CableEidArray, scoped_refptr<BluetoothAdvertisement>>
advertisements_;
std::vector<std::unique_ptr<FidoCableHandshakeHandler>> std::vector<std::unique_ptr<FidoCableHandshakeHandler>>
cable_handshake_handlers_; cable_handshake_handlers_;
base::WeakPtrFactory<FidoCableDiscovery> weak_factory_{this}; base::WeakPtrFactory<FidoCableDiscovery> weak_factory_{this};
......
...@@ -36,40 +36,40 @@ constexpr uint8_t kTestCableVersionNumber = 0x01; ...@@ -36,40 +36,40 @@ constexpr uint8_t kTestCableVersionNumber = 0x01;
// Constants required for discovering and constructing a Cable device that // Constants required for discovering and constructing a Cable device that
// are given by the relying party via an extension. // are given by the relying party via an extension.
constexpr EidArray kClientEid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, constexpr CableEidArray kClientEid = {{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15}}; 0x14, 0x15}};
constexpr char kUuidFormattedClientEid[] = constexpr char kUuidFormattedClientEid[] =
"00010203-0405-0607-0809-101112131415"; "00010203-0405-0607-0809-101112131415";
constexpr EidArray kAuthenticatorEid = {{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, constexpr CableEidArray kAuthenticatorEid = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01}}; 0x01, 0x01, 0x01, 0x01}};
constexpr EidArray kInvalidAuthenticatorEid = { constexpr CableEidArray kInvalidAuthenticatorEid = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00}}; 0x00, 0x00, 0x00, 0x00}};
constexpr SessionPreKeyArray kTestSessionPreKey = { constexpr CableSessionPreKeyArray kTestSessionPreKey = {
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}; 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
// TODO(https://crbug.com/837088): Add support for multiple EIDs on Windows. // TODO(https://crbug.com/837088): Add support for multiple EIDs on Windows.
#if !defined(OS_WIN) #if !defined(OS_WIN)
constexpr EidArray kSecondaryClientEid = {{0x15, 0x14, 0x13, 0x12, 0x11, 0x10, constexpr CableEidArray kSecondaryClientEid = {
0x09, 0x08, 0x07, 0x06, 0x05, 0x04, {0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,
0x03, 0x02, 0x01, 0x00}}; 0x03, 0x02, 0x01, 0x00}};
constexpr char kUuidFormattedSecondaryClientEid[] = constexpr char kUuidFormattedSecondaryClientEid[] =
"15141312-1110-0908-0706-050403020100"; "15141312-1110-0908-0706-050403020100";
constexpr EidArray kSecondaryAuthenticatorEid = { constexpr CableEidArray kSecondaryAuthenticatorEid = {
{0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, {0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee,
0xee, 0xee, 0xee, 0xee}}; 0xee, 0xee, 0xee, 0xee}};
constexpr SessionPreKeyArray kSecondarySessionPreKey = { constexpr CableSessionPreKeyArray kSecondarySessionPreKey = {
{0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, {0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd,
0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd}}; 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd}};
...@@ -165,7 +165,7 @@ class CableMockAdapter : public MockBluetoothAdapter { ...@@ -165,7 +165,7 @@ class CableMockAdapter : public MockBluetoothAdapter {
const AdvertisementErrorCallback&)); const AdvertisementErrorCallback&));
void AddNewTestBluetoothDevice( void AddNewTestBluetoothDevice(
base::span<const uint8_t, kEphemeralIdSize> authenticator_eid) { base::span<const uint8_t, kCableEphemeralIdSize> authenticator_eid) {
auto mock_device = CreateTestBluetoothDevice(); auto mock_device = CreateTestBluetoothDevice();
std::vector<uint8_t> service_data(18); std::vector<uint8_t> service_data(18);
...@@ -189,7 +189,7 @@ class CableMockAdapter : public MockBluetoothAdapter { ...@@ -189,7 +189,7 @@ class CableMockAdapter : public MockBluetoothAdapter {
} }
void AddNewTestAppleBluetoothDevice( void AddNewTestAppleBluetoothDevice(
base::span<const uint8_t, kEphemeralIdSize> authenticator_eid) { base::span<const uint8_t, kCableEphemeralIdSize> authenticator_eid) {
auto mock_device = CreateTestBluetoothDevice(); auto mock_device = CreateTestBluetoothDevice();
// Apple doesn't allow advertising service data, so we advertise a 16 bit // Apple doesn't allow advertising service data, so we advertise a 16 bit
// UUID plus the EID converted into 128 bit UUID. // UUID plus the EID converted into 128 bit UUID.
...@@ -247,7 +247,7 @@ class CableMockAdapter : public MockBluetoothAdapter { ...@@ -247,7 +247,7 @@ class CableMockAdapter : public MockBluetoothAdapter {
} }
void ExpectDiscoveryWithScanCallback( void ExpectDiscoveryWithScanCallback(
base::span<const uint8_t, kEphemeralIdSize> eid, base::span<const uint8_t, kCableEphemeralIdSize> eid,
bool is_apple_device = false) { bool is_apple_device = false) {
EXPECT_CALL(*this, StartScanWithFilter_(_, _)) EXPECT_CALL(*this, StartScanWithFilter_(_, _))
.WillOnce( .WillOnce(
...@@ -297,7 +297,7 @@ class FakeFidoCableDiscovery : public FidoCableDiscovery { ...@@ -297,7 +297,7 @@ class FakeFidoCableDiscovery : public FidoCableDiscovery {
private: private:
std::unique_ptr<FidoCableHandshakeHandler> CreateHandshakeHandler( std::unique_ptr<FidoCableHandshakeHandler> CreateHandshakeHandler(
FidoCableDevice* device, FidoCableDevice* device,
base::span<const uint8_t, kSessionPreKeySize> session_pre_key, base::span<const uint8_t, kCableSessionPreKeySize> session_pre_key,
base::span<const uint8_t, 8> nonce) override { base::span<const uint8_t, 8> nonce) override {
return std::make_unique<FakeHandshakeHandler>(device, nonce, return std::make_unique<FakeHandshakeHandler>(device, nonce,
session_pre_key); session_pre_key);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment