summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-08-25 08:53:25 +0200
committerAleš Smodiš <aless@guru.si>2015-08-25 08:53:25 +0200
commit816d11b6e238e389f84430196bed19d66f49d751 (patch)
tree392e499f1a8b802f69e3750aa1cfdebe88c81e76
parenta4f639242f9f6221a486e0e91adeb75ba6096f45 (diff)
Fix a typo.
-rw-r--r--server/user_session.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/user_session.py b/server/user_session.py
index e418f8d..b12d6f1 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -97,7 +97,7 @@ def verify_password(plain_password, encrypted_password):
elts = encrypted_password.split('$')
if len(elts) != 4:
return False
- if elts[0] != 'pkbdf2_sha256':
+ if elts[0] != 'pbkdf2_sha256':
return False
try:
rounds = int(elts[1])
@@ -115,7 +115,7 @@ def encrypt_password(plain_password):
chosen_chars.append(_salt_chars[random.randrange(0, _salt_chars_len)])
salt = ''.join(chosen_chars)
enc = hashlib.pbkdf2_hmac('sha256', plain_password.encode('utf-8'), salt.encode('utf-8'), rounds)
- return '{0}${1}${2}${3}'.format('pkbdf2_sha256', rounds, salt, base64.b64encode(enc).decode('utf-8'))
+ return '{0}${1}${2}${3}'.format('pbkdf2_sha256', rounds, salt, base64.b64encode(enc).decode('utf-8'))
random.seed()