mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Merge pull request #1102 from paulfariello/fix/malformed-omemo-message
Correctly handle malformed OMEMO messages
This commit is contained in:
commit
6c8acb1a95
@ -851,10 +851,14 @@ omemo_on_message_recv(const char *const from_jid, uint32_t sid,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log_debug("OMEMO: decrypting message with existing session");
|
log_debug("OMEMO: decrypting message with existing session");
|
||||||
signal_message *message;
|
signal_message *message = NULL;
|
||||||
signal_message_deserialize(&message, key->data, key->length, omemo_ctx.signal);
|
res = signal_message_deserialize(&message, key->data, key->length, omemo_ctx.signal);
|
||||||
res = session_cipher_decrypt_signal_message(cipher, message, NULL, &plaintext_key);
|
if (res < 0) {
|
||||||
SIGNAL_UNREF(message);
|
log_error("OMEMO: cannot deserialize message");
|
||||||
|
} else {
|
||||||
|
res = session_cipher_decrypt_signal_message(cipher, message, NULL, &plaintext_key);
|
||||||
|
SIGNAL_UNREF(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session_cipher_free(cipher);
|
session_cipher_free(cipher);
|
||||||
|
Loading…
Reference in New Issue
Block a user