diff --git a/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs b/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs index 309a11c3152..d1d69262cbc 100644 --- a/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs +++ b/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data.rs @@ -72,7 +72,7 @@ pub enum SenderData { device_id: Option, /// The cross-signing key of the user who established this session. - master_key: Ed25519PublicKey, + master_key: Box, /// Whether, at the time we checked the signature on the device, /// we had actively verified that `master_key` belongs to the user. diff --git a/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data_finder.rs b/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data_finder.rs index 581aaa77013..52f104b3218 100644 --- a/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data_finder.rs +++ b/crates/matrix-sdk-crypto/src/olm/group_sessions/sender_data_finder.rs @@ -266,6 +266,7 @@ impl<'a> SenderDataFinder<'a> { if let Some(master_key) = master_key { // We have user_id and master_key for the user sending the to-device message. + let master_key = Box::new(master_key); let master_key_verified = sender_device.is_cross_signing_trusted(); SenderData::SenderKnown { user_id, device_id, master_key, master_key_verified } } else { @@ -448,7 +449,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); assert!(!master_key_verified); } @@ -477,7 +478,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); assert!(!master_key_verified); } @@ -507,7 +508,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); assert!(!master_key_verified); } @@ -536,7 +537,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); assert!(!master_key_verified); } @@ -604,7 +605,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); // Including the fact that it was verified assert!(master_key_verified); } @@ -637,7 +638,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); // Including the fact that it was verified assert!(master_key_verified); } @@ -661,7 +662,7 @@ mod tests { ); assert_eq!(user_id, setup.sender.user_id); assert_eq!(device_id.unwrap(), setup.sender_device.device_id()); - assert_eq!(master_key, setup.sender_master_key()); + assert_eq!(*master_key, setup.sender_master_key()); assert!(!master_key_verified); }