All of lore.kernel.org
 help / color / mirror / Atom feed
* Unexpected SMP Command 0x17
@ 2017-03-22  2:47 Wong, Joshua Weng Onn
  2017-03-22  7:36 ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Wong, Joshua Weng Onn @ 2017-03-22  2:47 UTC (permalink / raw)
  To: Bluez mailing list; +Cc: Wong, Mun choy, Zulqarnain, Adam, avinashk

SGkgYWxsLA0KDQpJIGFtIHNlZWluZyBhbiBlcnJvciBkdXJpbmcgdGhlIExFIHBhaXJpbmcgcHJv
Y2VzcyB3aGljaCBtYWtlcyB0aGUgcGFpcmluZyB0byBmYWlsLiBJIGhhdmUgdHdvIERVVHMgd2hp
Y2ggdXNlcyB0aGUgTWFydmVsbCA4OFc4ODk3Lg0KSGVyZSBhcmUgbXkgQlQgc2V0dGluZ3MgZm9y
IGJvdGggbWFzdGVyIGFuZCBzbGF2ZToNCg0KTWFzdGVyOg0KJCBidG1nbXQgaW5mbw0KY3VycmVu
dCBzZXR0aW5nczogcG93ZXJlZCBjb25uZWN0YWJsZSBkaXNjb3ZlcmFibGUgYm9uZGFibGUgc3Nw
IGJyL2VkciBsZSBzZWN1cmUtY29ubg0KDQpTbGF2ZToNCiQgYnRtZ210IGluZm8NCkN1cnJlbnQg
c2V0dGluZ3M6IHBvd2VyZWQgY29ubmVjdGFibGUgYm9uZGFibGUgbGUgYWR2ZXJ0aXNpbmcgc2Vj
dXJlLWNvbm4NCg0KV2hlbiBJIGluaXRpYXRlIHRoZSBwYWlyaW5nIHByb2Nlc3MgZnJvbSB0aGUg
bWFzdGVyLCBJIG9ic2VydmVkIHRoZSBtZXNzYWdlOg0KIkJsdWV0b290aDogaGNpMCB1bmV4cGVj
dGVkIFNNUCBjb21tYW5kIDB4MGEgZnJvbSA3NDpjNjozYjphYjo2ODplYSINCg0KV2hlcmUgNzQ6
YzY6M2I6YWI6Njg6ZWEgaXMgdGhlIGFkZHJlc3Mgb2YgdGhlIHNsYXZlIGRldmljZS4NCg0KSW4g
dGhlIGJ0bW9uIGxvZyBvZiB0aGUgbWFzdGVyIGRldmljZSwgaXQgaXMgb2JzZXJ2ZWQgdGhhdCBh
ZnRlciB0aGUgU2xhdmUgZGV2aWNlIGhhcyB0cmFuc21pdHRlZCB0aGUga2V5cywgdGhlIE1hc3Rl
ciBkb2VzIG5vdCB0cmFuc21pdCBpdC4gSGVuY2UsIHRoZSBTbGF2ZSBpcyBub3QgcmVjZWl2aW5n
IHRoZSBrZXlzIGFuZCB0aHVzIGRpc2Nvbm5lY3RzIHRoZSBsaW5rIGFuZCBwYWlyaW5nIGlzIGZh
aWxlZC4NCg0KPiBBQ0wgRGF0YSBSWDogSGFuZGxlIDEyOCBmbGFncyAweDAyIGRsZW4gMjEgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgW2hjaTBdIDEyNC44MDEwOTgNCiAgICAgIFNNUDog
RW5jcnlwdGlvbiBJbmZvcm1hdGlvbiAoMHgwNikgbGVuIDE2DQogICAgICAgIExvbmcgdGVybSBr
ZXk6IDlhYzY5MWU5NmU4NWU4MmNhNjhmNGI2ZDJhYmVjODBmDQo+IEhDSSBFdmVudDogRW5jcnlw
dGlvbiBDaGFuZ2UgKDB4MDgpIHBsZW4gNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBb
aGNpMF0gMTI0LjgwMTI2MQ0KICAgICAgICBTdGF0dXM6IFN1Y2Nlc3MgKDB4MDApDQogICAgICAg
IEhhbmRsZTogMTI4DQogICAgICAgIEVuY3J5cHRpb246IEVuYWJsZWQgd2l0aCBBRVMtQ0NNICgw
eDAxKQ0KPiBBQ0wgRGF0YSBSWDogSGFuZGxlIDEyOCBmbGFncyAweDAyIGRsZW4gMTUgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgW2hjaTBdIDEyNC44MTI3NjENCiAgICAgIFNNUDogTWFz
dGVyIElkZW50aWZpY2F0aW9uICgweDA3KSBsZW4gMTANCiAgICAgICAgRURJVjogMHhlYTNmDQog
ICAgICAgIFJhbmQ6IDB4ODA2ZTU0MmE3OGY1NWQ3Yw0KPiBBQ0wgRGF0YSBSWDogSGFuZGxlIDEy
OCBmbGFncyAweDAyIGRsZW4gMjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW2hjaTBd
IDEyNC44MTI3ODINCiAgICAgIFNNUDogU2lnbmluZyBJbmZvcm1hdGlvbiAoMHgwYSkgbGVuIDE2
DQogICAgICAgIFNpZ25hdHVyZSBrZXk6IDQ0NTFiOGFlMGVmZjkwZjBhNDdmYjk2YmU1MzQ3OWZi
DQo+IEhDSSBFdmVudDogRGlzY29ubmVjdCBDb21wbGV0ZSAoMHgwNSkgcGxlbiA0ICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBbaGNpMF0gMTU0LjgzOTU5MQ0KICAgICAgICBTdGF0dXM6IFN1
Y2Nlc3MgKDB4MDApDQogICAgICAgIEhhbmRsZTogMTI4DQogICAgICAgIFJlYXNvbjogUmVtb3Rl
IFVzZXIgVGVybWluYXRlZCBDb25uZWN0aW9uICgweDEzKQ0KDQo9PiBBdCB0aGlzIHBvaW50LCBN
YXN0ZXIgc2hvdWxkIHN0YXJ0IHNlbmRpbmcgTFRLIHRvIHNsYXZlLCBidXQgTWFzdGVyIGRvZXNu
J3Qgc2VuZCB0aGUgTFRLIHNvIFNsYXZlIGRpc2Nvbm5lY3RzIHRoZSBsaW5rIGFuZCBwYWlyaW5n
IGlzIGZhaWxlZC4NCg0KV2hhdCBjb3VsZCBwb3NzaWJseSBjYXVzZSB0aGUgbWFzdGVyIHRvIG5v
dCBzZW5kIHRoZSBMVEs/IE15IGtlcm5lbCB2ZXJzaW9uIGlzIHY0LjEuMjcgYW5kIGJsdWV6IHN0
YWNrIGlzIHY1LjQwLiBJIHdvdWxkIGFwcHJlY2lhdGUgYWR2aWNlIG9uIHRoaXMuDQoNClRoYW5r
IHlvdS4NCg0Kfkpvc2h1YQ0K

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unexpected SMP Command 0x17
  2017-03-22  2:47 Unexpected SMP Command 0x17 Wong, Joshua Weng Onn
@ 2017-03-22  7:36 ` Marcel Holtmann
  2017-03-27 14:50   ` [EXT] " Avinash Kadam
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2017-03-22  7:36 UTC (permalink / raw)
  To: Wong, Joshua Weng Onn
  Cc: Bluez mailing list, Wong, Mun choy, Zulqarnain, Adam, avinashk

Hi Joshua,

> I am seeing an error during the LE pairing process which makes the pairing to fail. I have two DUTs which uses the Marvell 88W8897.
> Here are my BT settings for both master and slave:
> 
> Master:
> $ btmgmt info
> current settings: powered connectable discoverable bondable ssp br/edr le secure-conn
> 
> Slave:
> $ btmgmt info
> Current settings: powered connectable bondable le advertising secure-conn
> 
> When I initiate the pairing process from the master, I observed the message:
> "Bluetooth: hci0 unexpected SMP command 0x0a from 74:c6:3b:ab:68:ea"
> 
> Where 74:c6:3b:ab:68:ea is the address of the slave device.
> 
> In the btmon log of the master device, it is observed that after the Slave device has transmitted the keys, the Master does not transmit it. Hence, the Slave is not receiving the keys and thus disconnects the link and pairing is failed.
> 
>> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 124.801098
>      SMP: Encryption Information (0x06) len 16
>        Long term key: 9ac691e96e85e82ca68f4b6d2abec80f
>> HCI Event: Encryption Change (0x08) plen 4                               [hci0] 124.801261
>        Status: Success (0x00)
>        Handle: 128
>        Encryption: Enabled with AES-CCM (0x01)
>> ACL Data RX: Handle 128 flags 0x02 dlen 15                               [hci0] 124.812761
>      SMP: Master Identification (0x07) len 10
>        EDIV: 0xea3f
>        Rand: 0x806e542a78f55d7c
>> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 124.812782
>      SMP: Signing Information (0x0a) len 16
>        Signature key: 4451b8ae0eff90f0a47fb96be53479fb
>> HCI Event: Disconnect Complete (0x05) plen 4                             [hci0] 154.839591
>        Status: Success (0x00)
>        Handle: 128
>        Reason: Remote User Terminated Connection (0x13)
> 
> => At this point, Master should start sending LTK to slave, but Master doesn't send the LTK so Slave disconnects the link and pairing is failed.
> 
> What could possibly cause the master to not send the LTK? My kernel version is v4.1.27 and bluez stack is v5.40. I would appreciate advice on this.

if this is LE Secure Connections, then the LTK is no longer distributed. It is being calculated from ECDH. Please include the complete SMP exchanges. Only then we can see what is going on.

Also keep in mind that 4.1.x kernels are actually rather old. The latest one is 4.10.x and if there is a bug, you should verify that it also happens with the latest kernel.

