Skip to content

Commit

Permalink
OmemoManager: Remove private fallback markers before serializing
Browse files Browse the repository at this point in the history
This is needed to avoid that private markers leak into the public parts
of the message.
  • Loading branch information
lnjX committed Aug 18, 2024
1 parent e474da0 commit e5b1260
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/omemo/QXmppOmemoManager_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,11 @@ QXmppTask<QXmppE2eeExtension::MessageEncryptResult> ManagerPrivate::encryptMessa
// Whether to advise the server to store other kinds of messages is up to the
// client.
// That facilitates a consistent handling of message processing hints.

// reset fallback markers: they are serialized in both public and private modes,
// so this is needed to avoid leaking sensitive content
message.setFallbackMarkers({});

if (!message.body().isEmpty() || message.trustMessageElement()) {
QXmppFallback fallback { ns_omemo_2.toString(), { { QXmppFallback::Body, {} } } };

Expand Down

0 comments on commit e5b1260

Please sign in to comment.