1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:24:49 +02:00

Respect BCRYPT_ROUNDS from the environment in anope-mkpasswd.

This commit is contained in:
Sadie Powell
2026-06-08 08:58:15 +01:00
parent c32be6a711
commit 745e94783d
+2 -1
View File
@@ -51,7 +51,8 @@ def do_argon2(variant, password):
return ph.hash(password)
def do_bcrypt(password):
salt = bcrypt.gensalt(16)
rounds = int(os.getenv("BCRYPT_ROUNDS", 10))
salt = bcrypt.gensalt(rounds)
return bcrypt.hashpw(password.encode('utf-8'), salt).decode('utf-8')
def do_hmac(digest, password):