Regards

Marcel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXT] Re: Unexpected SMP Command 0x17
  2017-03-22  7:36 ` Marcel Holtmann
@ 2017-03-27 14:50   ` Avinash Kadam
  2017-03-27 14:55     ` Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Avinash Kadam @ 2017-03-27 14:50 UTC (permalink / raw)
  To: Marcel Holtmann, Wong, Joshua Weng Onn
  Cc: Bluez mailing list, Wong, Mun choy, Zulqarnain, Adam

[-- Attachment #1: Type: text/plain, Size: 3492 bytes --]

Thanks Marcel.
Yes, for secure connection the LTK is generated locally. 
But issue here is observed that after Pairing is complete the key distribution is not completed from Master. 

i.e. After Slave sends the  "Signature key:" but Master doesn't share any key.  Attached logs.

HI Joshua,

Please help to check with latest kernel and update. 

--
Thanks,
Avinash K 


-----Original Message-----
From: Marcel Holtmann [mailto:marcel@holtmann.org] 
Sent: 22 March 2017 13:06
To: Wong, Joshua Weng Onn <joshua.weng.onn.wong@intel.com>
Cc: Bluez mailing list <linux-bluetooth@vger.kernel.org>; Wong, Mun choy <mun.choy.wong@intel.com>; Zulqarnain, Adam <adam.zulqarnain@intel.com>; Avinash Kadam <avinashk@marvell.com>
Subject: [EXT] Re: Unexpected SMP Command 0x17

External Email

----------------------------------------------------------------------
Hi Joshua,

> I am seeing an error during the LE pairing process which makes the pairing to fail. I have two DUTs which uses the Marvell 88W8897.
> Here are my BT settings for both master and slave:
> 
> Master:
> $ btmgmt info
> current settings: powered connectable discoverable bondable ssp br/edr le secure-conn
> 
> Slave:
> $ btmgmt info
> Current settings: powered connectable bondable le advertising secure-conn
> 
> When I initiate the pairing process from the master, I observed the message:
> "Bluetooth: hci0 unexpected SMP command 0x0a from 74:c6:3b:ab:68:ea"
> 
> Where 74:c6:3b:ab:68:ea is the address of the slave device.
> 
> In the btmon log of the master device, it is observed that after the Slave device has transmitted the keys, the Master does not transmit it. Hence, the Slave is not receiving the keys and thus disconnects the link and pairing is failed.
> 
>> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 124.801098
>      SMP: Encryption Information (0x06) len 16
>        Long term key: 9ac691e96e85e82ca68f4b6d2abec80f
>> HCI Event: Encryption Change (0x08) plen 4                               [hci0] 124.801261
>        Status: Success (0x00)
>        Handle: 128
>        Encryption: Enabled with AES-CCM (0x01)
>> ACL Data RX: Handle 128 flags 0x02 dlen 15                               [hci0] 124.812761
>      SMP: Master Identification (0x07) len 10
>        EDIV: 0xea3f
>        Rand: 0x806e542a78f55d7c
>> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 124.812782
>      SMP: Signing Information (0x0a) len 16
>        Signature key: 4451b8ae0eff90f0a47fb96be53479fb
>> HCI Event: Disconnect Complete (0x05) plen 4                             [hci0] 154.839591
>        Status: Success (0x00)
>        Handle: 128
>        Reason: Remote User Terminated Connection (0x13)
> 
> => At this point, Master should start sending LTK to slave, but Master doesn't send the LTK so Slave disconnects the link and pairing is failed.
> 
> What could possibly cause the master to not send the LTK? My kernel version is v4.1.27 and bluez stack is v5.40. I would appreciate advice on this.

if this is LE Secure Connections, then the LTK is no longer distributed. It is being calculated from ECDH. Please include the complete SMP exchanges. Only then we can see what is going on.

Also keep in mind that 4.1.x kernels are actually rather old. The latest one is 4.10.x and if there is a bug, you should verify that it also happens with the latest kernel.

Regards

Marcel


[-- Attachment #2: secure-conn-on-master-log.txt --]
[-- Type: text/plain, Size: 13056 bytes --]

< HCI Command: LE Create Connection (0x08|0x000d) plen 25                  [hci0] 752.498799
        Scan interval: 60.000 msec (0x0060)
        Scan window: 30.000 msec (0x0030)
        Filter policy: White list is not used (0x00)
        Peer address type: Public (0x00)
        Peer address: 74:C6:3B:AB:68:EA (OUI 74-C6-3B)
        Own address type: Public (0x00)
        Min connection interval: 50.00 msec (0x0028)
        Max connection interval: 70.00 msec (0x0038)
        Connection latency: 0x0000
        Supervision timeout: 420 msec (0x002a)
        Min connection length: 0.000 msec (0x0000)
        Max connection length: 0.000 msec (0x0000)
> HCI Event: Command Status (0x0f) plen 4                                  [hci0] 752.505320
      LE Create Connection (0x08|0x000d) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19                                  [hci0] 753.061210
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 128
        Role: Master (0x00)
        Peer address type: Public (0x00)
        Peer address: 74:C6:3B:AB:68:EA (OUI 74-C6-3B)
        Connection interval: 67.50 msec (0x0036)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Master clock accuracy: 0x01
@ Device Connected: 74:C6:3B:AB:68:EA (1) flags 0x0000
< HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2           [hci0] 753.063118
        Handle: 128
> HCI Event: Command Status (0x0f) plen 4                                  [hci0] 753.068964
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                                  [hci0] 753.249205
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 128
        Features: 0x4f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
          Connection Parameter Request Procedure
          Extended Reject Indication
          Slave-initiated Features Exchange
          LL Privacy
< ACL Data TX: Handle 128 flags 0x00 dlen 11                               [hci0] 753.250193
      SMP: Pairing Request (0x01) len 6
        IO capability: KeyboardDisplay (0x04)
        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 LinkKey (0x0d)
        Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
< ACL Data TX: Handle 128 flags 0x00 dlen 7                                [hci0] 753.262956
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
> ACL Data RX: Handle 128 flags 0x02 dlen 7                                [hci0] 753.315441
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.315718
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 7                                [hci0] 753.316060
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 517
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.316008
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 11                               [hci0] 753.382935
      SMP: Pairing Response (0x02) 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 Sign (0x05)
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.383085
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                                [hci0] 753.383401
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 517
< ACL Data TX: Handle 128 flags 0x00 dlen 69                               [hci0] 753.385376
      SMP: Pairing Public Key (0x0c) len 64
        X: 17780eede45fb83689cabb6803f5f0de1da6cfe3d51a3cf5553eafb94910c5b5
        Y: 85e0b332945e7190afd622a1fdd5aa5d365722319a25fc8d7d860d02dc60b4af
< ACL Data TX: Handle 128 flags 0x00 dlen 11                               [hci0] 753.385625
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 128 flags 0x02 dlen 11                               [hci0] 753.451682
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.451999
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 18                               [hci0] 753.452165
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0005
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0006-0x0009
        UUID: Generic Attribute Profile (0x1801)
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.452420
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.518890
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 69                               [hci0] 753.518986
      SMP: Pairing Public Key (0x0c) len 64
        X: 1da0aaa663fe5fd9da217d0da76c3ee298ba52150bbf2785fddd38f464faef84
        Y: 8f378562b6e025f2e2dc4e1e05e501f599f4bb63efde8c46cc98a12cf8cc16f5
> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 753.519023
      SMP: Pairing Confirm (0x03) len 16
        Confim value: 906ada103cf5a740c67a316e15c5e133
> ACL Data RX: Handle 128 flags 0x02 dlen 18                               [hci0] 753.519487
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0005
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0006-0x0009
        UUID: Generic Attribute Profile (0x1801)
< ACL Data TX: Handle 128 flags 0x00 dlen 21                               [hci0] 753.523611
      SMP: Pairing Random (0x04) len 16
        Random value: 52bd97adce116ec51777d770ac159c35
< ACL Data TX: Handle 128 flags 0x00 dlen 11                               [hci0] 753.524480
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000a-0xffff
        Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 128 flags 0x02 dlen 11                               [hci0] 753.586528
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000a-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.586580
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.586824
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 9                                [hci0] 753.586903
      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x000a
        Error: Attribute Not Found (0x0a)
> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 753.652953
      SMP: Pairing Random (0x04) len 16
        Random value: e7af794cd9f6401a29aaedc8fac8db18
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.653123
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 9                                [hci0] 753.653417
      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x000a
        Error: Attribute Not Found (0x0a)
@ User Confirmation Request: 74:C6:3B:AB:68:EA (1) hint 0 value 706962
< ACL Data TX: Handle 128 flags 0x00 dlen 9                                [hci0] 753.685954
      ATT: Write Request (0x12) len 4
        Handle: 0x0009
          Data: 0200
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.720303
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 5                                [hci0] 753.856549
      ATT: Write Response (0x13) len 0
> ACL Data RX: Handle 128 flags 0x02 dlen 9                                [hci0] 753.856852
      ATT: Write Request (0x12) len 4
        Handle: 0x0009
          Data: 0200
< ACL Data TX: Handle 128 flags 0x00 dlen 5                                [hci0] 753.857115
      ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 128 flags 0x00 dlen 7                                [hci0] 753.857138
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.922945
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 753.923257
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                                [hci0] 753.991563
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
> ACL Data RX: Handle 128 flags 0x02 dlen 10                               [hci0] 753.991866
      ATT: Read Response (0x0b) len 5
        Value: 426c75655a
< ACL Data TX: Handle 128 flags 0x00 dlen 12                               [hci0] 753.992217
      ATT: Read Response (0x0b) len 7
        Value: 67697261666665
< ACL Data TX: Handle 128 flags 0x00 dlen 7                                [hci0] 753.992256
      ATT: Read Request (0x0a) len 2
        Handle: 0x0005
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 754.057946
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 754.058278
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                                [hci0] 754.126628
      ATT: Read Response (0x0b) len 2
        Value: 0000
> ACL Data RX: Handle 128 flags 0x02 dlen 7                                [hci0] 754.126945
      ATT: Read Request (0x0a) len 2
        Handle: 0x0005
< ACL Data TX: Handle 128 flags 0x00 dlen 7                                [hci0] 754.127655
      ATT: Read Response (0x0b) len 2
        Value: 1001
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 754.192985
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 21                               [hci0] 760.114731
      SMP: Pairing DHKey Check (0x0d) len 16
        E: f3373b60ba9063449ebef0f3dd7d9781
> HCI Event: Number of Completed Packets (0x13) plen 5                     [hci0] 760.132942
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 760.200373
      SMP: Pairing DHKey Check (0x0d) len 16
        E: 975be5ee4a205e1ac4811baa970abf10
< HCI Command: LE Start Encryption (0x08|0x0019) plen 28                   [hci0] 760.200595
        Handle: 128
        Random number: 0x0000000000000000
        Encrypted diversifier: 0x0000
        Long term key: 7ee01e3f27750b9393533941a4f3e198
> HCI Event: Command Status (0x0f) plen 4                                  [hci0] 760.206677
      LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Success (0x00)
> ACL Data RX: Handle 128 flags 0x02 dlen 21                               [hci0] 760.470529
      SMP: Signing Information (0x0a) len 16
        Signature key: 1866336f92238bf953611245b7ad51f7
> HCI Event: Encryption Change (0x08) plen 4                               [hci0] 760.470733
        Status: Success (0x00)
        Handle: 128
        Encryption: Enabled with AES-CCM (0x01)
> HCI Event: Disconnect Complete (0x05) plen 4                             [hci0] 790.576443
        Status: Success (0x00)
        Handle: 128
        Reason: Remote User Terminated Connection (0x13)
@ Device Disconnected: 74:C6:3B:AB:68:EA (1) reason 3

[-- Attachment #3: secure-conn-on-slave-log.txt --]
[-- Type: text/plain, Size: 13210 bytes --]

> HCI Event: LE Meta Event (0x3e) plen 19                     [hci0] 201.875863
      LE Connection Complete (0x01)
        Status: Success (0x00)
        Handle: 128
        Role: Slave (0x01)
        Peer address type: Public (0x00)
        Peer address: 74:C6:3B:AB:68:E0 (OUI 74-C6-3B)
        Connection interval: 67.50 msec (0x0036)
        Connection latency: 0.00 msec (0x0000)
        Supervision timeout: 420 msec (0x002a)
        Master clock accuracy: 0x01
@ Device Connected: 74:C6:3B:AB:68:E0 (1) flags 0x0000
< HCI Command: LE Read Remote Used Fe.. (0x08|0x0016) plen 2  [hci0] 201.877629
        Handle: 128
> HCI Event: Command Status (0x0f) plen 4                     [hci0] 201.884437
      LE Read Remote Used Features (0x08|0x0016) ncmd 1
        Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 12                     [hci0] 202.063367
      LE Read Remote Used Features (0x04)
        Status: Success (0x00)
        Handle: 128
        Features: 0x4f 0x00 0x00 0x00 0x00 0x00 0x00 0x00
          LE Encryption
          Connection Parameter Request Procedure
          Extended Reject Indication
          Slave-initiated Features Exchange
          LL Privacy
< ACL Data TX: Handle 128 flags 0x00 dlen 7                   [hci0] 202.076740
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
> ACL Data RX: Handle 128 flags 0x02 dlen 11                  [hci0] 202.130925
      SMP: Pairing Request (0x01) len 6
        IO capability: KeyboardDisplay (0x04)
        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 LinkKey (0x0d)
        Responder key distribution: EncKey IdKey Sign LinkKey (0x0f)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.131213
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                   [hci0] 202.131481
      ATT: Exchange MTU Request (0x02) len 2
        Client RX MTU: 517
< ACL Data TX: Handle 128 flags 0x00 dlen 11                  [hci0] 202.131616
      SMP: Pairing Response (0x02) 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 Sign (0x05)
< ACL Data TX: Handle 128 flags 0x00 dlen 7                   [hci0] 202.132157
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 517
> ACL Data RX: Handle 128 flags 0x02 dlen 7                   [hci0] 202.198437
      ATT: Exchange MTU Response (0x03) len 2
        Server RX MTU: 517
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.198721
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 11                  [hci0] 202.199227
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.264636
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.265101
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 69                  [hci0] 202.265382
      SMP: Pairing Public Key (0x0c) len 64
        X: 17780eede45fb83689cabb6803f5f0de1da6cfe3d51a3cf5553eafb94910c5b5
        Y: 85e0b332945e7190afd622a1fdd5aa5d365722319a25fc8d7d860d02dc60b4af
> ACL Data RX: Handle 128 flags 0x02 dlen 11                  [hci0] 202.265849
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
< ACL Data TX: Handle 128 flags 0x00 dlen 69                  [hci0] 202.281447
      SMP: Pairing Public Key (0x0c) len 64
        X: 1da0aaa663fe5fd9da217d0da76c3ee298ba52150bbf2785fddd38f464faef84
        Y: 8f378562b6e025f2e2dc4e1e05e501f599f4bb63efde8c46cc98a12cf8cc16f5
< ACL Data TX: Handle 128 flags 0x00 dlen 21                  [hci0] 202.281508
      SMP: Pairing Confirm (0x03) len 16
        Confim value: 906ada103cf5a740c67a316e15c5e133
< ACL Data TX: Handle 128 flags 0x00 dlen 18                  [hci0] 202.281958
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0005
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0006-0x0009
        UUID: Generic Attribute Profile (0x1801)
> ACL Data RX: Handle 128 flags 0x02 dlen 18                  [hci0] 202.334680
      ATT: Read By Group Type Response (0x11) len 13
        Attribute data length: 6
        Attribute group list: 2 entries
        Handle range: 0x0001-0x0005
        UUID: Generic Access Profile (0x1800)
        Handle range: 0x0006-0x0009
        UUID: Generic Attribute Profile (0x1801)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.334962
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.335273
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 11                  [hci0] 202.335631
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000a-0xffff
        Attribute group type: Primary Service (0x2800)
> ACL Data RX: Handle 128 flags 0x02 dlen 21                  [hci0] 202.399670
      SMP: Pairing Random (0x04) len 16
        Random value: 52bd97adce116ec51777d770ac159c35
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.399938
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 21                  [hci0] 202.399986
      SMP: Pairing Random (0x04) len 16
        Random value: e7af794cd9f6401a29aaedc8fac8db18
> ACL Data RX: Handle 128 flags 0x02 dlen 11                  [hci0] 202.400459
      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x000a-0xffff
        Attribute group type: Primary Service (0x2800)
@ User Confirmation Request: 74:C6:3B:AB:68:E0 (1) hint 0 value 706962
< ACL Data TX: Handle 128 flags 0x00 dlen 9                   [hci0] 202.400956
      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x000a
        Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.400898
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 9                   [hci0] 202.468436
      ATT: Error Response (0x01) len 4
        Read By Group Type Request (0x10)
        Handle: 0x000a
        Error: Attribute Not Found (0x0a)
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.468638
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 9                   [hci0] 202.535940
      ATT: Write Request (0x12) len 4
        Handle: 0x0009
          Data: 0200
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.536128
        Num handles: 1
        Handle: 128
        Count: 1
< ACL Data TX: Handle 128 flags 0x00 dlen 5                   [hci0] 202.597986
      ATT: Write Response (0x13) len 0
< ACL Data TX: Handle 128 flags 0x00 dlen 9                   [hci0] 202.598036
      ATT: Write Request (0x12) len 4
        Handle: 0x0009
          Data: 0200
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.670869
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 5                   [hci0] 202.737205
      ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.737378
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                   [hci0] 202.737672
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
< ACL Data TX: Handle 128 flags 0x00 dlen 7                   [hci0] 202.737767
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
< ACL Data TX: Handle 128 flags 0x00 dlen 10                  [hci0] 202.737914
      ATT: Read Response (0x0b) len 5
        Value: 426c75655a
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.805865
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 12                  [hci0] 202.872207
      ATT: Read Response (0x0b) len 7
        Value: 67697261666665
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.872429
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                   [hci0] 202.872742
      ATT: Read Request (0x0a) len 2
        Handle: 0x0005
< ACL Data TX: Handle 128 flags 0x00 dlen 7                   [hci0] 202.873489
      ATT: Read Response (0x0b) len 2
        Value: 0000
< ACL Data TX: Handle 128 flags 0x00 dlen 7                   [hci0] 202.873543
      ATT: Read Request (0x0a) len 2
        Handle: 0x0005
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 202.940673
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 7                   [hci0] 203.009022
      ATT: Read Response (0x0b) len 2
        Value: 1001
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 203.009069
        Num handles: 1
        Handle: 128
        Count: 1
> ACL Data RX: Handle 128 flags 0x02 dlen 21                  [hci0] 208.948405
      SMP: Pairing DHKey Check (0x0d) len 16
        E: f3373b60ba9063449ebef0f3dd7d9781
< ACL Data TX: Handle 128 flags 0x00 dlen 21                  [hci0] 208.948615
      SMP: Pairing DHKey Check (0x0d) len 16
        E: 975be5ee4a205e1ac4811baa970abf10
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 209.083476
        Num handles: 1
        Handle: 128
        Count: 1
> HCI Event: LE Meta Event (0x3e) plen 13                     [hci0] 209.083793
      LE Long Term Key Request (0x05)
        Handle: 128
        Random number: 0x0000000000000000
        Encrypted diversifier: 0x0000
< HCI Command: LE Long Term Key Requ.. (0x08|0x001a) plen 18  [hci0] 209.083869
        Handle: 128
        Long term key: 7ee01e3f27750b9393533941a4f3e198
> HCI Event: Command Complete (0x0e) plen 6                   [hci0] 209.087194
      LE Long Term Key Request Reply (0x08|0x001a) ncmd 1
        Status: Success (0x00)
        Handle: 128
> HCI Event: Encryption Change (0x08) plen 4                  [hci0] 209.218486
        Status: Success (0x00)
        Handle: 128
        Encryption: Enabled with AES-CCM (0x01)
< ACL Data TX: Handle 128 flags 0x00 dlen 21                  [hci0] 209.218733
      SMP: Signing Information (0x0a) len 16
        Signature key: 1866336f92238bf953611245b7ad51f7
> HCI Event: Number of Completed Packets (0x13) plen 5        [hci0] 209.352241
        Num handles: 1
        Handle: 128
        Count: 1
< HCI Command: Disconnect (0x01|0x0006) plen 3                [hci0] 239.261952
        Handle: 128
        Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4                     [hci0] 239.268876
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                [hci0] 239.392130
        Status: Success (0x00)
        Handle: 128
        Reason: Connection Terminated By Local Host (0x16)
@ Device Disconnected: 74:C6:3B:AB:68:E0 (1) reason 2
< HCI Command: LE Set Advertising Pa.. (0x08|0x0006) plen 15  [hci0] 239.404501
        Min advertising interval: 1280.000 msec (0x0800)
        Max advertising interval: 1280.000 msec (0x0800)
        Type: Connectable undirected - ADV_IND (0x00)
        Own address type: Public (0x00)
        Direct address type: Public (0x00)
        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
        Channel map: 37, 38, 39 (0x07)
        Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
> HCI Event: Command Complete (0x0e) plen 4                   [hci0] 239.411359
      LE Set Advertising Parameters (0x08|0x0006) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1   [hci0] 239.411615
        Advertising: Enabled (0x01)
> HCI Event: Command Complete (0x0e) plen 4                   [hci0] 239.416877
      LE Set Advertise Enable (0x08|0x000a) ncmd 1
        Status: Success (0x00)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: Unexpected SMP Command 0x17
  2017-03-27 14:50   ` [EXT] " Avinash Kadam
