matrix-org / matrix-org/matrix-rust-sdk

Cross signing fails key match after several times of key mismatch

Open
#3,216 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

I was testing verification.
Once any device is verified, we can try verification for that device no more.
Single solution is to logout that device and clear verification history.
So I responded key mismatch to avoid logout in every time.
```rs
sas.mismatch().await;
```
I could finish handling of all events prior to `SasState::Confirmed` via several times of mismatch.
I tried key match, but it always failed with [CancelCode::KeyMismatch](https://github.com/matrix-org/matrix-rust-sdk/blob/1f52aca210e237656f5ea56544f4279a28298671/crates/matrix-sdk-crypto/src/verification/mod.rs#L512).
```rs
sas.confirm().await;
```

Contributor guide

Open the contributing guide

Research direction

Start in crates/matrix-sdk-crypto/src/verification/mod.rs around the CancelCode::KeyMismatch path, then trace the SasState::Confirmed handling. Reproduce the sequence of several sas.mismatch().await calls followed by sas.confirm().await and compare the resulting state and cancellation behavior with the intended key-match flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.