mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
sodium ext: check hash length for scrypt
This commit is contained in:
parent
3f45262aa9
commit
74d7f1d04e
@ -1670,7 +1670,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256)
|
||||
&passwd, &passwd_len,
|
||||
&salt, &salt_len,
|
||||
&opslimit, &memlimit) == FAILURE ||
|
||||
hash_len <= 0 || hash_len >= SIZE_MAX ||
|
||||
hash_len <= 0 || hash_len >= SIZE_MAX || hash_len > 0x1fffffffe0ULL ||
|
||||
opslimit <= 0 || memlimit <= 0 || memlimit > SIZE_MAX) {
|
||||
zend_throw_exception(sodium_exception_ce, "invalid parameters", 0);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user