Skip to content

Commit 35ae21e

Browse files
committed
Use bcrypt's built-in function for checking the password hash
1 parent d906452 commit 35ae21e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flask_bcrypt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,5 @@ def check_password_hash(self, pw_hash, password):
221221
if self._handle_long_passwords:
222222
password = hashlib.sha256(password).hexdigest()
223223
password = self._unicode_to_bytes(password)
224-
225-
return hmac.compare_digest(bcrypt.hashpw(password, pw_hash), pw_hash)
224+
225+
return bcrypt.checkpw(password, pw_hash)

0 commit comments

Comments
 (0)