mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 19:36:20 +00:00
Merge pull request #2147 from balejk/omemo-heartbeats-fix
omemo: ignore key contents if there is no payload
This commit is contained in:
@@ -1141,6 +1141,12 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (payload == NULL) {
|
||||||
|
signal_buffer_free(plaintext_key);
|
||||||
|
*error = OMEMO_ERR_KEY_TRANSPORT;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (signal_buffer_len(plaintext_key) != AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH) {
|
if (signal_buffer_len(plaintext_key) != AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH) {
|
||||||
log_error("[OMEMO][RECV] invalid key length");
|
log_error("[OMEMO][RECV] invalid key length");
|
||||||
signal_buffer_free(plaintext_key);
|
signal_buffer_free(plaintext_key);
|
||||||
@@ -1148,12 +1154,6 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload == NULL) {
|
|
||||||
signal_buffer_free(plaintext_key);
|
|
||||||
*error = OMEMO_ERR_KEY_TRANSPORT;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t plaintext_len = payload_len;
|
size_t plaintext_len = payload_len;
|
||||||
plaintext = malloc(plaintext_len + 1);
|
plaintext = malloc(plaintext_len + 1);
|
||||||
res = aes128gcm_decrypt(plaintext, &plaintext_len, payload, payload_len, iv,
|
res = aes128gcm_decrypt(plaintext, &plaintext_len, payload, payload_len, iv,
|
||||||
|
|||||||
Reference in New Issue
Block a user