mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #5719 from erasche/constant-time-sha-compare
Swap for the constant time comparison algorithm
This commit is contained in:
@@ -31,7 +31,7 @@ def check_password(guess, hashed):
|
||||
return True
|
||||
else:
|
||||
# Passwords were originally encoded with sha1 and hexed
|
||||
if hashlib.sha1(guess).hexdigest() == hashed:
|
||||
if safe_str_cmp(hashlib.sha1(guess).hexdigest(), hashed):
|
||||
return True
|
||||
# Password does not match
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user