mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
Make sure login do not throw exception for unknown users.
This commit is contained in:
parent
0954d9d383
commit
6630a8f3d5
@ -27,7 +27,10 @@ def check_credentials(username, passphrase):
|
|||||||
cfg.log(error)
|
cfg.log(error)
|
||||||
return 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
|
# hash the password whether the user exists, to foil timing
|
||||||
# side-channel attacks
|
# side-channel attacks
|
||||||
pass_hash = hashlib.md5(passphrase).hexdigest()
|
pass_hash = hashlib.md5(passphrase).hexdigest()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user