Commit 4a14d648 authored by Fardale's avatar Fardale Committed by root

fix md5 password verification function

parent 074b9442
Pipeline #1294 passed with stage
in 3 minutes and 11 seconds
......@@ -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