Element-R: login-and-verify tranche 2: rust-backed implemention of VerificationRequest
#25316
Labels
A-Element-R
Issues affecting the port of Element's crypto layer to Rust
T-Task
Tasks for the team like planning
Implement a new
matrix-js-sdk/rust-crypto/VerificationRequest
which wrapsmatrix_sdk_crypto::VerificationRequest
and implements theVerificationRequest
interface defined in #24983.VerificationRequest::changes
to anEventEmitter
. One solution:registerOnChangeCallback
to theVerificationRequest
class exported bymatrix-sdk-crypto-js
, which starts a thread to poll the changes stream and calls the callback (as we do forOlmMachine::register_room_key_updated_callback
)registerOnChangeCallback
with a function that calls.emit
.This assumes that the stream gets closed when the VerificationRequest is dropped (so that the polling thread closes). Confirm this actually happens.
m.key.verification.ready
is sent or received, amatrix_sdk_crypto::Verification
(one ofmatrix_sdk_crypto::Sas
ormatrix_sdk_crypto::QrVerification
) is created (which maps ontoVerificationBase
in the js-sdk). Fire a notification into the js-sdk when this transition happens (depends on crypto-js: Expose a newTransitioned
state inVerificationRequest
matrix-org/matrix-rust-sdk#1894), and also arrange for events to be propagated from theVerification
.I think this will be hard to unit test:
matrix-sdk-crypto-js::VerificationRequest
requires us to instantiate all theOlmMachine
machinery, so we may as well use an integ testSo let’s rely on the integration tests?
The text was updated successfully, but these errors were encountered: