matrix-org / matrix-org/matrix-rust-sdk
`OlmMachine::decrypt_room_event` should detect redacted events and return a different error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
Currently if a redacted event is passed to `OlmMachine::decrypt_room_event` it will fail with error `UnsupportedAlgorithm`(?).
Given that the event is redacted, there won't be an `algorithm`field, so it's expected.
Nonetheless this will produce UTDs for redacted events, and sdk clients could falsely display them as UTD (in ER case report false positive UTD metrics).
Could it be possible to special case redacted event and return a successful decryption with an empty content, of type `m.room.message`? (and unknown alg)?
Redacted event could be detected by checking existence of `unsigned.redacted_because`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at OlmMachine::decrypt_room_event and inspect how redacted events are represented through unsigned.redacted_because and how UnsupportedAlgorithm is produced. Confirm the intended successful result for a redacted event: empty content, m.room.message type, and unknown algorithm, while avoiding a false UTD.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100