diff options
| author | Florian Apolloner <florian@apolloner.eu> | 2020-06-17 08:07:10 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-06-17 08:10:41 +0200 |
| commit | 1621f06051c94665f2edf492c10316875896e7eb (patch) | |
| tree | d3dc00b9253a1b67df7aa92456885a255e23ee03 /tests/auth_tests | |
| parent | faad809e09af5617f1cda579f5b031233be21cb3 (diff) | |
Fixed #30472 -- Made Argon2PasswordHasher use Argon2id.
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/test_hashers.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auth_tests/test_hashers.py b/tests/auth_tests/test_hashers.py index 5ca422764b..fa7332970a 100644 --- a/tests/auth_tests/test_hashers.py +++ b/tests/auth_tests/test_hashers.py @@ -497,13 +497,13 @@ class TestUtilsHashPassArgon2(SimpleTestCase): def test_argon2(self): encoded = make_password('lètmein', hasher='argon2') self.assertTrue(is_password_usable(encoded)) - self.assertTrue(encoded.startswith('argon2$')) + self.assertTrue(encoded.startswith('argon2$argon2id$')) self.assertTrue(check_password('lètmein', encoded)) self.assertFalse(check_password('lètmeinz', encoded)) self.assertEqual(identify_hasher(encoded).algorithm, 'argon2') # Blank passwords blank_encoded = make_password('', hasher='argon2') - self.assertTrue(blank_encoded.startswith('argon2$')) + self.assertTrue(blank_encoded.startswith('argon2$argon2id$')) self.assertTrue(is_password_usable(blank_encoded)) self.assertTrue(check_password('', blank_encoded)) self.assertFalse(check_password(' ', blank_encoded)) @@ -523,15 +523,15 @@ class TestUtilsHashPassArgon2(SimpleTestCase): def test_argon2_upgrade(self): self._test_argon2_upgrade('time_cost', 'time cost', 1) - self._test_argon2_upgrade('memory_cost', 'memory cost', 16) + self._test_argon2_upgrade('memory_cost', 'memory cost', 64) self._test_argon2_upgrade('parallelism', 'parallelism', 1) def test_argon2_version_upgrade(self): hasher = get_hasher('argon2') state = {'upgraded': False} encoded = ( - 'argon2$argon2i$m=8,t=1,p=1$c29tZXNhbHQ$gwQOXSNhxiOxPOA0+PY10P9QFO' - '4NAYysnqRt1GSQLE55m+2GYDt9FEjPMHhP2Cuf0nOEXXMocVrsJAtNSsKyfg' + 'argon2$argon2id$v=19$m=102400,t=2,p=8$Y041dExhNkljRUUy$TMa6A8fPJh' + 'CAUXRhJXCXdw' ) def setter(password): |
