Skip to content

Improve OMEMO - #2258

Merged
jubalh merged 4 commits into
masterfrom
omemoblindtrust
Nov 16, 2026
Merged

jubalh merged 4 commits into
masterfrom
omemoblindtrust

Conversation

@jubalh

@jubalh jubalh commented Nov 16, 2026

Copy link
Copy Markdown
Member

This branch contains a fix from me about reqesting omemo in non omemo MUCs.
And 3 commits by @YHNdnzj from his branch #2225.
I omitted a8db85e for reasons stated on that PR.

I edited refactor(omemo): switch blind trust to _omemo_trust() as well for Glib compliance.

jubalh and others added 4 commits November 16, 2026 16:03
OMEMO session was unconditionally started for every member in a
non-anonymous room, even if OMEMO was disabled for that room.

This caused Profanity to request PubSub devicelists and bundles from the
home servers of all room occupants upon joining plaintext rooms.

When using `trustmode blind`, this resulted in "Blind trust for <jid>
device <id> (<fingerprint>)" notices flooding the console for occupants
in completely unencrypted MUCs, in addition to unnecessary network
traffic and privacy leaks.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Currently, omemo.trustmode=firstusage just causes a bunch of
"OMEMO: No trusted devices found for <JID for contact>" messages
to be emitted in omemo_set_device_list(), without actually adding
trust for them. After some digging, it appears that known_identities
for the jids were never populated, i.e. omemo_start_session() ->
omemo_start_device_session() (via bundle) -> _cache_device_identity()
never got called. Well, as it turned out in omemo_start_session()
the jid match was inverted and hence _handle_device_list_start_session()
isn't correctly stashed... Fix that.

Ref: bac2460
Signed-off-by: Mike Yuan <me@yhndnzj.com>
…r again

omemo_set_device_list() -> _handle_device_list_start_session()
unconditionally invokes omemo_start_session(), even if device_list
is empty, which in turn would enqueue another device list request.
While _omemo_receive_devicelist() shouldn't call into us in that case,
let's make sure the busy loop cannot happen by adding another layer
of protection in the handler.

Signed-off-by: Mike Yuan <me@yhndnzj.com>
Aside from avoiding the meaningless lookup of device_id,
this actually eliminates a duplicate issuance of bundle
-> omemo_start_device_session_handle_bundle().

Ref: 5bf2c5b
Signed-off-by: Mike Yuan <me@yhndnzj.com>
Co-authored-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Nov 16, 2026
@jubalh jubalh self-assigned this Nov 16, 2026
@jubalh jubalh added the OMEMO label Nov 16, 2026
@jubalh
jubalh merged commit 3babdd3 into master Nov 16, 2026
15 of 16 checks passed
@jubalh
jubalh deleted the omemoblindtrust branch November 16, 2026 16:01
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.

2 participants