mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 07:52:25 +00:00
keccak: fix mdlen bounds sanity checking
found by h908714124
This commit is contained in:
parent
2e3e90acbe
commit
e4646379a6
1 changed files with 2 additions and 1 deletions
|
@ -81,7 +81,8 @@ void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
|
||||||
uint8_t temp[144];
|
uint8_t temp[144];
|
||||||
size_t i, rsiz, rsizw;
|
size_t i, rsiz, rsizw;
|
||||||
|
|
||||||
if (mdlen <= 0 || mdlen > 200 || sizeof(st) != 200)
|
static_assert(HASH_DATA_AREA <= sizeof(temp), "Bad keccak preconditions");
|
||||||
|
if (mdlen <= 0 || (mdlen > 100 && sizeof(st) != (size_t)mdlen))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Bad keccak use");
|
fprintf(stderr, "Bad keccak use");
|
||||||
abort();
|
abort();
|
||||||
|
|
Loading…
Reference in a new issue