Skip to content

Commit

Permalink
Added test for old Argon2i hashes with version attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo13 authored and felixxm committed Jun 17, 2020
1 parent 78c8113 commit ee49cf4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/auth_tests/test_hashers.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ def test_argon2(self):
)
self.assertTrue(check_password('secret', encoded))
self.assertFalse(check_password('wrong', encoded))
# Old hashes with version attribute.
encoded = (
'argon2$argon2i$v=19$m=8,t=1,p=1$c2FsdHNhbHQ$YC9+jJCrQhs5R6db7LlN8Q'
)
self.assertIs(check_password('secret', encoded), True)
self.assertIs(check_password('wrong', encoded), False)

def test_argon2_upgrade(self):
self._test_argon2_upgrade('time_cost', 'time cost', 1)
Expand Down

0 comments on commit ee49cf4

Please sign in to comment.