Repository navigation
Improve OMEMO - #2258
Merged
Merged
Improve OMEMO#2258
Conversation
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>
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.