@ 2017-03-27 14:55     ` Marcel Holtmann
  2017-03-27 15:08       ` Szymon Janc
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Holtmann @ 2017-03-27 14:55 UTC (permalink / raw)
  To: Avinash Kadam
  Cc: Wong, Joshua Weng Onn, Bluez mailing list, Wong, Mun choy,
	Zulqarnain, Adam

Hi Avinash,

please also refrain from top posting.

> Yes, for secure connection the LTK is generated locally. 
> But issue here is observed that after Pairing is complete the key distribution is not completed from Master. 
> 
> i.e. After Slave sends the  "Signature key:" but Master doesn't share any key.  Attached logs.

I get that and that is clear from the logs. Something is stalling here and because of that, you run into the 30 seconds SMP timeout. We just need to know if the 4.9 kernel is doing this correctly. If so, then you can bi-sect that patch that fixes. Without proof that 4.9 is also broken, nobody will even bother to chase this down.

Regards

Marcel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Re: Unexpected SMP Command 0x17
  2017-03-27 14:55     ` Marcel Holtmann
@ 2017-03-27 15:08       ` Szymon Janc
  2017-03-30  0:00         ` Wong, Joshua Weng Onn
  0 siblings, 1 reply; 7+ messages in thread
From: Szymon Janc @ 2017-03-27 15:08 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Avinash Kadam, Wong, Joshua Weng Onn, Bluez mailing list, Wong,
	Mun choy, Zulqarnain, Adam

Hi,

On Monday, 27 March 2017 16:55:05 CEST Marcel Holtmann wrote:
> Hi Avinash,
> 
> please also refrain from top posting.
> 
> > Yes, for secure connection the LTK is generated locally.
> > But issue here is observed that after Pairing is complete the key
> > distribution is not completed from Master.
> > 
> > i.e. After Slave sends the  "Signature key:" but Master doesn't share any
> > key.  Attached logs.
> I get that and that is clear from the logs. Something is stalling here and
> because of that, you run into the 30 seconds SMP timeout. We just need to
> know if the 4.9 kernel is doing this correctly. If so, then you can bi-sect
> that patch that fixes. Without proof that 4.9 is also broken, nobody will
> even bother to chase this down.

I think the problem here is race between ACL data and HCI events on USB 
dongle...  We get initial slave keys but those get dropped due to encryption 
changed event not being received yet. Since keys were silently dropped we 
later on get unexpected SMP PDU and ignoring remaining keys as well which 
eventually leads to SMP timeout.

If this is USB dongle (using btusd) then only (AFAIK) solution would be to 
have a workaround for this inside chip (it would delay ACL data received right 
after encryption change giving host time to handle encpryption change event).
Bluetooth specification for USB transport is unfortunatelly kinda broken.

-- 
pozdrawiam
Szymon Janc

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXT] Re: Unexpected SMP Command 0x17
  2017-03-27 15:08       ` Szymon Janc
