Merge pull request #1191 from matrix-org/dbkr/non_ascii_passwords

Don't error on non-ascii passwords
This commit is contained in:
David Baker 2016-11-03 11:21:07 +00:00 committed by GitHub
commit 9164bfa1c3
1 changed files with 1 additions and 1 deletions

View File

@ -653,7 +653,7 @@ class AuthHandler(BaseHandler):
Returns: Returns:
Hashed password (str). Hashed password (str).
""" """
return bcrypt.hashpw(password + self.hs.config.password_pepper, return bcrypt.hashpw(password.encode('utf8') + self.hs.config.password_pepper,
bcrypt.gensalt(self.bcrypt_rounds)) bcrypt.gensalt(self.bcrypt_rounds))
def validate_hash(self, password, stored_hash): def validate_hash(self, password, stored_hash):