com php-src: sodium ext: check hash length for scrypt: ext/sodium/libsodium.c
| From: | Frank Denis | Date: | Sun, 30 Jul 2017 13:00:03 +0000 |
| Subject: | com php-src: sodium ext: check hash length for scrypt: ext/sodium/libsodium.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98867@lists.php.net to get a copy of this message | ||
Commit: 74d7f1d04ed12205ec43fd5fc20cde8d2288570d
Author: Frank Denis <github@pureftpd.org> Sun, 30 Jul 2017 15:00:03 +0200
Parents: 3f45262aa99356d098dfe0117e063b574b6d7395
Branches: PHP-7.2
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=74d7f1d04ed12205ec43fd5fc20cde8d2288570d
Log:
sodium ext: check hash length for scrypt
Changed paths:
M ext/sodium/libsodium.c
Diff:
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index 4a7453a..6024d8d 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -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;