com php-src: Revert "ext/sodium: throw exceptions instead of errors": ext/sodium/libsodium.c
| From: | Frank Denis | Date: | Tue, 28 Nov 2017 22:30:21 +0000 |
| Subject: | com php-src: Revert "ext/sodium: throw exceptions instead of errors": ext/sodium/libsodium.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100427@lists.php.net to get a copy of this message | ||
Commit: 31d221f9c72f0d0322c84907c5d89a4464667244
Author: Frank Denis <github@pureftpd.org> Tue, 28 Nov 2017 23:30:21 +0100
Parents: 0b3046176403c5a32946ccc426d023df019a483b
Branches: PHP-7.2
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=31d221f9c72f0d0322c84907c5d89a4464667244
Log:
Revert "ext/sodium: throw exceptions instead of errors"
This reverts commit c05cbd1e775fa69ed9939796a908390f2bfb4459.
Changed paths:
M ext/sodium/libsodium.c
Diff:
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index a9cb17d..f08a272 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -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);