Page MenuHomeFreeBSD

Bluetooth LE Security Manager Protocol Support
ClosedPublic

Authored by takawata on Oct 22 2015, 5:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 5, 6:45 PM
Unknown Object (File)
Fri, Apr 5, 6:45 PM
Unknown Object (File)
Fri, Apr 5, 6:45 PM
Unknown Object (File)
Mon, Mar 25, 11:42 PM
Unknown Object (File)
Feb 5 2024, 9:37 AM
Unknown Object (File)
Jan 12 2024, 12:02 AM
Unknown Object (File)
Dec 30 2023, 3:33 PM
Unknown Object (File)
Dec 27 2023, 11:24 PM
Subscribers

Details

Summary

This code will add BLE Security Manager Protocol(SMP) support.
This will enable userland to create SMP connection and wait connection for underlying HCI connection to be encrypted.
To create SMP connection, set sockaddr_l2cap::l2cap_cid member as NG_L2CAP_SMP_CID.
To wait until HCI connection encrypted, do following:
enc = 1;
setsockopt( s, SOL_L2CAP, SO_L2CAP_ENCRYPTED, &enc, sizeof(enc));

Some example is in http://www.init-main.com/blesmpexample.tar.gz

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 898
Build 898: arc lint + arc unit

Event Timeline

takawata retitled this revision from to Bluetooth LE Security Manager Protocol Support.
takawata updated this object.
takawata edited the test plan for this revision. (Show Details)
takawata added a reviewer: emax.
takawata set the repository for this revision to rS FreeBSD src repository - subversion.
emax requested changes to this revision.Oct 22 2015, 5:43 PM
emax edited edge metadata.

please see comments. otherwise looks good on first read. thank you for your work!

sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c
1736

can you please remove this printf() or change it to one of the log macros?

2339

i think this is cut and paste typo. it should read sizeof(pcb->need_encrypt), imo

2387

do you think this should check socket state? basically, if connection is already established, i think, it should refuse to change encryption. otherwise it might give an impression that encryption can be turned on/off while connection is established.

This revision now requires changes to proceed.Oct 22 2015, 5:43 PM
takawata edited edge metadata.
takawata retitled this revision from Bluetooth LE Security Manager Protocol Support to Bluetooth LE Security Manager Protocol Support.

Reflecting the comment.

Thank you for your comment.
I corrected the problems.
Remove printf and check pcb state before updating need_encrypt and on encryption change.

takawata edited edge metadata.

Oops! unneeded code included.

emax edited edge metadata.

thank you for your work!

This revision is now accepted and ready to land.Oct 26 2015, 5:19 PM
This revision was automatically updated to reflect the committed changes.