Skip to content

Commit

Permalink
Deprecated werkzeug.security.safe_str_cm replaced with hmac.compare_d…
Browse files Browse the repository at this point in the history
…igest (maxcountryman#70)

(cherry picked from commit 14eec93)

maxcountryman#70
  • Loading branch information
msarfati authored and mahenzon committed Jul 24, 2021
1 parent 1a19278 commit dab24b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_bcrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
__copyright__ = '(c) 2011 by Max Countryman, (c) 2021 by Suren Khorenyan'
__all__ = ['Bcrypt', 'check_password_hash', 'generate_password_hash']

from werkzeug.security import safe_str_cmp
import hmac

try:
import bcrypt
Expand Down Expand Up @@ -230,4 +230,4 @@ def check_password_hash(self, pw_hash, password):
password = hashlib.sha256(password).hexdigest()
password = self._unicode_to_bytes(password)

return safe_str_cmp(bcrypt.hashpw(password, pw_hash), pw_hash)
return hmac.compare_digest(bcrypt.hashpw(password, pw_hash), pw_hash)

0 comments on commit dab24b3

Please sign in to comment.