Skip to content

Commit 74d7f1d

Browse files
committed
sodium ext: check hash length for scrypt
1 parent 3f45262 commit 74d7f1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/sodium/libsodium.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256)
16701670
&passwd, &passwd_len,
16711671
&salt, &salt_len,
16721672
&opslimit, &memlimit) == FAILURE ||
1673-
hash_len <= 0 || hash_len >= SIZE_MAX ||
1673+
hash_len <= 0 || hash_len >= SIZE_MAX || hash_len > 0x1fffffffe0ULL ||
16741674
opslimit <= 0 || memlimit <= 0 || memlimit > SIZE_MAX) {
16751675
zend_throw_exception(sodium_exception_ce, "invalid parameters", 0);
16761676
return;

0 commit comments

Comments
 (0)