com php-src: ext/sodium: fix pwhash_argon2i test: ext /sodium/tests/pwhash_argon2i.phpt
| From: | Frank Denis | Date: | Sun, 01 Oct 2017 14:00:41 +0000 |
| Subject: | com php-src: ext/sodium: fix pwhash_argon2i test: ext /sodium/tests/pwhash_argon2i.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99589@lists.php.net to get a copy of this message | ||
Commit: 0663ca135d6f0572437f1fc4fb4d6e6120cac2bd
Author: Frank Denis <github@pureftpd.org> Sun, 1 Oct 2017 16:00:41 +0200
Parents: 92ceb64faf27e5bf7a9684d945fa30a7b602c086
Branches: PHP-7.2
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0663ca135d6f0572437f1fc4fb4d6e6120cac2bd
Log:
ext/sodium: fix pwhash_argon2i test
Changed paths:
M ext/sodium/tests/pwhash_argon2i.phpt
Diff:
diff --git a/ext/sodium/tests/pwhash_argon2i.phpt b/ext/sodium/tests/pwhash_argon2i.phpt
index 2161268..5f3c88a 100644
--- a/ext/sodium/tests/pwhash_argon2i.phpt
+++ b/ext/sodium/tests/pwhash_argon2i.phpt
@@ -10,14 +10,14 @@ $passwd = 'password';
$hash = sodium_crypto_pwhash_str
($passwd, SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE);
-var_dump(substr($hash, 0, 9) ===
+var_dump(substr($hash, 0, strlen(SODIUM_CRYPTO_PWHASH_STRPREFIX)) ===
SODIUM_CRYPTO_PWHASH_STRPREFIX);
$testHash =
'$argon2i$v=19$m=4096,t=3,p=1$MzE4ODFiZWFlMjAzOWUAAA$FWUV6tsyJ32qThiLi1cCsLIbf3dIOG/RwXcTzt536KY';
$c = sodium_crypto_pwhash_str_verify($testHash, $passwd);
var_dump($c);
-$testHash =
'$argon2i$v=19$m=4096,t=2,p=1$c29tZXNhbHQAAAAAAAAAAA$JTBozgKQiCn5yKAm3Hz0vUSX/XgfqhZloNCxDWmeDr0';
+$testHash =
'$argon2i$v=19$m=4096,t=0,p=1$c29tZXNhbHQAAAAAAAAAAA$JTBozgKQiCn5yKAm3Hz0vUSX/XgfqhZloNCxDWmeDr0';
$c = sodium_crypto_pwhash_str_verify($testHash, $passwd);
var_dump($c);