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

Element-R: login-and-verify tranche 2: rust-backed implemention of VerificationRequest #25316

Closed
2 tasks done
Tracked by #24979
richvdh opened this issue May 9, 2023 · 0 comments · Fixed by matrix-org/matrix-js-sdk#3490
Closed
2 tasks done
Tracked by #24979
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning

Comments

@richvdh
Copy link
Member

richvdh commented May 9, 2023

Implement a new matrix-js-sdk/rust-crypto/VerificationRequest which wraps matrix_sdk_crypto::VerificationRequest and implements the VerificationRequest interface defined in #24983.

  • Figure out how to map from VerificationRequest::changes to an EventEmitter. One solution:
    • Add a registerOnChangeCallback to the VerificationRequest class exported by matrix-sdk-crypto-js, which starts a thread to poll the changes stream and calls the callback (as we do for OlmMachine::register_room_key_updated_callback)
    • in the wrapping class’s constructor, call 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.
  • Once an m.key.verification.ready is sent or received, a matrix_sdk_crypto::Verification (one of matrix_sdk_crypto::Sas or matrix_sdk_crypto::QrVerification) is created (which maps onto VerificationBase in the js-sdk). Fire a notification into the js-sdk when this transition happens (depends on crypto-js: Expose a new Transitioned state in VerificationRequest matrix-org/matrix-rust-sdk#1894), and also arrange for events to be propagated from the Verification.

I think this will be hard to unit test:

  • We could mock out the rust class, but then we would only be testing a few glue methods
  • Using a real matrix-sdk-crypto-js::VerificationRequest requires us to instantiate all the OlmMachine machinery, so we may as well use an integ test
    So let’s rely on the integration tests?
@richvdh richvdh added T-Task Tasks for the team like planning A-Element-R Issues affecting the port of Element's crypto layer to Rust labels May 9, 2023
@richvdh richvdh self-assigned this Jun 7, 2023
su-ex added a commit to SchildiChat/matrix-js-sdk that referenced this issue Feb 22, 2024
* The Browserify artifact is being deprecated, scheduled for removal in the October 10th release cycle. ([\matrix-org#3189](matrix-org#3189)).
* ElementR: Add `CryptoApi#bootstrapSecretStorage` ([\matrix-org#3483](matrix-org#3483)). Contributed by @florianduros.
* Deprecate `MatrixClient.findVerificationRequestDMInProgress`, `MatrixClient.getVerificationRequestsToDeviceInProgress`, and `MatrixClient.requestVerification`, in favour of methods in `CryptoApi`. ([\matrix-org#3474](matrix-org#3474)).
* Introduce a new `Crypto.VerificationRequest` interface, and deprecate direct access to the old `VerificationRequest` class. Also deprecate some related classes that were exported from `src/crypto/verification/request/VerificationRequest` ([\matrix-org#3449](matrix-org#3449)).
* OIDC: navigate to authorization endpoint ([\matrix-org#3499](matrix-org#3499)). Contributed by @kerryarchibald.
* Support for interactive device verification in Element-R. ([\matrix-org#3505](matrix-org#3505)).
* Support for interactive device verification in Element-R. ([\matrix-org#3508](matrix-org#3508)).
* Support for interactive device verification in Element-R. ([\matrix-org#3490](matrix-org#3490)). Fixes element-hq/element-web#25316.
* Element-R: Store cross signing keys in secret storage ([\matrix-org#3498](matrix-org#3498)). Contributed by @florianduros.
* OIDC: add dynamic client registration util function ([\matrix-org#3481](matrix-org#3481)). Contributed by @kerryarchibald.
* Add getLastUnthreadedReceiptFor utility to Thread delegating to the underlying Room ([\matrix-org#3493](matrix-org#3493)).
* ElementR: Add `rust-crypto#createRecoveryKeyFromPassphrase` implementation ([\matrix-org#3472](matrix-org#3472)). Contributed by @florianduros.
* Aggregate relations regardless of whether event fits into the timeline ([\matrix-org#3496](matrix-org#3496)). Fixes element-hq/element-web#25596.
* Fix bug where switching media caused media in subsequent calls to fail ([\matrix-org#3489](matrix-org#3489)).
* Fix: remove polls from room state on redaction ([\matrix-org#3475](matrix-org#3475)). Fixes element-hq/element-web#25573. Contributed by @kerryarchibald.
* Fix export type `GeneratedSecretStorageKey` ([\matrix-org#3479](matrix-org#3479)). Contributed by @florianduros.
* Close IDB database before deleting it to prevent spurious unexpected close errors ([\matrix-org#3478](matrix-org#3478)). Fixes element-hq/element-web#25597.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant