Skip to content

Commit 50af9eb

Browse files
committed
Add comment about ECB path failure
1 parent 71469d1 commit 50af9eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Utils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ int Utils::MACThenDecrypt(const uint8_t* shared_secret, uint8_t* dest, const uin
8585
if (memcmp(hmac, src, CIPHER_MAC_SIZE) == 0) {
8686
return decrypt(shared_secret, dest, src + CIPHER_MAC_SIZE, src_len - CIPHER_MAC_SIZE);
8787
}
88-
return 0; // invalid HMAC
88+
// No need to zero dest on failure — MAC is checked before decryption,
89+
// so dest is never written to when authentication fails.
90+
return 0;
8991
}
9092

9193
/*

0 commit comments

Comments
 (0)