@ 2017-03-30  0:00         ` Wong, Joshua Weng Onn
  2017-03-30  6:13           ` [EXT] " Marcel Holtmann
  0 siblings, 1 reply; 7+ messages in thread
From: Wong, Joshua Weng Onn @ 2017-03-30  0:00 UTC (permalink / raw)
  To: Szymon Janc
  Cc: Avinash Kadam, Bluez mailing list, Wong, Mun choy, Zulqarnain,
	Adam, Marcel Holtmann

Hi Szymon,

> On Monday, 27 March 2017 16:55:05 CEST Marcel Holtmann wrote:
> > Hi Avinash,
> >
> > please also refrain from top posting.
> >
> > > Yes, for secure connection the LTK is generated locally.
> > > But issue here is observed that after Pairing is complete the key
> > > distribution is not completed from Master.
> > >
> > > i.e. After Slave sends the  "Signature key:" but Master doesn't
> > > share any key.  Attached logs.
> > I get that and that is clear from the logs. Something is stalling here
> > and because of that, you run into the 30 seconds SMP timeout. We just
> > need to know if the 4.9 kernel is doing this correctly. If so, then
> > you can bi-sect that patch that fixes. Without proof that 4.9 is also
> > broken, nobody will even bother to chase this down.
>=20
> I think the problem here is race between ACL data and HCI events on USB
> dongle...  We get initial slave keys but those get dropped due to encrypt=
ion
> changed event not being received yet. Since keys were silently dropped we=
 later
> on get unexpected SMP PDU and ignoring remaining keys as well which
> eventually leads to SMP timeout.
>=20
> If this is USB dongle (using btusd) then only (AFAIK) solution would be t=
o have a
> workaround for this inside chip (it would delay ACL data received right a=
fter
> encryption change giving host time to handle encpryption change event).
> Bluetooth specification for USB transport is unfortunatelly kinda broken.
>=20
> --
> pozdrawiam
> Szymon Janc

Thank you for your reply. Your inputs are valuable to us in helping to debu=
g the issue. Yes, we are indeed using the btusb kernel module and it is usi=
ng a USB interface (Bluetooth over USB).

I noticed that when btmgmt settings are set to turn 'bredr off', the 'ssp' =
mode also turns off. Is this behavior expected to occur?
My current settings are 'powered connectable discoverable bondable le secur=
e-conn'

Thank you.

Best regards,
Joshua



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXT] Unexpected SMP Command 0x17
  2017-03-30  0:00         ` Wong, Joshua Weng Onn
@ 2017-03-30  6:13           ` Marcel Holtmann
  0 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2017-03-30  6:13 UTC (permalink / raw)
  To: Wong, Joshua Weng Onn
  Cc: Szymon Janc, Avinash Kadam, Bluez mailing list, Wong, Mun choy,
	Zulqarnain, Adam

