diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2018-04-18 21:10:26 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-05-08 22:26:23 +0200 |
commit | 2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59 (patch) | |
tree | 228de86d6b5c19562e9e7469f3c5c1b898422fd7 /tests/passwords | |
parent | 5153413f7afd612b68cc70d93548977c99589fbb (diff) | |
download | forums-2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59.tar forums-2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59.tar.gz forums-2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59.tar.bz2 forums-2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59.tar.xz forums-2ff5871ff4695f8f5f5aa23126c9ea253b6f4d59.zip |
[ticket/15646] Added support for Argon2i passwords
PHPBB3-15646
Diffstat (limited to 'tests/passwords')
-rw-r--r-- | tests/passwords/drivers_test.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php index 01c69a38bb..300c093f12 100644 --- a/tests/passwords/drivers_test.php +++ b/tests/passwords/drivers_test.php @@ -23,6 +23,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case $php_ext = 'php'; $this->passwords_drivers = array( + 'passwords.driver.argon2i' => new \phpbb\passwords\driver\argon2i($config, $this->driver_helper), 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $this->driver_helper, 10), 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $this->driver_helper, 10), 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $this->driver_helper), @@ -422,6 +423,10 @@ class phpbb_passwords_helper_test extends \phpbb_test_case array('passwords.driver.salted_md5', 'foobar', false), array('passwords.driver.bcrypt_2y', '$2y$9$somerandomhash', true), array('passwords.driver.bcrypt', '$2a$04$somerandomhash', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=2$NEF0S1JSN04yNGQ1UVRKdA$KYGNI9CbjoKh1UEu1PpdlqbuLbveGwkMcwcT2Un9pPM', false), + array('passwords.driver.argon2i', '$argon2i$v=19$m=128,t=2,p=2$M29GUi51QjdKLjIzbC9scQ$6h1gZDqn7JTmVdQ0lJh1x5nyvgO/DaJWUKOFJ0itCJ0', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=1,p=2$UnFHb2F4NER3M0xWWmxMUQ$u3javvoAZJeIyR1P3eg0tb8VjEeXvQPagqwetonq1NA', true), + array('passwords.driver.argon2i', '$argon2i$v=19$m=1024,t=2,p=1$bm5SeGJ3R3ZRY1A0YXJPNg$v1A9m4sJW+ge0RBtpJ4w9861+J9xkguKBAsZHrG8LQU', true), ); } @@ -430,6 +435,10 @@ class phpbb_passwords_helper_test extends \phpbb_test_case */ public function test_needs_rehash($driver, $hash, $expected) { - $this->assertSame($this->passwords_drivers[$driver]->needs_rehash($hash), $expected); + if (!$this->passwords_drivers[$driver]->is_supported()) + { + $this->markTestSkipped($driver . ' is not supported'); + } + $this->assertSame($expected, $this->passwords_drivers[$driver]->needs_rehash($hash)); } } |