1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

Merge remote-tracking branch 'php-src/PHP-7.2' into PHP-7.2

This commit is contained in:
Nikita Popov
2017-11-28 23:37:05 +01:00
+15 -17
View File
@@ -1853,13 +1853,11 @@ PHP_FUNCTION(sodium_crypto_pwhash)
return;
}
if (opslimit < crypto_pwhash_OPSLIMIT_MIN) {
zend_throw_exception(sodium_exception_ce,
"number of operations for the password hashing function is too low", 0);
return;
zend_error(E_ERROR,
"number of operations for the password hashing function is too low");
}
if (memlimit < crypto_pwhash_MEMLIMIT_MIN) {
zend_throw_exception(sodium_exception_ce,
"maximum memory for the password hashing function is too low", 0);
zend_error(E_ERROR, "maximum memory for the password hashing function is too low");
}
hash = zend_string_alloc((size_t) hash_len, 0);
ret = -1;
@@ -1918,12 +1916,12 @@ PHP_FUNCTION(sodium_crypto_pwhash_str)
zend_error(E_WARNING, "empty password");
}
if (opslimit < crypto_pwhash_OPSLIMIT_MIN) {
zend_throw_exception(sodium_exception_ce,
"number of operations for the password hashing function is too low", 0);
zend_error(E_ERROR,
"number of operations for the password hashing function is too low");
}
if (memlimit < crypto_pwhash_MEMLIMIT_MIN) {
zend_throw_exception(sodium_exception_ce,
"maximum memory for the password hashing function is too low", 0);
zend_error(E_ERROR,
"maximum memory for the password hashing function is too low");
}
hash_str = zend_string_alloc(crypto_pwhash_STRBYTES - 1, 0);
if (crypto_pwhash_str
@@ -2032,12 +2030,12 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256)
return;
}
if (opslimit < crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE) {
zend_throw_exception(sodium_exception_ce,
"number of operations for the scrypt function is too low", 0);
zend_error(E_ERROR,
"number of operations for the scrypt function is too low");
}
if (memlimit < crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE) {
zend_throw_exception(sodium_exception_ce,
"maximum memory for the scrypt function is too low", 0);
zend_error(E_ERROR,
"maximum memory for the scrypt function is too low");
}
hash = zend_string_alloc((size_t) hash_len, 0);
if (crypto_pwhash_scryptsalsa208sha256
@@ -2079,12 +2077,12 @@ PHP_FUNCTION(sodium_crypto_pwhash_scryptsalsa208sha256_str)
zend_error(E_WARNING, "empty password");
}
if (opslimit < crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE) {
zend_throw_exception(sodium_exception_ce,
"number of operations for the scrypt function is too low", 0);
zend_error(E_ERROR,
"number of operations for the scrypt function is too low");
}
if (memlimit < crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE) {
zend_throw_exception(sodium_exception_ce,
"maximum memory for the scrypt function is too low", 0);
zend_error(E_ERROR,
"maximum memory for the scrypt function is too low");
}
hash_str = zend_string_alloc
(crypto_pwhash_scryptsalsa208sha256_STRBYTES - 1, 0);