Mercurial > p > roundup > code
diff roundup/password.py @ 7163:0b52ee664580
tests are breaking with last commit. Restore a hopefully working tree while I figure out what's going on
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 24 Feb 2023 00:37:37 -0500 |
| parents | cfdcaf8b5936 |
| children | 970cd6d2b8ea |
line wrap: on
line diff
--- a/roundup/password.py Thu Feb 23 19:34:39 2023 -0500 +++ b/roundup/password.py Fri Feb 24 00:37:37 2023 -0500 @@ -190,7 +190,7 @@ if config: rounds = config.PASSWORD_PBKDF2_DEFAULT_ROUNDS else: - rounds = 2000000 + rounds = 10000 if rounds < 1000: raise PasswordValueError("invalid PBKDF2 hash (rounds too low)") raw_digest = pbkdf2(plaintext, raw_salt, rounds, 20) @@ -325,7 +325,7 @@ def __repr__(self): return self.__str__() - def needs_migration(self, config): + def needs_migration(self): """ Password has insecure scheme or other insecure parameters and needs migration to new password scheme """ @@ -334,10 +334,6 @@ rounds, salt, raw_salt, digest = pbkdf2_unpack(self.password) if rounds < 1000: return True - if (self.scheme == "PBKDF2"): - new_rounds = config.PASSWORD_PBKDF2_DEFAULT_ROUNDS - if rounds < int(new_rounds): - return True return False def unpack(self, encrypted, scheme=None, strict=False, config=None):
