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

Handle SMP_Security_Request #291

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Handle SMP_Security_Request #291

merged 1 commit into from
Sep 20, 2023

Conversation

zxzxwu
Copy link
Collaborator

@zxzxwu zxzxwu commented Sep 19, 2023

Note: It's different from other delegation methods, but this mode looks more "Bumble"(considering the EE).

Alternative: If we still prefer PairingDelegate mode, we may add a get_security_action(peer_address, auth_req) method in PairingDelegate, which returns one of the following action, and perform the corresponding action:

  • Ignore
  • Pair
  • Encrypt
  • Refresh key

@zxzxwu zxzxwu requested a review from uael September 19, 2023 13:26
bumble/smp.py Show resolved Hide resolved
bumble/pandora/security.py Outdated Show resolved Hide resolved
@@ -294,23 +294,37 @@ async def Secure(
try:
self.log.debug('Pair...')

wait_for_security = asyncio.get_running_loop().create_future()

def on_pairing(*_: Any) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggest: you could use the decorator syntax here:

@connection.on("pairing")
def on_pairing(*_: Any) -> None:
  ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Random chat: If there could be a once-but-destroy-on-leave(just like other local variables' lifecycle) that will be useful

Copy link
Collaborator

Choose a reason for hiding this comment

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

See PR #292 for a proposal of how this could be done.

bumble/smp.py Outdated Show resolved Hide resolved
bumble/pandora/security.py Outdated Show resolved Hide resolved
bumble/pandora/security.py Outdated Show resolved Hide resolved
bumble/pandora/security.py Outdated Show resolved Hide resolved
@uael
Copy link
Contributor

uael commented Sep 19, 2023

@barbibulle could you please tag a new release after this is merged ?
I'm about to add all avatar tests to the avatar CI, but need this and latest changes 🙌
Can I add them to the bumble CI as well ?

@zxzxwu
Copy link
Collaborator Author

zxzxwu commented Sep 20, 2023

Rebased on #293

@uael
Copy link
Contributor

uael commented Sep 20, 2023

Can you rebase on top of main ?

@uael uael merged commit 2491b68 into google:main Sep 20, 2023
27 checks passed
@zxzxwu zxzxwu deleted the smp branch January 19, 2024 15:47
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.

None yet

3 participants