-
-
Notifications
You must be signed in to change notification settings - Fork 617
Element-R: implement encryption of outgoing events #3122
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
Conversation
756029b
to
6a30780
Compare
In practice we were never passing a nullish value in, so let's make that explicit.
7f4a693
to
bede60c
Compare
It doesn't do much yet, but it's a start.
Wire up the rust implementation into the outgoing message path, to encrypt events.
we need to track the devices of users that join the room after us.
bede60c
to
a82d431
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane, could we hit 80% covg on the bits outside of rust-crypto at least?
src/rust-crypto/RoomEncryptor.ts
Outdated
); | ||
|
||
event.makeEncrypted( | ||
"m.room.encrypted", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventType enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, done.
mmkay. I believe we're now there: 14 lines are changing outside rust-crypto, of which 12 are tested. |
* Element-R: implement encryption of outgoing events ([\matrix-org#3122](matrix-org#3122)). * Poll model - page /relations results ([\matrix-org#3073](matrix-org#3073)). Contributed by @kerryarchibald. * Poll model - validate end events ([\matrix-org#3072](matrix-org#3072)). Contributed by @kerryarchibald. * Handle optional last_known_event_id property in m.predecessor ([\matrix-org#3119](matrix-org#3119)). Contributed by @andybalaam. * Add support for stable identifier for fixed MAC in SAS verification ([\matrix-org#3101](matrix-org#3101)). * Provide eventId as well as roomId from Room.findPredecessor ([\matrix-org#3095](matrix-org#3095)). Contributed by @andybalaam. * MSC3946 Dynamic room predecessors ([\matrix-org#3042](matrix-org#3042)). Contributed by @andybalaam. * Poll model ([\matrix-org#3036](matrix-org#3036)). Contributed by @kerryarchibald. * Remove video tracks on video mute without renegotiating ([\matrix-org#3091](matrix-org#3091)). * Introduces a backwards-compatible API change. `MegolmEncrypter#prepareToEncrypt`'s return type has changed from `void` to `() => void`. ([\matrix-org#3035](matrix-org#3035)). Contributed by @clarkf. * Stop the ICE disconnected timer on call terminate ([\matrix-org#3147](matrix-org#3147)). * Clear notifications when we can infer read status from receipts ([\matrix-org#3139](matrix-org#3139)). Fixes element-hq/element-web#23991. * Messages sent out of order after one message fails ([\matrix-org#3131](matrix-org#3131)). Fixes element-hq/element-web#22885 and element-hq/element-web#18942. Contributed by @justjanne. * Element-R: fix a bug which prevented encryption working after a reload ([\matrix-org#3126](matrix-org#3126)). * Element-R: Fix invite processing ([\matrix-org#3121](matrix-org#3121)). * Don't throw with no `opponentDeviceInfo` ([\matrix-org#3107](matrix-org#3107)). * Remove flaky megolm test ([\matrix-org#3098](matrix-org#3098)). Contributed by @clarkf. * Fix "verifyLinks" functionality of getRoomUpgradeHistory ([\matrix-org#3089](matrix-org#3089)). Contributed by @andybalaam.
I forgot this in #3122 :(. To be honest, I'm not sure how it ever worked.
This PR wires up the Rust-SDK into the event encryption path. I'm sorry it's a bit meaty - I've tried to break it down into bite-size commits and I recommend reviewing them in turn.
I'm also sorry that it's not as well tested as I would like, and in particular there are no integration tests. I've had trouble getting the tests to work for reasons including, but not limited to, matrix-org/matrix-rust-sdk#1443. However, empirically it works in a browser, and I'm keen to see this shipped. I'll return to the tests soon.
Here's what your changelog entry will look like:
✨ Features