Merge pull request #88 from andreev-artem/develop

Password should be encoded as 'utf-8' before creating hmac to support passwords with non-latin symbols
This commit is contained in:
Matt Wright
2013-02-03 12:12:04 -08:00
+1 -1
View File
@@ -78,7 +78,7 @@ def get_hmac(password):
'must not be None when the value of `SECURITY_PASSWORD_HASH` is '
'set to "%s"' % _security.password_hash)
h = hmac.new(_security.password_salt, password, hashlib.sha512)
h = hmac.new(_security.password_salt, password.encode('utf-8'), hashlib.sha512)
return base64.b64encode(h.digest())