Skip to content
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

Complete CSIP and CAP #374

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Complete CSIP and CAP #374

merged 1 commit into from
Dec 22, 2023

Conversation

zxzxwu
Copy link
Collaborator

@zxzxwu zxzxwu commented Dec 14, 2023

Changes:

  • RSI generation
  • SIRK encryption
  • Delegated SIRK reader
  • Prand and random address generation

TODO:

Test:

  • csip_test, cap_test
  • Manually pairing with Android CSIS client

@zxzxwu
Copy link
Collaborator Author

zxzxwu commented Dec 14, 2023

One question: LTK and LK must be retrieved asynchronously, but GATT read must be synchronous. How to resolve this?

@barbibulle
Copy link
Collaborator

One question: LTK and LK must be retrieved asynchronously, but GATT read must be synchronous. How to resolve this?I

I have a WIP local branch that implements support for async characteristic values (both read and write). I'll polish it off and submit a PR shortly, that should solve your use case here.

@zxzxwu zxzxwu marked this pull request as ready for review December 15, 2023 09:11
@zxzxwu
Copy link
Collaborator Author

zxzxwu commented Dec 18, 2023

We may merge this CL first, and then create another PR when the async GATT read is ready.

bumble/crypto.py Outdated


# -----------------------------------------------------------------------------
def generate_random_static_address() -> bytes:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this function should return an Address, with the right address type? (Also, this is a function that uses crypto, but isn't a crypto function itself, so maybe it should live somewhere else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rand / prand is also considered crypto somehow? But yes, they're better to be classmethods of Address. The only exception is prand - hosting it in hci/Address is not very proper, but there isn't a module more proper than crypto(from my point of view).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving address methods to #379

Also add random address generation functions.
@zxzxwu zxzxwu merged commit 6139ca8 into google:main Dec 22, 2023
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants