Skip to content
Snippets Groups Projects
Unverified Commit e03d9088 authored by Shamil K Muhammed's avatar Shamil K Muhammed
Browse files

Use unicode for encrypted_pass

Check password fails when a non-ascii character is in the password.
Fixed that
parent 844f68d7
Branches
Tags
No related merge requests found
......@@ -22,13 +22,13 @@ import bcrypt
import logging
__VERSION__ = "0.0.6"
__VERSION__ = "0.0.7"
logger = logging.getLogger(__name__)
class DiasporaAuthProvider:
__version__ = "0.0.6"
__version__ = "0.0.7"
def __init__(self, config, account_handler):
self.account_handler = account_handler
......@@ -74,7 +74,7 @@ class DiasporaAuthProvider:
logger.debug("User {} exists. Checking password".format(local_part))
# user exists, check if the password is correct.
encrypted_password = user[1]
peppered_pass = "{}{}".format(password, self.config.pepper)
peppered_pass = u"{}{}".format(password, self.config.pepper)
if not (bcrypt.hashpw(peppered_pass.encode('utf8'), encrypted_password.encode('utf8'))
== encrypted_password.encode('utf8')):
logger.info("Password given for {} is wrong. Rejecting auth request.".format(local_part))
......
psycopg2
bcrypt
Twisted>=15.1.0
\ No newline at end of file
pymysql
Twisted>=15.1.0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment