Commit 79d085a0 authored by Fardale's avatar Fardale

fix md5 password verification function

parent 3db44f59
......@@ -157,9 +157,9 @@ class MD5PasswordHasher(hashers.BasePasswordHasher):
"""
assert encoded.startswith(self.algorithm)
salt = hash_password_salt(encoded)
return constant_time_compare(
b64encode(hashlib.md5(password.encode() + salt).digest() + salt),
encoded.encode())
return constant_time_compare(self.algorithm + "$" +
b64encode(hashlib.md5(password.encode() + salt).digest() + salt).decode(),
encoded)
def safe_summary(self, encoded):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment