Skip to contentSkip to conversation

BLE : SMP pairing + LE_Start_encryption

DISCUSSION Ajay 2 participants 4 messages Nov 28, 2012 – Nov 30, 2012 Bluetooth drivers

lore
Share & tools
lore

Ajay

author
#0 lore raw

Hi,
how do i do smp pairing and ltk key distribution using l2cap socket
connection? does bluez provide any tools for LE pairing . my ultimate result should be enabling LE_start_encryption , which requires ltk key distribution (which is a part of LE_pairing).

	spec 4.0  says we can use l2cap cid 0x06 , defined for this purpose 

(smp pairing) . But when i used cid =0x06 , l2cap connect creates an normal acl connection with cid = 40 , which doesnt trigger any smp modules at remote side.

please look into this issue.

Signature · 5 lines
Thanks & regards

 AJAY KV
 GlobalEdge software Ltd
 8892753703
author
#2 lore raw
In reply to Anderson Lizardo
Quoted 15 lines · Anderson Lizardo

Hi Ajay,

Quoted 6 lines · Ajay

Hi,
how do i do smp pairing and ltk key distribution using l2cap socket
connection? does bluez provide any tools for LE pairing . my ultimate result should be enabling LE_start_encryption , which requires ltk key distribution (which is a part of LE_pairing).

Either using mgmt API to do pairing (see mgmt_create_bonding() in src/mgmt.c from bluez sources and doc/mgmt-api.txt for how to do this) or increase socket security level to at least medium using setsockopt() (see set_sec_level() in btio/btio.c for how to do this).

Quoted 6 lines

In summary, you will need to use BlueZ code as reference if you want to do these things on your own. The easier route is to use BlueZ D-Bus API to do pairing.

Regards,

thanks Anderson ,
sorry if im confusing you .

	is it possible to create an l2cap connection with cid 0x06 and psm 0 ? 

, so that i can make use of dedicated smp-l2cap channel for data
transfer . I wanted to try how the remote device is handling on receiving an smp_pairing_request . i have seen in l2cap_core.c , it is getting handled inside a switch case (case cid == L2CAP_CID_SMP).

Signature · 5 lines
Thanks & regards

 AJAY KV
 GlobalEdge software Ltd
 8892753703
#1 lore raw
In reply to Ajay

Hi Ajay,

Quoted 6 lines · Ajay

Hi,
how do i do smp pairing and ltk key distribution using l2cap socket
connection? does bluez provide any tools for LE pairing . my ultimate result should be enabling LE_start_encryption , which requires ltk key distribution (which is a part of LE_pairing).

Either using mgmt API to do pairing (see mgmt_create_bonding() in src/mgmt.c from bluez sources and doc/mgmt-api.txt for how to do this) or increase socket security level to at least medium using setsockopt() (see set_sec_level() in btio/btio.c for how to do this).

In summary, you will need to use BlueZ code as reference if you want to do these things on your own. The easier route is to use BlueZ D-Bus API to do pairing.

Regards,

Signature · 3 lines
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
#3 lore raw
In reply to Ajay

Hi Ajay,

Quoted 5 lines · Ajay
        is it possible to create an l2cap connection with cid 0x06 and psm 0

? , so that i can make use of dedicated smp-l2cap channel for data transfer . I wanted to try how the remote device is handling on receiving an smp_pairing_request . i have seen in l2cap_core.c , it is getting handled inside a switch case (case cid == L2CAP_CID_SMP).

On Linux, all communication over the LE SMP CID is done on the kernel. So you need to use either increase socket seclevel using setsockopt() or using "Pair Device" from mgmt API to send the SMP Pairing Request from userspace.

I don't know how you can send "raw" SMP requests from userspace.

Regards,

Signature · 3 lines
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil