From 79d085a0aa5d1516e4b36c6c8854f695e5b2a8b2 Mon Sep 17 00:00:00 2001 From: Fardale Date: Fri, 26 Apr 2019 00:37:07 +0200 Subject: [PATCH] fix md5 password verification function --- re2o/login.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/re2o/login.py b/re2o/login.py index d45fed5a..9e18f17d 100644 --- a/re2o/login.py +++ b/re2o/login.py @@ -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): """