diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2018-03-06 11:56:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-06 11:56:06 +0000 |
commit | 8ffaacbee372876a6714059e962e79af92c44bd0 (patch) | |
tree | 6a1d25bffb60a962eb50b35be6a398c25dd1447f /synapse/handlers | |
parent | Merge pull request #2946 from matrix-org/rav/timestamp_to_purge (diff) | |
parent | use bcrypt.checkpw (diff) | |
download | synapse-8ffaacbee372876a6714059e962e79af92c44bd0.tar.xz |
Merge pull request #2949 from krombel/use_bcrypt_checkpw
use bcrypt.checkpw
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/auth.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index 258cc345dc..a5365c4fe4 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -863,8 +863,10 @@ class AuthHandler(BaseHandler): """ def _do_validate_hash(): - return bcrypt.hashpw(password.encode('utf8') + self.hs.config.password_pepper, - stored_hash.encode('utf8')) == stored_hash + return bcrypt.checkpw( + password.encode('utf8') + self.hs.config.password_pepper, + stored_hash.encode('utf8') + ) if stored_hash: return make_deferred_yieldable(threads.deferToThread(_do_validate_hash)) |