Skip to content

Commit 1ac0575

Browse files
authored
Merge pull request #2147 from balejk/omemo-heartbeats-fix
omemo: ignore key contents if there is no payload
2 parents 95eb1ef + 1458b09 commit 1ac0575

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/omemo/omemo.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,16 +1141,16 @@ omemo_on_message_recv(const char* const from_jid, uint32_t sid,
11411141
return NULL;
11421142
}
11431143

1144-
if (signal_buffer_len(plaintext_key) != AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH) {
1145-
log_error("[OMEMO][RECV] invalid key length");
1144+
if (payload == NULL) {
11461145
signal_buffer_free(plaintext_key);
1147-
*error = OMEMO_ERR_DECRYPT_FAILED;
1146+
*error = OMEMO_ERR_KEY_TRANSPORT;
11481147
return NULL;
11491148
}
11501149

1151-
if (payload == NULL) {
1150+
if (signal_buffer_len(plaintext_key) != AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH) {
1151+
log_error("[OMEMO][RECV] invalid key length");
11521152
signal_buffer_free(plaintext_key);
1153-
*error = OMEMO_ERR_KEY_TRANSPORT;
1153+
*error = OMEMO_ERR_DECRYPT_FAILED;
11541154
return NULL;
11551155
}
11561156

0 commit comments

Comments
 (0)