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

Allow users to encrypt arbitrary to-device events

Open
#1,453 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Encryption enhancement
Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

There have been some requests going around in the support room of the SDK that people would like to send encrypted to-device events.

While it would be trivial to expose a `Device.send_event()` method that sets up a Olm `Session` and allows people to send an event to a particular device, we need to be a bit careful about this.

If the user overuses an `OlmSession` it may lead to undecryptable messages on the others side. This will only happen in the case of to-device events also arriving out of order, but we don't have strict ordering guarantees for to-device events.

One idea was to use a different `OlmSession` for room key delivery and one for custom things. This way the room key delivery wouldn't be affected by whatever custom things the user might be doing. This sadly isn't possible since the other side will start using the new custom `Session` to deliver room keys to us.

Instead we might want to start looking at the message index of the individual `Session` and decide to rotate in case of overuse.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the SDK's to-device event handling and its Olm Session message-index logic. Define how arbitrary encrypted events should coexist with room-key delivery, including when session rotation is required; the issue does not name files, tests, or concrete acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.