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

Refactor the verification handling in the crypto crate #399

Open
poljar opened this issue Nov 9, 2021 · 4 comments
Open

Refactor the verification handling in the crypto crate #399

poljar opened this issue Nov 9, 2021 · 4 comments
Assignees

Comments

@poljar
Copy link
Contributor

poljar commented Nov 9, 2021

The verification logic has a bunch of layers, the bottom layer is a type-safe state machine. We should be able to simplify this, at least for the SAS verification types.

@poljar poljar added this to the Stabilize the crypto crate milestone Nov 9, 2021
@poljar poljar changed the title Simplify the verification layering in the crypto crate Refactor the verification handling in the crypto crate Jul 14, 2022
@poljar
Copy link
Contributor Author

poljar commented Oct 26, 2022

One thing that would help out immensely for the type-safe state machine is the type-changing struct update syntax.

Has been in development for some while though: rust-lang/rust#86555.

@BillCarsonFr
Copy link
Member

It's also a bit magical how the crypto crates handles verification events.
For example in rooms, it handles it because we try to decrypt the event (there is no receive room event call similar to to_device). As a consequence verification in a clear room won't work.

@BillCarsonFr
Copy link
Member

It's also a bit magical how the crypto crates handles verification events. For example in rooms, it handles it because we try to decrypt the event (there is no receive room event call similar to to_device). As a consequence verification in a clear room won't work.

Oh I see there is a call for that receiveUnencryptedVerificationEvent()

@poljar
Copy link
Contributor Author

poljar commented Nov 29, 2022

Oh I see there is a call for that receiveUnencryptedVerificationEvent()

There is, but you also seem to have missed some conversation in chat:

how about we remove the implicit handling of verification events when you decrypt, deprecate the receive_unencrypted_verification_event method and instead add a receive_verification_events() method; this method takes all the verification events we received in a particular sync and we fire out the signals when this method is gone through all events?

Perhaps we'll end up with just a single method that you need to call explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants