-
Notifications
You must be signed in to change notification settings - Fork 350
crypto: check sender_device_keys on incoming Olm messages
#4922
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
MSC4147 added a `sender_device_keys` property to the plaintext of *all* olm-encrypted events. 03d4a30 added the field to `DecryptedOlmV1Event`, but due to Reasons, there is an almost-parallel struct `ToDeviceCustomEvent` which is used for event types other than the 4 we have content types for. To complete the set, let's add the field to `ToDeviceCustomEvent`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4922 +/- ##
==========================================
+ Coverage 85.75% 85.79% +0.03%
==========================================
Files 316 316
Lines 35487 35501 +14
==========================================
+ Hits 30433 30459 +26
+ Misses 5054 5042 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
03ca45d to
59c5c48
Compare
MSC4147 added a `sender_device_keys` property to olm-encrypted to-device messages, with recommendations about checking the values in that propety. We do (most of?) those checks for `m.room_key` messages today, but not other types of to-device message.
59c5c48 to
e020ba1
Compare
poljar
left a comment
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 good.
For js-sdk users, this includes the following:
- Send stable identifier `sender_device_keys` for MSC4147 (Including device keys with Olm-encrypted events).
([#4964](matrix-org/matrix-rust-sdk#4964))
- Check the `sender_device_keys` field on _all_ incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per [MSC4147](matrix-org/matrix-spec-proposals#4147)).
([#4922](matrix-org/matrix-rust-sdk#4922))
- Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room.
([#4954](matrix-org/matrix-rust-sdk#4954))
- Fix [matrix-rust-sdk#2729](matrix-org/matrix-rust-sdk#2729) which in rare cases can cause room key oversharing.
([#4975](matrix-org/matrix-rust-sdk#4975))
For js-sdk users, this includes the following:
- Send stable identifier `sender_device_keys` for MSC4147 (Including device keys with Olm-encrypted events).
([#4964](matrix-org/matrix-rust-sdk#4964))
- Check the `sender_device_keys` field on _all_ incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per [MSC4147](matrix-org/matrix-spec-proposals#4147)).
([#4922](matrix-org/matrix-rust-sdk#4922))
- Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room.
([#4954](matrix-org/matrix-rust-sdk#4954))
- Fix [matrix-rust-sdk#2729](matrix-org/matrix-rust-sdk#2729) which in rare cases can cause room key oversharing.
([#4975](matrix-org/matrix-rust-sdk#4975))
For js-sdk users, this includes the following:
- Send stable identifier `sender_device_keys` for MSC4147 (Including device keys with Olm-encrypted events).
([#4964](matrix-org/matrix-rust-sdk#4964))
- Check the `sender_device_keys` field on _all_ incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per [MSC4147](matrix-org/matrix-spec-proposals#4147)).
([#4922](matrix-org/matrix-rust-sdk#4922))
- Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room.
([#4954](matrix-org/matrix-rust-sdk#4954))
- Fix [matrix-rust-sdk#2729](matrix-org/matrix-rust-sdk#2729) which in rare cases can cause room key oversharing.
([#4975](matrix-org/matrix-rust-sdk#4975))
For js-sdk users, this includes the following:
- Send stable identifier `sender_device_keys` for MSC4147 (Including device keys with Olm-encrypted events).
([#4964](matrix-org/matrix-rust-sdk#4964))
- Check the `sender_device_keys` field on _all_ incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per [MSC4147](matrix-org/matrix-spec-proposals#4147)).
([#4922](matrix-org/matrix-rust-sdk#4922))
- Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room.
([#4954](matrix-org/matrix-rust-sdk#4954))
- Fix [matrix-rust-sdk#2729](matrix-org/matrix-rust-sdk#2729) which in rare cases can cause room key oversharing.
([#4975](matrix-org/matrix-rust-sdk#4975))
For js-sdk users, this includes the following:
- Send stable identifier `sender_device_keys` for MSC4147 (Including device keys with Olm-encrypted events).
([#4964](matrix-org/matrix-rust-sdk#4964))
- Check the `sender_device_keys` field on _all_ incoming Olm-encrypted to-device messages and ignore any to-device messages which include the field but whose data is invalid (as per [MSC4147](matrix-org/matrix-spec-proposals#4147)).
([#4922](matrix-org/matrix-rust-sdk#4922))
- Fix bug which caused room keys to be unnecessarily rotated on every send in the presence of blacklisted/withheld devices in the room.
([#4954](matrix-org/matrix-rust-sdk#4954))
- Fix [matrix-rust-sdk#2729](matrix-org/matrix-rust-sdk#2729) which in rare cases can cause room key oversharing.
([#4975](matrix-org/matrix-rust-sdk#4975))
MSC4147 added a
sender_device_keysproperty to olm-encrypted to-device messages, with recommendations about checking the values in that propety. We do (most of?) those checks form.room_keymessages today, but not other types of to-device message.(This is prep work for #4512.)