Hi Joshua,

>>>> Yes, for secure connection the LTK is generated locally.
>>>> But issue here is observed that after Pairing is complete the key
>>>> distribution is not completed from Master.
>>>> 
>>>> i.e. After Slave sends the  "Signature key:" but Master doesn't
>>>> share any key.  Attached logs.
>>> I get that and that is clear from the logs. Something is stalling here
>>> and because of that, you run into the 30 seconds SMP timeout. We just
>>> need to know if the 4.9 kernel is doing this correctly. If so, then
>>> you can bi-sect that patch that fixes. Without proof that 4.9 is also
>>> broken, nobody will even bother to chase this down.
>> 
>> I think the problem here is race between ACL data and HCI events on USB
>> dongle...  We get initial slave keys but those get dropped due to encryption
>> changed event not being received yet. Since keys were silently dropped we later
>> on get unexpected SMP PDU and ignoring remaining keys as well which
>> eventually leads to SMP timeout.
>> 
>> If this is USB dongle (using btusd) then only (AFAIK) solution would be to have a
>> workaround for this inside chip (it would delay ACL data received right after
>> encryption change giving host time to handle encpryption change event).
>> Bluetooth specification for USB transport is unfortunatelly kinda broken.
>> 
>> --
>> pozdrawiam
>> Szymon Janc
> 
> Thank you for your reply. Your inputs are valuable to us in helping to debug the issue. Yes, we are indeed using the btusb kernel module and it is using a USB interface (Bluetooth over USB).
> 
> I noticed that when btmgmt settings are set to turn 'bredr off', the 'ssp' mode also turns off. Is this behavior expected to occur?
> My current settings are 'powered connectable discoverable bondable le secure-conn’

the SSP (Secure Simple Pairing) is a BR/EDR only feature. So when you disable BR/EDR, it will be disabled as well.

Regards

Marcel


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-30  6:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22  2:47 Unexpected SMP Command 0x17 Wong, Joshua Weng Onn
2017-03-22  7:36 ` Marcel Holtmann
2017-03-27 14:50   ` [EXT] " Avinash Kadam
2017-03-27 14:55     ` Marcel Holtmann
2017-03-27 15:08       ` Szymon Janc
2017-03-30  0:00         ` Wong, Joshua Weng Onn
2017-03-30  6:13           ` [EXT] " Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.