Skip to content

Commit 3b08731

Browse files
committed
fixup! crypto: add types to support decryption of RoomKeyHistoryBundle to-device events
1 parent 8131301 commit 3b08731

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crates/matrix-sdk-crypto/src/machine/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ use crate::{
7979
},
8080
types::{
8181
events::{
82-
olm_v1::{AnyDecryptedOlmEvent, DecryptedOlmV1Event, DecryptedRoomKeyEvent},
82+
olm_v1::{
83+
AnyDecryptedOlmEvent, DecryptedOlmV1Event, DecryptedRoomKeyBundleEvent,
84+
DecryptedRoomKeyEvent,
85+
},
8386
room::encrypted::{
8487
EncryptedEvent, EncryptedToDeviceEvent, RoomEncryptedEventContent,
8588
RoomEventEncryptionScheme, SupportedEventEncryptionSchemes,
@@ -943,7 +946,7 @@ impl OlmMachine {
943946
async fn receive_room_key_bundle(
944947
&self,
945948
sender_key: Curve25519PublicKey,
946-
event: &DecryptedOlmV1Event<RoomKeyBundleContent>,
949+
event: &DecryptedRoomKeyBundleEvent,
947950
changes: &mut Changes,
948951
) -> OlmResult<()> {
949952
let Some(sender_device_keys) = &event.sender_device_keys else {

crates/matrix-sdk-crypto/src/types/events/olm_v1.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ impl DecryptedForwardedRoomKeyEvent {
8181
/// `m.olm.v1.curve25519-aes-sha2` algorithm
8282
pub type DecryptedSecretSendEvent = DecryptedOlmV1Event<SecretSendContent>;
8383

84+
/// An `io.element.msc4268.room_key_bundle` to-device event which has
85+
/// been decrypted using using the `m.olm.v1.curve25519-aes-sha2` algorithm
86+
pub type DecryptedRoomKeyBundleEvent = DecryptedOlmV1Event<RoomKeyBundleContent>;
87+
8488
/// An enum over the various events that were decrypted using the
8589
/// `m.olm.v1.curve25519-aes-sha2` algorithm.
8690
#[derive(Debug)]
@@ -94,7 +98,7 @@ pub enum AnyDecryptedOlmEvent {
9498
/// The `m.dummy` decrypted to-device event.
9599
Dummy(DecryptedDummyEvent),
96100
/// The `io.element.msc4268.room_key_bundle` decrypted to-device event.
97-
RoomKeyBundle(DecryptedOlmV1Event<RoomKeyBundleContent>),
101+
RoomKeyBundle(DecryptedRoomKeyBundleEvent),
98102
/// A decrypted to-device event of an unknown or custom type.
99103
Custom(Box<ToDeviceCustomEvent>),
100104
}

0 commit comments

Comments
 (0)