0

语境:

我正在开发带有 nRF52 BLE SoC 的 FIDO-U2F 蓝牙身份验证器。并希望它用谷歌示例进行测试。

到目前为止,我已经实现了FIDO 蓝牙规范,并且我有一个宣传为 FIDO 兼容设备的设备。

感谢nRF Connect,我确保所有服务和特征都正确公开,并且只有在我的设备安全配对(与 LTK)时我才能与之交互: nRF 连接截图

问题:

当应用程序扫描符合条件的 FIDO 设备时,它没有找到我的设备。

我卡在要求按下按钮 5 秒的屏幕上,我不需要这样做,因为我的设备在没有用户交互的情况下响应配对请求并且已经与我的 SAMSUNG A8 配对。

I/BluetoothDevicePreference: onDeviceAttributesChanged :: Device = (N) D8BE86, isBonded = 12 , mIsOnProgressAddVI = false
I/Fido: [BleScanner] startScan()
E/Fido: [BluetoothPairingStateProvider] getUuids() returns null for device: D8:BE:86:4A:E5:65
I/Fido: [PreferredTransportProvider] BLE enabled but no device is paired
I/Fido: [AuthenticateBaseChimeraActivity] User selected transport ble
I/Fido: [ViewController] Accepting proposed view {"viewName":"ble_instructions","anyU2fDevicesPaired":false}: outranks current (2 > 0)
I/Fido: [ViewPresenter] viewSelected(...) ble_instructions
I/Fido: [U2fRequestController] onResultReceived(null, ErrorResponseData{errorCode=5})
I/Fido: [BleScanner] stopScan()

我试图删除配对数据,我所拥有的是:

I/BluetoothDevicePreference: onDeviceAttributesChanged :: Device = (N) D8BE86, isBonded = 10 , mIsOnProgressAddVI = false

广告标志目前设置为“不支持 BR/EDR ”,但我也尝试了“ LE Limited Discoverable Mode ”和“ LE General Discoverable Mode ”,但均未成功。

我查看了android-fido源,但 BLE 扫描似乎是从其他地方导入的,我无法在这个项目中调试它。

欢迎任何指针

4

1 回答 1

0

你到这个屏幕了吗?

在此处输入图像描述

我们可能需要将服务数据字段(0x16)添加到广告包中。这在此处的 FIDO 规范中有所提及

添加了服务数据字段的 Android 广告代码片段:

AdvertiseData data = new AdvertiseData.Builder()
                        .addServiceUuid(new ParcelUuid(fido2GattService.getUuid()))
                        .setIncludeDeviceName(true)
                        .addServiceData(new ParcelUuid(fido2GattService.getUuid()), new byte[] {(byte)192, (byte)192, (byte)192})
                        .build();

如果您想捕获蓝牙数据包以查看您的广告数据包,您可以使用 PacketLogger(适用于 MacOS)

这是广告包的截图 在此处输入图像描述

红框是服务数据

于 2019-05-27T12:38:42.177 回答