Out of Band (OOB) pairing using btmgmt tool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Luiz /Community,

I'm trying to verify OOB pairing by manually sharing pairing
information using the btmgmt tool (Not using NFC)
between BLE central and peripheral devices.

This is similar to the question below, which is not answered.I tried
googling, but couldn't find the right info, so turned to the community
for help.
https://stackoverflow.com/questions/42344367/out-of-band-bluetooth-pairing-with-the-btmgmt-tool-on-linux

Here are the steps I followed.

1. secure connection is enabled in both devices.

Central:
# btmgmt info
Index list with 1 item
hci0: Primary controller
addr 00:1F:7B:4A:0E:CB version 12 manufacturer 72 class 0x000000
supported settings: powered connectable fast-connectable discoverable
bondable link-security ssp br/edr le advertising secure-conn
debug-keys privacy static-addr phy-configuration
current settings: powered connectable discoverable bondable le secure-conn
name Panda

Peripheral:
# btmgmt info
Index list with 1 item
hci0: Primary controller
addr 00:1F:7B:4A:0E:81 version 9 manufacturer 72 class 0x000000
supported settings: powered connectable fast-connectable discoverable
bondable link-security ssp br/edr le advertising secure-conn
debug-keys privacy static-addr phy-configuration
current settings: powered connectable discoverable bondable le
advertising secure-conn
name imx8mmpanda
short name


2. Unable to read local-oob
[mgmt]# local-oob
Too small (32 bytes) read_local_oob rsp

3. So random and hash values generated using "le-oob"

Central:
[mgmt]# le-oob
LE Device Address: 00:1F:7B:4A:0E:CB (public)
LE Role: 0x01
LE SC Confirmation Value: 1e8cb994e8d913adf0fc55196b3e3f0e
LE SC Random Value: f1813b0ddd3ca126ac847dc8cbe492a0
Flags: 0x02

Peripheral:
[mgmt]# le-oob
LE Device Address: 00:1F:7B:4A:0E:81 (public)
LE Role: 0x02
LE SC Confirmation Value: 759058bc5620bf728f3e18ce88728d67
LE SC Random Value: 1329bb1dbc7f13f846c12360f596ada0
Flags: 0x06

3. paring info updated using "remote-oob" but seeing 0 for R,H in btmon log

Central:
[mgmt]# remote-oob 00:1F:7B:4A:0E:81 -t 1 -r
f1813b0ddd3ca126ac847dc8cbe492a0 -h 1e8cb994e8d913adf0fc55196b3e3f0e
-R 1329bb1dbc7f13f846c12360f596ada0 -H
759058bc5620bf728f3e18ce88728d67

Peripheral:
[mgmt]# remote-oob 00:1F:7B:4A:0E:CB -t 1 -r
1329bb1dbc7f13f846c12360f596ada0 -h 759058bc5620bf728f3e18ce88728d67
-R f1813b0ddd3ca126ac847dc8cbe492a0 -H
1e8cb994e8d913adf0fc55196b3e3f0e

btmon log:
@ MGMT Command: Add Remote Out Of Band Data (0x0021) plen 71
                            {0x0002} [hci0] 30.534680
        BR/EDR Address: 00:1F:7B:4A:0E:CB (TechNexion Ltd.)
        Hash C from P-192: 00000000000000000000000000000000
        Randomizer R with P-192: 00000000000000000000000000000000
        Hash C from P-256: 00000000000000000000000000000000
        Randomizer R with P-256: 00000000000000000000000000000000
@ MGMT Event: Command Complete (0x0001) plen 10
                                       {0x0002} [hci0] 30.534706
      Add Remote Out Of Band Data (0x0021) plen 7
        Status: Success (0x00)
        BR/EDR Address: 00:1F:7B:4A:0E:CB (TechNexion Ltd.)

Also seeing BR/EDR address instead of LE address.

5. paring initiated w/ address type 1 (LE Public)
pair -t 1 00:1F:7B:4A:0E:81

6.  OOB data flag is not set in both pairing request and response
So fall back to IO capability and prompting to confirm the numerical comparison.

btmon log:
< ACL Data TX: Handle 128 flags 0x00 dlen 11
                                              #534 [hci0] 121.916889
      SMP: Pairing Request (0x01) len 6
        IO capability: DisplayYesNo (0x01)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign (0x05)
        Responder key distribution: EncKey IdKey Sign (0x07)
< ACL Data TX: Handle 128 flags 0x00 dlen 7
                                              #535 [hci0] 121.917990
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517

> HCI Event: Number of Completed Packets (0x13) plen 5                                                               #536 [hci0] 121.961103
        Num handles: 1
        Handle: 128 Address: 00:1F:7B:4A:0E:81 (TechNexion Ltd.)
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                                                               #537 [hci0] 121.961727
        Num handles: 1
        Handle: 128 Address: 00:1F:7B:4A:0E:81 (TechNexion Ltd.)
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 11                                                                         #538 [hci0] 122.005568
      SMP: Pairing Response (0x02) len 6
        IO capability: NoInputNoOutput (0x03)
        OOB data: Authentication data not present (0x00)
        Authentication requirement: Bonding, MITM, SC, No Keypresses (0x0d)
        Max encryption key size: 16
        Initiator key distribution: EncKey Sign (0x05)
        Responder key distribution: EncKey Sign (0x05)
> ACL Data RX: Handle 128 flags 0x02 dlen 7

7. Tried to set OOB data flag using below command but it doesn't help
set-flags 00:1F:7B:4A:0E:CB -f 0x0004

I don't know how to set the OOB data flag using the btmgmt tool.
I would appreciate any input regarding this.

Thank you
Raj




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux