We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71469d1 commit 50af9ebCopy full SHA for 50af9eb
1 file changed
src/Utils.cpp
@@ -85,7 +85,9 @@ int Utils::MACThenDecrypt(const uint8_t* shared_secret, uint8_t* dest, const uin
85
if (memcmp(hmac, src, CIPHER_MAC_SIZE) == 0) {
86
return decrypt(shared_secret, dest, src + CIPHER_MAC_SIZE, src_len - CIPHER_MAC_SIZE);
87
}
88
- return 0; // invalid HMAC
+ // 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;
91
92
93
/*
0 commit comments