Skip to content

Commit

Permalink
crypto: withhold outgoing messages to unsigned dehydrated devices
Browse files Browse the repository at this point in the history
Per #4313, we should not
send outgoing messages to dehydrated devices that are not signed by the current
pinned/verified identity.
  • Loading branch information
richvdh committed Jan 17, 2025
1 parent e9c5096 commit 001dcf6
Show file tree
Hide file tree
Showing 7 changed files with 750 additions and 19 deletions.
7 changes: 6 additions & 1 deletion crates/matrix-sdk-crypto/src/identities/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ impl Device {

/// Whether or not the device is a dehydrated device.
pub fn is_dehydrated(&self) -> bool {
self.inner.device_keys.dehydrated.unwrap_or(false)
self.inner.is_dehydrated()
}
}

Expand Down Expand Up @@ -966,6 +966,11 @@ impl DeviceData {
pub fn first_time_seen_ts(&self) -> MilliSecondsSinceUnixEpoch {
self.first_time_seen_ts
}

/// True if this device is an MSC3814 dehydrated device.
pub fn is_dehydrated(&self) -> bool {
self.device_keys.dehydrated.unwrap_or(false)
}
}

impl TryFrom<&DeviceKeys> for DeviceData {
Expand Down
Loading

0 comments on commit 001dcf6

Please sign in to comment.