Skip to content

Commit

Permalink
crypto: change withheld code for IdentityBased share strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Sep 25, 2024
1 parent d254217 commit 2bb0c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions crates/matrix-sdk-crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Changes:

- Change the withheld code for keys not shared due to the `IdentityBasedStrategy`, from `m.unauthorised`
to `m.unverified`.
([#3985](https://github.com/matrix-org/matrix-rust-sdk/pull/3985))

- Improve logging for undecryptable Megolm events.
([#3989](https://github.com/matrix-org/matrix-rust-sdk/pull/3989))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ fn split_recipients_withhelds_for_user_based_on_identity(
allowed_devices: Vec::default(),
denied_devices_with_code: user_devices
.into_values()
.map(|d| (d, WithheldCode::Unauthorised))
.map(|d| (d, WithheldCode::Unverified))
.collect(),
}
}
Expand All @@ -461,7 +461,7 @@ fn split_recipients_withhelds_for_user_based_on_identity(
if d.is_cross_signed_by_owner(device_owner_identity) {
Either::Left(d)
} else {
Either::Right((d, WithheldCode::Unauthorised))
Either::Right((d, WithheldCode::Unverified))
}
});
IdentityBasedRecipientDevices {
Expand Down Expand Up @@ -1138,7 +1138,7 @@ mod tests {
.find(|(d, _)| d.device_id() == KeyDistributionTestData::dan_unsigned_device_id())
.expect("This dan's device should receive a withheld code");

assert_eq!(code, &WithheldCode::Unauthorised);
assert_eq!(code, &WithheldCode::Unverified);

// Check withhelds for others
let (_, code) = share_result
Expand All @@ -1147,7 +1147,7 @@ mod tests {
.find(|(d, _)| d.device_id() == KeyDistributionTestData::dave_device_id())
.expect("This dave device should receive a withheld code");

assert_eq!(code, &WithheldCode::Unauthorised);
assert_eq!(code, &WithheldCode::Unverified);
}

/// Test key sharing with the identity-based strategy with different
Expand Down

0 comments on commit 2bb0c50

Please sign in to comment.