mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
chore: Increase rounds for hashing recovery codes in UIDatabase
Increase the number of rounds for hashing recovery codes in the `UIDatabase` class to improve security.
This commit is contained in:
parent
c590f51944
commit
2b93efda57
1 changed files with 2 additions and 2 deletions
|
|
@ -216,7 +216,7 @@ class UIDatabase(Database):
|
|||
)
|
||||
|
||||
for code in totp_recovery_codes or []:
|
||||
session.add(UserRecoveryCodes(user_name=username, code=hashpw(code.encode("utf-8"), gensalt(rounds=8)).decode("utf-8")))
|
||||
session.add(UserRecoveryCodes(user_name=username, code=hashpw(code.encode("utf-8"), gensalt(rounds=10)).decode("utf-8")))
|
||||
|
||||
try:
|
||||
session.commit()
|
||||
|
|
@ -358,7 +358,7 @@ class UIDatabase(Database):
|
|||
session.query(UserRecoveryCodes).filter_by(user_name=username).delete()
|
||||
|
||||
for code in codes:
|
||||
session.add(UserRecoveryCodes(user_name=username, code=hashpw(code.encode("utf-8"), gensalt(rounds=8)).decode("utf-8")))
|
||||
session.add(UserRecoveryCodes(user_name=username, code=hashpw(code.encode("utf-8"), gensalt(rounds=10)).decode("utf-8")))
|
||||
|
||||
try:
|
||||
session.commit()
|
||||
|
|
|
|||
Loading…
Reference in a new issue