Merge pull request #8428

7a31d25 keccak: error out if passed mdlen 100 (moneromooo-monero)
This commit is contained in:
luigi1111 2022-08-22 22:45:59 -05:00
commit 53a8cf7f8c
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

@ -123,7 +123,7 @@ void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
size_t i, rsiz, rsizw;
static_assert(HASH_DATA_AREA <= sizeof(temp), "Bad keccak preconditions");
if (mdlen <= 0 || (mdlen > 100 && sizeof(st) != (size_t)mdlen))
if (mdlen <= 0 || (mdlen >= 100 && sizeof(st) != (size_t)mdlen))
{
local_abort("Bad keccak use");
}