Comments (2)
The keys in the file-based key store are stored per-address, and unbond.py should really only remove the keys for a single address (it you don't pass an address, it just prints all the keys but doesn't remove anything, which the help text really should document...).
With Bluetooth LE, things are a bit more complex than with Classic, because of LE privacy. The addresses that are used by LE-privacy-enabled devices (most of them) rotate regularly (typically every 15 minutes for something like a phone). Those rotating addresses can be "resolved" back to a fixed address by peers that have the IRK (identity resolving key), which is obtained when pairing.
When pairing, the paired device will share, along with the IRK, its "identity address" with the pairing peer, and that's the address that's used for key storage in the key store. When you can for devices, you will see the rotating random address (a.k.a "resolvable private address"), and if you have the IRK, it can be resolved. Having the IRK for a device, and being able to resolve a private address is what tells you that you're paired with that advertising device.
In order to resolve addresses, you have to use an AddressResolver
object, which you instantiate by passing a list of resolving keys. From keystore instance, keystore.get_resolving_keys()
gets you that list.
I'm working on some enhancement to make that key resolving step automatic, but in the current version, that's something you need to do for yourself when you get advertisement results.
The scan.py
app is "supposed" to do that for you when your device config has a keystore or if you pass a keystore file explicitly, but I see that it's broken in the current version (because the instantiation of the keystore object have been moved to after power_on()
, I will send a PR to fix that (but the code example to resolve keys with a resolver is still valid).
Finally, about encryption on LE: just being paired doesn't mean you'll have encryption enabled. In a connection, one of the peers will need to request it. That's done with connection.encrypt()
. With desktop and phone OSes, that may happen automatically if you try to access a GATT characteristic that returns an error indicating that there isn't sufficient encryption. Bumble doesn't (yet) do this automatic request upon GATT error, so if you need encryption, you have to call .encrypt()
to request it.
from bumble.
Thanks again for explaining.
So at a high level :
- on_connect , check if you can resolve the keys , if not pair request.
- on_pair or on_connect (if already paired) -> connection.encrypt()
from bumble.
Related Issues (20)
- Android Emulator issue - HOT 5
- HCI_Reset is missing status HOT 1
- Support for Cuttlefish Android Virtual device HOT 6
- Using bumble to automate test for bluetooth-paring device (with android emulator) HOT 3
- How to add manufacturer_specific_data in device advertising data? HOT 2
- Running BTBench between Android Device and UbuntuHost HOT 1
- CONNECTION_REFUSED_PSM_NOT_SUPPORTED HOT 2
- Connection to speaker app drops after few seconds HOT 1
- Bumble windows install keeps failing. HOT 2
- Bumble-hci-bridge returning 'LIBUSB_ERROR_NOT_SUPPORTED HOT 2
- Hangs at HCI_INTEL_DDC_CONFIG_WRITE_COMMAND with CSR Bluetooth dongle HOT 2
- Android Emulator - Receiving UNEXPECTED commands HOT 1
- Is it possible to add an SBC encoder so we can play anything to the A2DP stream? HOT 1
- grpcio 1.57.0 fails to build with Python 3.12 on aarch64 MacOS with Apple Silicon HOT 1
- A2DP stream stops sending data after 15 minutes 51 seconds
- Controller object has no attribute advertising times [extended advertisement branch] HOT 2
- Using Bumble with Protobuf < 3.20 HOT 4
- Duplicate HCI Reset When Tearing Down and Re-Creating Transport HOT 12
- GATT server receiving data from Android devices but no iOS devices HOT 6
- BLE: Unable to request pairing / Unable to reconnect HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bumble.