使用 compare_digest 抵御时差攻击
This commit is contained in:
@@ -56,4 +56,4 @@ class Password:
|
|||||||
100000)
|
100000)
|
||||||
pwdhash = binascii.hexlify(pwdhash).decode('ascii')
|
pwdhash = binascii.hexlify(pwdhash).decode('ascii')
|
||||||
|
|
||||||
return pwdhash == stored_password
|
return secrets.compare_digest(pwdhash, stored_password)
|
||||||
Reference in New Issue
Block a user