summary refs log tree commit diff
path: root/synapse/handlers/auth.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-12-11 12:32:49 +0000
committerGitHub <noreply@github.com>2020-12-11 12:32:49 +0000
commit8a02d38ce274db40e5629c882af1fefdb8c9adc3 (patch)
treee596b61537bcf690c00720d763e6bd30e8f64f5c /synapse/handlers/auth.py
parentOverride any missing default power level keys with DINUM's defaults when crea... (diff)
downloadsynapse-8a02d38ce274db40e5629c882af1fefdb8c9adc3.tar.xz
Update mypy to 0.790 to resolve mypy CI errors (#72)
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r--synapse/handlers/auth.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py

index 00eae92052..8770e43635 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py
@@ -1115,20 +1115,22 @@ class AuthHandler(BaseHandler): Whether self.hash(password) == stored_hash. """ - def _do_validate_hash(): + def _do_validate_hash(checked_hash: bytes): # Normalise the Unicode in the password pw = unicodedata.normalize("NFKC", password) return bcrypt.checkpw( pw.encode("utf8") + self.hs.config.password_pepper.encode("utf8"), - stored_hash, + checked_hash, ) if stored_hash: if not isinstance(stored_hash, bytes): stored_hash = stored_hash.encode("ascii") - return await defer_to_thread(self.hs.get_reactor(), _do_validate_hash) + return await defer_to_thread( + self.hs.get_reactor(), _do_validate_hash, stored_hash + ) else: return False