Skip to content

Further improve OMEMO - #2259

Merged
jubalh merged 4 commits into
masterfrom
moreomemo
Nov 17, 2026
Merged

jubalh merged 4 commits into
masterfrom
moreomemo

Conversation

@jubalh

@jubalh jubalh commented Nov 17, 2026

Copy link
Copy Markdown
Member

Ref: #2244

We unconditionally sent an omemo_bundle_request() for every device ID in
the device list, regardless of whether an active session already existed.

According to XEP-0384 Section 4, clients MUST NOT fetch a new bundle if
an active session already exists.

This consumes one-time prekeys from peer servers on every chat opening or
startup event, and risks corrupting active ratchet states.

Also skip requesting bundles for our own current device ID.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
On login omemo_start_sessions() iterated over all contacts
in the roster and initiated device list and bundle requests.

According to XEP-0384 Section 4, sessions should be established lazily
only when sending an encrypted message or upon receiving an incoming
prekey message.

Requesting crypto materials for the entire roster causes massive startup
IQ traffic and drains remote servers one-time prekeys for contacts that
may never be messaged.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
When a peer or our own account publishes an updated device list via PEP,
omemo_set_device_list() detected new device IDs and displayed a notice.
But did not fetch the bundle for the new device.

In blind trust mode, subsequent outgoing messages failed to encrypt to
the new device.

If trustmode is set to `blind`, automatically request the bundle for any
new device ID announced via PEP for existing contacts or own devices.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
…t mode

Upgrade 'blind' trust mode to follow Blind Trust Before Verification
(XEP-0454).

Device keys are trusted automatically until at least one of a contacts
fingerprint is manually verified via '/omemo trust'.

Once verified, the contact is marked as verified in a dedicated
[verified_contacts] section in trust.txt.
Blind trust is disabled for that contact.

Any subsequent devices announced by that contact will require manual
verification rather than being blindly accepted.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Nov 17, 2026
@jubalh jubalh self-assigned this Nov 17, 2026
@jubalh jubalh added the OMEMO label Nov 17, 2026
@jubalh
jubalh merged commit e0fe28e into master Nov 17, 2026
12 checks passed
@jubalh
jubalh deleted the moreomemo branch November 17, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant