diff options
author | Sven Gothel <[email protected]> | 2021-10-29 05:49:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-29 05:49:43 +0200 |
commit | 88456111f8020081eeea719143f42584a62f8ac6 (patch) | |
tree | fb77f5cf0a287cb0b982ba7570231868579685a7 /scripts | |
parent | 4f0f232301a2a2ffc1e396e29ccf8ab423edece6 (diff) |
Add BTAdapter's Slave Peripheral SMP Key Management
To have full SMP key persitency in peripheral slave mode,
BTAdapter requires fine grained control over
- Passing stored keys to BTDevice's PairingData (w/o uploading them)
- Uploading BTDevice's PairingData to the adapter
This required interaction in certain places,
only enabled if adapter is BTRole::Slave (peripheral):
- BTAdapter::mgmtEvDeviceConnectedHCI()
Only issue unpairDevice() if not pre-paired.
Unpairing is required for new pairing to avoid DHKey Check failures!
- BTAdapter::mgmtEvDeviceDisconnectedHCI()
- First unpairDevice() will be issued via notifyDisconnect()
- Set and upload stored keys for disconnected device (if existing),
preparing for next connect.
- BTAdapter::sendDevicePairingState()
- SMPPairingState::COMPLETED && not SMPPairingState::PRE_PAIRED: Store keys
- SMPPairingState::COMPLETED && SMPPairingState::PRE_PAIRED: Refresh keys to BTDevice (set), no upload!
- SMPPairingState::FAILED: Remove and delete keys
+++
BTAdapter::setSMPKeyPath(path) allows user to enable the persistent key storage
by setting its local filesystem path.
It will also read all key files (SMPKeyBin) and if valid and matching with the adapter,
uploads them for pre-pairing.
See dbt_peripheral00.cpp:
adapter->setSMPKeyPath(ADAPTER_KEY_PATH);
+++
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/run-native-example.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/run-native-example.sh b/scripts/run-native-example.sh index 192c74b3..e7f93e62 100755 --- a/scripts/run-native-example.sh +++ b/scripts/run-native-example.sh @@ -172,6 +172,7 @@ runit() { echo LD_LIBRARY_PATH=`pwd`/lib $EXE_WRAPPER bin/${exename} "$@" mkdir -p keys + mkdir -p dbt_keys if [ "${run_setcap}" -eq "1" ]; then runit_setcap "$@" |