Commit 2eeeb0c1 authored by klafyvel's avatar klafyvel

Merge branch 'fix_md5_password' into 'master'

fix md5 password verification function

See merge request federez/re2o!420
parents 3db44f59 79d085a0
Pipeline #1179 passed with stage
in 3 minutes and 14 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