-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functions/tool for gen/verifying BLE IRK/RPA #377
Conversation
I am wondering whether this kind of use case should be in Bumble? You can implement the tool in your own codebase like AOSP, since it doesn't involve Bumble's internal lifecycle and functionality. |
But still Bumble has many "tools"? Maybe we need a guideline about what should be in Bumble, and what is not. |
Do you plan to add BLE privacy < 1.2 with random address resolution in host? |
Yes, Bumble already supports Host-side resolution. But it doesn't handle advertising reports(only in connection), so that's something we can enhance Bumble. |
Since Bumble is a general purpose project for developers working on Bluetooth-related things, I think it's good to host a collection of tools that relate to that, including very narrow tools like this that are useful for people working on the internals of the stack(s). |
There is support for address resolution for advertising reports in some places, like the |
bumble/helpers.py
Outdated
return crypto.r() | ||
|
||
|
||
def gen_rpa_with_irk(irk: bytes) -> bytes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest: naming this generare_rpa_with_irk
to be consistent with generate_irk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
apps/ble_rpa_tool.py
Outdated
@click.argument("irk", type=str) | ||
@click.argument("rpa", type=str) | ||
def verify_rpa(irk: str, rpa: str) -> None: | ||
rpa_bytes = addr_str_to_bytes(rpa) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the Address
class for this: bytes(hci.Address(rpa))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
apps/ble_rpa_tool.py
Outdated
def gen_rpa(irk: str) -> None: | ||
irk_bytes = bytes.fromhex(irk) | ||
rpa = gen_rpa_with_irk(irk_bytes) | ||
print(addr_bytes_to_str(rpa)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the hci.Address
class for this: hci.Address(rpa).to_string(with_type_qualifier=False)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
bumble/helpers.py
Outdated
return crypto.r() | ||
|
||
|
||
def gen_rpa_with_irk(irk: bytes) -> bytes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should return an hci.Address
object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
OK to merge? |
PR #379 was merged earlier, it includes functions for generating private addresses. Would be good to update this PR by removing |
Done |
No description provided.