| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
Previous scheme : `bd_C0:26:DA:01:DA:B1:1.smpkey.bin'
FAT32 LFN scheme: `bd_C0_26_DA_01_DA_B1_1-smpkey.bin'
Tested interoperability with native and java test application.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
use case
Was used to test SMPKeyBin w/o encryption.
|
|
|
|
|
|
|
|
|
| |
createAndWrite(..) and readAndApply(..) one-liner
Further:
- Bump to version 2
- Add creation timestamp (seconds since epoch)
- Convenient createAndWrite(..) and readAndApply(..) one-liner handle overwrite and remove-invalid use-case
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Default toString() is w/o additional data
|
|
|
|
| |
methods but toString() for convenience
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AdapterStatusListener
Completing BTDevice lifecycle handling comming 30b4e5f0c1f62c92c40a6ccceda8878f88a9521a
"AdapterStatusListener::deviceFound: Resolve sharedDevices persistence of found device via return value"
Fix leaked AdapterStatusListener: Turns out the introduced mechanism of not adding BTDevice's
to sharedDevices list, but keeping them in discoveredDevices (to avoid duplicate scan results),
did not consider removing its BTDevice bound AsapterStatusListener (here: DBTDevice.java).
Example:
- BTDevice found and instance C++/Java is created
- Java's BTDevice creates and adds its AdapterStatusListener
- All AdapterStatusListener::deviceFound(..) called
- User is not interested, all 'AdapterStatusListener::deviceFound(..)' return 'false'
- BTDevice remains in discoveredDevices, but not in sharedDevices.
* Subsequent clearance of discoveredDevices leaks the AdapterStatusListener: Not removed
* AdapterStatusListener::deviceUpdated(..) of the removed BTDevice eventually gets called,
but the BTDevice is already deleted
* The Java -> JNI call causes our exception: Null reference to native instance!
Hence all BTDevice lifecycle bound AdapterStatusListener shall be marked as such,
using a StatusListenerPair{AdapterStatusListener, weak_ptr<BTDevice>}.
This way, every removed discoveredDevice's BTDevice will remove
its associated AdapterStatusListener.
Further, every explicitly BTDevice::remove() will remove its associated AdapterStatusListener.
New 'BTDevice::addAdapterStatusListener(l)' (C++/Java) performs the required association.
+++
On the Java side the discoveredDevices are now only using a WeakReference<BTDevice>
to avoid leaking/holding BTDevice instances.
+++
This added complexity of 'StatusListenerPair' only exists, b/c discoveredDevices holds complete BTDevice instances.
We could have soothed this by just listing BDAddressAndType, but the current API
required to query 'List<BTDevice> discoveredDevices' ...
+++
BTDevice/BTAdapter:
- Use lock-free 'jau::sc_atomic_critical sync(sync_data)' whenever possible, instead of mutex-lock, i.e.
merely reading/copy data at an undeterministic point in time
---
DBTDevice
Misc
- Added BTUtil.fprintf_td(..), prepending elapsedTime()
- DBTDevice.java: sort method in proper groups: Unsupported, internal, ..
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
default ..
.. it requires linking of a specific C++ lib for certain compiler setup.
Use plain stdio remove.
|
|
|
|
| |
API (completely)
|
|
|
|
|
|
|
| |
Send 'passkey 0' or 'boolean-confirm false' if no SecDetail has been registered
Also always unpair the device before connecting and after processing,
ensuring a clean adapter state and no 'left behind' artifacts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SMP negotiation aborted (Bad Key)
HCI informs us with a HCIEventType::ENCRYPT_CHANGE message: HCIStatusCode PIN_OR_KEY_MISSING
in case we use a bad key file.
(HCIHandler transform the native HCIEventType::ENCRYPT_CHANGE event into a HCI_ENC_CHANGED MgmtEvent,
reusing Mgmt's event listener)
This can happen if device has been paired with a new and hence different key elsewhere.
Then later the device is used on a different machine with an older LTK, which fails.
Solution is to delete a potential existing key on pairing failure.
[ 9,047] Debug: DBTDevice::updatePairingState.3: state NONE -> FAILED, mode NONE -> NONE, ready 0,
MgmtEvt[opcode HCI_ENC_CHANGED, devID 0x0001, address=C0:26:DA:01:DA:B1, addressType BDADDR_LE_PUBLIC,
status PIN_OR_KEY_MISSING, enabled 0x00, data[size 0, data ], tsz 15]
|
| |
|
|
|
|
|
|
| |
binding. Hint: Better use setPairingPasskey(passkey = 0) ..
.. since current experience exposed a roughly 3s immediate disconnect handshake with certain devices and/or Kernel BlueZ code.
|
| |
|
| |
|
|
|
|
| |
HCIHandler: Don't show well handled ATT packets in DEBUG output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
direct_bt::to_string() Patch [2/2]
This goes along with jaulib's 'hex and decimal string conversion'.
API schema for to string conversion:
1 - free function: to_string(type)
2 - main member function: toString()
3 - sub-type member function: getTypeString(Type)
3 avoid overload collision w/ potential virtual toString() method.
Additional, 1 is provided for 3 as well
|
| |
|
|
|
|
| |
direct_bt::to_string() Patch [1/2]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After having the SMPKeyBin setup/upload exported to SMPKeyBin,
further changes to handling security setup was desired:
- Upload known passkey if requested and available via 'Preset-SecurityDetail'
- Optionally (disabled) upload via runtime input: This should be done pre-connect attempt!
Same for NUMERIC_COMPARISON (binary yes/no) ..
BTDevice is also no more leaking any PASSKEY or NUMERIC_COMPARISON
request if SMPIOCapability is not supporting requested input!
If any input is request, not satisfied by 'Preset-SecurityDetail',
the device is being removed.
This portion is within the 'passkeyInputAndSend()' and 'binaryInputAndSend()',
where the runtime input has been disabled.
+++
Further: SEC AUTO is enabled (per default using SMPIOCapability::KEYBOARD_ONLY) if
- No pre-existing key exists or could not be applied
- 'Preset-SecurityDetail' has requested SEC AUTO
- 'Preset-SecurityDetail' has no SecLevel or IOCap requested
|
|
|
|
|
|
|
|
|
| |
and if appropriate '#if SMP_SUPPORTED_BY_OS'.
Currently we only support the Linux-Kernel Bluez HCI host implementation,
which does not fully expose SMP.
Hence have all portions tagged properly to add support for other OS later on..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and uploading available LTKs
Moving the SMPKeyBin setup and key-upload for the BTDevice to public SMPKeyBin,
providing the proper setup and upload method.
One change compared to removed coding in Scanner10 example occured:
"BTSecurityLevel::ENC_ONLY is set to avoid a new SMP PairingMode negotiation,
which is undesired as this instances' stored LTK shall be used for PairingMode::PRE_PAIRED."
i.e.: 'device.setConnSecurity(BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT);'
This has been evaluate with a Secure Connections capable LE device
using BTSecurityLevel::ENC_AUTH_FIPS and SMPIOCapability::KEYBOARD_ONLY.
After initial pairing using a dynamic generated passkey,
we connected successfully and stored the LTKs and CSRKs with this connection parameter.
Thereafter reconnect after setting (BTSecurityLevel.ENC_ONLY, SMPIOCapability.NO_INPUT_NO_OUTPUT)
and uploading stored keys succeeded with Linux Kernel-BlueZ host implementation.
|
|
|
|
| |
not removed
|
| |
|
|
|
|
|
|
|
|
| |
to jaulib byte get/set/swap) and hence ATTPDUTypes and SMPTypes
- Adapt to reverted constexpr_cxx20 name
- Refine constexpr for OctetTypes (thx to jaulib byte get/set/swap) and hence ATTPDUTypes and SMPTypes
|
| |
|
| |
|
|
|
|
| |
having __builtin_bit_cast())
|
| |
|
| |
|
|
|
|
| |
[get|put]_<type>_nc() as constexpr
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
enhancements
'enum' -> 'enum class' w/ all bells and whistles: L2CAP_PSM, L2CAP_CID, AD_Type_Const
BTAddress.hpp: Add 'constexpr uint8_t number(..)'
constexpr:
- equality- and bit-operations on different types:
EIRDataType, ManufactureSpecificData
- isEIRDataTypeSet(), setEIRDataTypeSet(), setAdapterSettingMaskBit()
HCIACLData Cleanup
- Use L2CAP_PSM and L2CAP_CID types
- Convenient queries if SMP or GATT type
- Add toString(..) w/ l2cap_data ptr
L2CAPComm: Use L2CAP_PSM and L2CAP_CID types
|
|
|
|
| |
argument: Unifying output.
|
| |
|
|
|
|
|
|
|
| |
Unifying output.
Having a leading `0x` always for MSB-First only, unifies the output and hence clarifies semantics of shown results.
This is compatible with 'btmon' output.
|