From 82527f7435a050d2d2d61aed7ccd1cb81aaed3d7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 4 Jun 2021 08:53:03 +0200 Subject: [PATCH 1/2] password_hash: don't fail on unsupported threads value As this is only about how hash is computed (in other implementation) and have no effect on result. This will improve code compatibility for the various implementations --- ext/sodium/sodium_pwhash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/sodium/sodium_pwhash.c b/ext/sodium/sodium_pwhash.c index 2b284c711685a..933932c07682d 100644 --- a/ext/sodium/sodium_pwhash.c +++ b/ext/sodium/sodium_pwhash.c @@ -65,8 +65,7 @@ static inline int get_options(zend_array *options, size_t *memlimit, size_t *ops } } if ((opt = zend_hash_str_find(options, "threads", strlen("threads"))) && (zval_get_long(opt) != 1)) { - php_error_docref(NULL, E_WARNING, "A thread value other than 1 is not supported by this implementation"); - return FAILURE; + php_error_docref(NULL, E_NOTICE, "A thread value other than 1 is not supported by this implementation"); } return SUCCESS; } From 0474074f64d1a8e477a6669b63b565d017aa00af Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 4 Jun 2021 09:18:03 +0200 Subject: [PATCH 2/2] remove the check --- ext/sodium/sodium_pwhash.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/ext/sodium/sodium_pwhash.c b/ext/sodium/sodium_pwhash.c index 933932c07682d..4a453255e2736 100644 --- a/ext/sodium/sodium_pwhash.c +++ b/ext/sodium/sodium_pwhash.c @@ -64,9 +64,6 @@ static inline int get_options(zend_array *options, size_t *memlimit, size_t *ops return FAILURE; } } - if ((opt = zend_hash_str_find(options, "threads", strlen("threads"))) && (zval_get_long(opt) != 1)) { - php_error_docref(NULL, E_NOTICE, "A thread value other than 1 is not supported by this implementation"); - } return SUCCESS; }