diff options
author | Sven Gothel <[email protected]> | 2020-11-23 19:58:05 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-11-23 19:58:05 +0100 |
commit | 52352d6ba1019107ee8a3619643d472520c0def8 (patch) | |
tree | 1469f298f349c83f739a87f0eb41df87c27cbf09 /api | |
parent | 652e3fc523ac62abddc1afba8468ac601a153464 (diff) |
Security: Re-enable auth-failure (try w/o security); Resolve L2CAPComm::open() BT_SECURITY deadlock
Re-enable auth-failure (try w/o security) from hciSMPMsgCallback()
Resolve L2CAPComm::open() BT_SECURITY deadlock
- set sec_level after connect() within L2CAPComm::open()
- see macro SET_BT_SECURITY_POST_CONNECT in L2CAPComm.cpp
- L2CAPComm::setBTSecurityLevel() ignores unchanged BT_SECURITY value.
Otherwise it fails on BTSecurityLevel::NONE, don't ask - don't know, even after BlueZ/Kernel review.
Working w/ DBTScanner10:
- Device w/o security: No special settings in commandline
- Device w/ Secure Connection SMP: Only set passkey in commandline
- Device w/ legacy encryption only (no auth): Set BTSecurityLevel::ENC_ONLY or SMPIOCapabilities::NO_INPUT_NO_OUTPUT or both.
Diffstat (limited to 'api')
-rw-r--r-- | api/direct_bt/L2CAPComm.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/api/direct_bt/L2CAPComm.hpp b/api/direct_bt/L2CAPComm.hpp index 9ff2f069..21719d7f 100644 --- a/api/direct_bt/L2CAPComm.hpp +++ b/api/direct_bt/L2CAPComm.hpp @@ -143,7 +143,7 @@ namespace direct_bt { std::atomic<pthread_t> tid_read; bool setBTSecurityLevelImpl(const BTSecurityLevel sec_level); - bool getBTSecurityLevelImpl(BTSecurityLevel& sec_level); + BTSecurityLevel getBTSecurityLevelImpl(); public: /** @@ -197,10 +197,9 @@ namespace direct_bt { /** * Fetches the current BlueZ's L2CAP socket BT_SECURITY sec_level. * - * @param sec_level return value reference written to if method returns true - * @return true if successful with result written to sec_level, otherwise false. + * @return BTSecurityLevel sec_level value, BTSecurityLevel::UNSET if failure */ - bool getBTSecurityLevel(BTSecurityLevel& sec_level); + BTSecurityLevel getBTSecurityLevel(); /** Generic read, w/o locking suitable for a unique ringbuffer sink. Using L2CAPEnv::L2CAP_READER_POLL_TIMEOUT.*/ jau::snsize_t read(uint8_t* buffer, const jau::nsize_t capacity); |