Merge pull request #33 from petterreinholdtsen/handle-unknown-users

Make sure login do not throw exception for unknown users.
This commit is contained in:
Nick Daly 2013-09-28 10:33:48 -07:00
commit 6758aa0d36

View File

@ -27,7 +27,10 @@ def check_credentials(username, passphrase):
cfg.log(error)
return error
u = cfg.users[username]
if username in cfg.users:
u = cfg.users[username]
else:
u = None
# hash the password whether the user exists, to foil timing
# side-channel attacks
pass_hash = hashlib.md5(passphrase).hexdigest()