ignore unknown ascii symbols with password check. to be rewritten

This commit is contained in:
deflax 2016-07-03 02:50:00 +03:00
parent 9aeb412ca0
commit 80475657bd

View file

@ -95,8 +95,8 @@ def validate(clientemail, password):
#2. check the password #2. check the password
encpass = clientsdb[c_id]['encpasswd'] encpass = clientsdb[c_id]['encpasswd']
b_srvpass = password.encode('ascii') b_srvpass = password.encode('ascii', 'ignore')
b_encpass = encpass.encode('ascii') b_encpass = encpass.encode('ascii', 'ignore')
if (hmac.compare_digest(bcrypt.hashpw(b_srvpass, b_encpass), b_encpass)): if (hmac.compare_digest(bcrypt.hashpw(b_srvpass, b_encpass), b_encpass)):
#login successful #login successful