Skip to content

Commit 55973b5

Browse files
committed
fix(crypto): Make ExportedRoomKey deserialization laxer
Some clients might have skipped the serialization of an empty sender_claimed_keys and the forwarding_curve25519_key_chain, while these fields are required there's really no upside in requiring them if they are empty. So create defaults if they are missing.
1 parent 33b198d commit 55973b5

File tree

1 file changed

+2
-0
lines changed
  • crates/matrix-sdk-crypto/src/olm/group_sessions

1 file changed

+2
-0
lines changed

crates/matrix-sdk-crypto/src/olm/group_sessions/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ pub struct ExportedRoomKey {
6464
pub session_key: ExportedGroupSessionKey,
6565

6666
/// The Ed25519 key of the device which initiated the session originally.
67+
#[serde(default)]
6768
pub sender_claimed_keys: BTreeMap<DeviceKeyAlgorithm, String>,
6869

6970
/// Chain of Curve25519 keys through which this session was forwarded, via
7071
/// m.forwarded_room_key events.
72+
#[serde(default)]
7173
pub forwarding_curve25519_key_chain: Vec<String>,
7274
}
7375

0 commit comments

Comments
 (0)