Browse Source

Add comment about ECB path failure

pull/1677/head
Wessel Nieboer 6 months ago
parent
commit
fc3eb1ecb4
No known key found for this signature in database GPG Key ID: 929C8E45E33B5FD2
  1. 4
      src/Utils.cpp

4
src/Utils.cpp

@ -85,7 +85,9 @@ int Utils::MACThenDecrypt(const uint8_t* shared_secret, uint8_t* dest, const uin
if (memcmp(hmac, src, CIPHER_MAC_SIZE) == 0) {
return decrypt(shared_secret, dest, src + CIPHER_MAC_SIZE, src_len - CIPHER_MAC_SIZE);
}
return 0; // invalid HMAC
// No need to zero dest on failure — MAC is checked before decryption,
// so dest is never written to when authentication fails.
return 0;
}
/*

Loading…
Cancel
Save