diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-11 12:06:02 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-11 12:06:02 +0100 |
commit | 1400bb1663657565be9e3051058a3af8ac02de96 (patch) | |
tree | 22e866a70f9048bff6c7609d69f8e33eb7978f28 /synapse | |
parent | Pass through _get_state_group_for_events (diff) | |
download | synapse-1400bb1663657565be9e3051058a3af8ac02de96.tar.xz |
Correctly handle NULL password hashes from the database
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/auth.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index 61fe56032a..6e7d080ecc 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -615,4 +615,7 @@ class AuthHandler(BaseHandler): Returns: Whether self.hash(password) == stored_hash (bool). """ - return bcrypt.hashpw(password, stored_hash) == stored_hash + if stored_hash: + return bcrypt.hashpw(password, stored_hash) == stored_hash + else: + return False |