Skip to content

Allow users to encrypt arbitrary to-device events #1453

Open
@poljar

Description

@poljar

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions