summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-12-10 12:56:45 +0100
committerSven Gothel <[email protected]>2020-12-10 12:56:45 +0100
commit5a6c1d17e6d38d60728b0d7bb4a195d2f443ecfd (patch)
treee80c3770d449536316177c8118e853d3c7f95b95 /api
parentb5c800ecfc9d0115646f5e72d93fb458f2c8ee5b (diff)
Process MgmtEvent::Opcode::NEW_LONG_TERM_KEY: Allowing updatePairingState() if SMPKeyDist::ENC_KEY not done yet
MgmtEvent::Opcode::NEW_LONG_TERM_KEY shall become handy when using Secure Connections (SC), as the generated / derived LTKs will not be transported via SMP. Also: - DBTDevice::clearSMPStates(): Clear keys - Extract checkPairingKeyDistributionComplete(..) for hciSMPMsgCallback() and updatePairingState()
Diffstat (limited to 'api')
-rw-r--r--api/direct_bt/DBTAdapter.hpp1
-rw-r--r--api/direct_bt/DBTDevice.hpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/api/direct_bt/DBTAdapter.hpp b/api/direct_bt/DBTAdapter.hpp
index d3650c46..3508a98d 100644
--- a/api/direct_bt/DBTAdapter.hpp
+++ b/api/direct_bt/DBTAdapter.hpp
@@ -283,6 +283,7 @@ namespace direct_bt {
bool mgmtEvDeviceFoundHCI(std::shared_ptr<MgmtEvent> e) noexcept;
bool mgmtEvDeviceDisconnectedMgmt(std::shared_ptr<MgmtEvent> e) noexcept;
bool mgmtEvPairDeviceCompleteMgmt(std::shared_ptr<MgmtEvent> e) noexcept;
+ bool mgmtEvNewLongTermKeyMgmt(std::shared_ptr<MgmtEvent> e) noexcept;
bool mgmtEvDeviceDiscoveringHCI(std::shared_ptr<MgmtEvent> e) noexcept;
bool mgmtEvDeviceConnectedHCI(std::shared_ptr<MgmtEvent> e) noexcept;
diff --git a/api/direct_bt/DBTDevice.hpp b/api/direct_bt/DBTDevice.hpp
index d38000eb..22772080 100644
--- a/api/direct_bt/DBTDevice.hpp
+++ b/api/direct_bt/DBTDevice.hpp
@@ -113,7 +113,6 @@ namespace direct_bt {
std::mutex mtx_pairing;
jau::sc_atomic_bool sync_pairing;
-
DBTDevice(DBTAdapter & adapter, EInfoReport const & r);
/** Add advertised service (GAP discovery) */
@@ -160,6 +159,10 @@ namespace direct_bt {
*/
bool connectSMP(std::shared_ptr<DBTDevice> sthis, const BTSecurityLevel sec_level) noexcept;
+ bool checkPairingKeyDistributionComplete(const std::string& timestamp) const noexcept;
+
+ bool updatePairingState(std::shared_ptr<DBTDevice> sthis, std::shared_ptr<MgmtEvent> evt, const HCIStatusCode evtStatus, SMPPairingState claimed_state) noexcept;
+
/**
* Forwarded from HCIHandler -> DBTAdapter -> this DBTDevice
* <p>
@@ -189,8 +192,6 @@ namespace direct_bt {
*/
bool connectGATT(std::shared_ptr<DBTDevice> sthis) noexcept;
- bool updatePairingState(std::shared_ptr<DBTDevice> sthis, std::shared_ptr<MgmtEvent> evt, const HCIStatusCode evtStatus, SMPPairingState claimed_state) noexcept;
-
/**
* Will be performed within disconnect() and notifyDisconnected().
*/