Skip to content

Commit 6e42cc2

Browse files
committed
Add DecryptionErrorCode::MismatchedSender.
Update the SDK to 6ab11a032, which includes matrix-rust-sdk#5219, whihch adds a new VerificationLevel for mismatched senders. We expose this to the application via a new DecryptionErrorCode.
1 parent 0a9c9c1 commit 6e42cc2

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# UNRELEASED
22

3-
- Update matrix-rust-sdk to `0e9ce0271`.
3+
- Update matrix-rust-sdk to `6ab11a032`.
4+
5+
- Add a new error code for `MegolmDecryptionError`, `DecryptionErrorCode::MismatchedSender`, indicating that the sender of the event does not match the owner of the device that established the Megolm session. ([#248](https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/248))
46

57
# matrix-sdk-crypto-wasm v15.0.0
68

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ futures-util = "0.3.27"
6464
getrandom = { version = "0.3.0", features = ["wasm_js"] }
6565
http = "1.1.0"
6666
js-sys = "0.3.49"
67-
matrix-sdk-common = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "0e9ce0271", features = ["js"] }
68-
matrix-sdk-indexeddb = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "0e9ce0271", default-features = false, features = ["e2e-encryption"] }
69-
matrix-sdk-qrcode = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "0e9ce0271", optional = true }
67+
matrix-sdk-common = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "6ab11a032", features = ["js"] }
68+
matrix-sdk-indexeddb = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "6ab11a032", default-features = false, features = ["e2e-encryption"] }
69+
matrix-sdk-qrcode = { git = "https://github.com/matrix-org/matrix-rust-sdk", rev = "6ab11a032", optional = true }
7070
serde = "1.0.91"
7171
serde_json = "1.0.91"
7272
serde-wasm-bindgen = "0.6.5"
@@ -84,7 +84,7 @@ vergen-gitcl = { version = "1.0.0", features = ["build"] }
8484

8585
[dependencies.matrix-sdk-crypto]
8686
git = "https://github.com/matrix-org/matrix-rust-sdk"
87-
rev = "0e9ce0271"
87+
rev = "6ab11a032"
8888
default-features = false
8989
features = ["js", "automatic-room-key-forwarding"]
9090

src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ pub enum DecryptionErrorCode {
2626
SenderIdentityVerificationViolation,
2727
/// Other failure.
2828
UnableToDecrypt,
29+
/// The `sender` field on the event does not match the owner of the device
30+
/// that established the Megolm session.
31+
MismatchedSender,
2932
}
3033

3134
/// Js Decryption error with code.
@@ -92,6 +95,9 @@ impl From<MegolmError> for MegolmDecryptionError {
9295
warn!("Unexpected verification level in megolm decryption error {}", value);
9396
decryption_error(DecryptionErrorCode::UnableToDecrypt, None)
9497
}
98+
VerificationLevel::MismatchedSender => {
99+
decryption_error(DecryptionErrorCode::MismatchedSender, None)
100+
}
95101
},
96102
_ => decryption_error(DecryptionErrorCode::UnableToDecrypt, None),
97103
}

0 commit comments

Comments
 (0)