0

Context:

I am working on a FIDO-U2F bluetooth authenticator with a nRF52 BLE SoC. and want it to test with google example.

So far I have implemented the FIDO Bluetooth specification and I have a device that advertises as a FIDO-compatible device.

Thanks to nRF Connect I have ensured that all the services and characteristics are correctly exposed and that I can interact with it only when my device is securely paired (with LTK): nRF Connect screenshot

Problem:

When the app scans for eligible FIDO device, it does not find mine.

I am stuck on the screen that ask to press a button for 5s, which I don't need to since my device responds to pairing request without user interaction and is already paired with my 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 tried to remove pairing data and all I have is:

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

The advertising flags are currently set to "BR/EDR not supported", but I also tried "LE Limited Discoverable Mode" and "LE General Discoverable Mode" without success.

I looked into android-fido sources but the BLE scan seems imported from elsewhere, I cannot debug it in this project.

Any pointer is welcome

n0p
  • 3,399
  • 2
  • 29
  • 50

1 Answers1

0

Have you got to this screen?

enter image description here

We may need to add Service Data field (0x16) into advertising packet. This is mentioned in FIDO specification here

Android code snippet for advertising with Service Data field added:

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();

If you want to capture bluetooth packets to see what is your advertising packet, you can use PacketLogger (for MacOS)

Here is the screenshot of the advertising packet enter image description here

The red box is Service Data

Bao HQ
  • 1,145
  • 7
  • 18
  • I don't have this particular screen but something similar. Thanks for your suggestion. I moved to an other project but I'll get you a feedback when I'm back on this issue ! – n0p Jun 13 '19 at 14:23