Skip to content

omemo: ignore key contents if there is no payload#2147

Merged
jubalh merged 1 commit intoprofanity-im:masterfrom
balejk:omemo-heartbeats-fix
Apr 9, 2026
Merged

omemo: ignore key contents if there is no payload#2147
jubalh merged 1 commit intoprofanity-im:masterfrom
balejk:omemo-heartbeats-fix

Conversation

@balejk
Copy link
Copy Markdown
Contributor

@balejk balejk commented Apr 8, 2026

For key transport messages, Monal at least doesn't append the
authentication tag to the plaintext key contents as that only makes
sense if the key was used to encrypt something. This causes the key
length check to fail and show the

OMEMO message received but decryption failed.

error to the user which is confusing because there is no user-originated
message involved.

Skip the length check for key transport messages as profanity only uses
these to advance the ratchet and makes no use of the decrypted contents.


  • I ran valgrind when using my new feature

How to test the functionality

I have not tested this as I know of no straightforward way to do so but it makes sense to me based on what I was able to find out. I suppose it could be tested by triggering an incoming heartbeat message by sending enough outgoing messages but it should also become apparent if it works over time based on whether the error still appears (right now with 0.17.0 I am seeing on average one every one or two days).

Copy link
Copy Markdown
Member

@jubalh jubalh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'll review in detail later today. For now: Could you please change the commit message from omemo: ignore key contents if there is no payload to fix(omemo): ignore key contents if there is no payload or fix: ignore omemo key contents if there is no payload.
The reason for this is that we currently use the commit messages to generate the changelog entries. So the first word is about being fix/feature etc. Also see CONTRIBUTING.md for details :)

@jubalh jubalh added this to the 0.18.0 milestone Apr 9, 2026
For key transport messages, Monal at least doesn't append the
authentication tag to the plaintext key contents as that only makes
sense if the key was used to encrypt something. This causes the key
length check to fail and show the

	OMEMO message received but decryption failed.

error to the user which is confusing because there is no user-originated
message involved.

Skip the length check for key transport messages as profanity only uses
these to advance the ratchet and makes no use of the decrypted contents.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
@balejk balejk force-pushed the omemo-heartbeats-fix branch from 2c266df to 1458b09 Compare April 9, 2026 07:54
@jubalh jubalh merged commit 1ac0575 into profanity-im:master Apr 9, 2026
12 checks passed
@jubalh
Copy link
Copy Markdown
Member

jubalh commented Apr 9, 2026

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants