Merge pull request #1686 from Arvedui/fix_rounds_parameter

fix regression that caused the rounds parameter to be ignored
This commit is contained in:
Antoine Nguyen
2019-03-01 12:11:51 +01:00
committed by GitHub
+3 -6
View File
@@ -36,8 +36,7 @@ class BLFCRYPTHasher(PasswordHasher):
# rounds = parameters.get_global_parameter("rounds_number")
# To get around this, I use the default of 12.
rounds = 12
bcrypt.using(rounds=rounds)
return bcrypt.hash(clearvalue)
return bcrypt.hash(clearvalue, rounds=rounds)
def verify(self, clearvalue, hashed_value):
return bcrypt.verify(clearvalue, hashed_value)
@@ -82,8 +81,7 @@ class SHA256CRYPTHasher(PasswordHasher):
def _encrypt(self, clearvalue, salt=None):
rounds = param_tools.get_global_parameter("rounds_number")
sha256_crypt.using(rounds=rounds)
return sha256_crypt.hash(clearvalue)
return sha256_crypt.hash(clearvalue, rounds=rounds)
def verify(self, clearvalue, hashed_value):
return sha256_crypt.verify(clearvalue, hashed_value)
@@ -106,8 +104,7 @@ class SHA512CRYPTHasher(PasswordHasher):
def _encrypt(self, clearvalue, salt=None):
rounds = param_tools.get_global_parameter("rounds_number")
sha512_crypt.using(rounds=rounds)
return sha512_crypt.hash(clearvalue)
return sha512_crypt.hash(clearvalue, rounds=rounds)
def verify(self, clearvalue, hashed_value):
return sha512_crypt.verify(clearvalue, hashed_value)