Skip to content

Commit 14ec35e

Browse files
authored
Merge pull request #3985 from matrix-org/valere/invisible_crypto/identity_based_withheld_code
crypto: change withheld code for IdentityBased share strategy
2 parents d254217 + 2bb0c50 commit 14ec35e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crates/matrix-sdk-crypto/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Changes:
44

5+
- Change the withheld code for keys not shared due to the `IdentityBasedStrategy`, from `m.unauthorised`
6+
to `m.unverified`.
7+
([#3985](https://github.com/matrix-org/matrix-rust-sdk/pull/3985))
8+
59
- Improve logging for undecryptable Megolm events.
610
([#3989](https://github.com/matrix-org/matrix-rust-sdk/pull/3989))
711

crates/matrix-sdk-crypto/src/session_manager/group_sessions/share_strategy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ fn split_recipients_withhelds_for_user_based_on_identity(
448448
allowed_devices: Vec::default(),
449449
denied_devices_with_code: user_devices
450450
.into_values()
451-
.map(|d| (d, WithheldCode::Unauthorised))
451+
.map(|d| (d, WithheldCode::Unverified))
452452
.collect(),
453453
}
454454
}
@@ -461,7 +461,7 @@ fn split_recipients_withhelds_for_user_based_on_identity(
461461
if d.is_cross_signed_by_owner(device_owner_identity) {
462462
Either::Left(d)
463463
} else {
464-
Either::Right((d, WithheldCode::Unauthorised))
464+
Either::Right((d, WithheldCode::Unverified))
465465
}
466466
});
467467
IdentityBasedRecipientDevices {
@@ -1138,7 +1138,7 @@ mod tests {
11381138
.find(|(d, _)| d.device_id() == KeyDistributionTestData::dan_unsigned_device_id())
11391139
.expect("This dan's device should receive a withheld code");
11401140

1141-
assert_eq!(code, &WithheldCode::Unauthorised);
1141+
assert_eq!(code, &WithheldCode::Unverified);
11421142

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

1150-
assert_eq!(code, &WithheldCode::Unauthorised);
1150+
assert_eq!(code, &WithheldCode::Unverified);
11511151
}
11521152

11531153
/// Test key sharing with the identity-based strategy with different

0 commit comments

Comments
 (0)