From ba33ced6abb4c20f831784492b137c38b8280c4a Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Wed, 19 Dec 2018 02:37:43 -0500 Subject: [PATCH] encode --- mail4one/pop3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index 0686d7b..23e00ba 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -69,7 +69,7 @@ def write(data): def validate_password(password): - if not compare_digest(Session.password_hash, sha256(password).hexdigest()): + if not compare_digest(Session.password_hash, sha256(password.encode()).hexdigest()): raise AuthError("Invalid user pass") @@ -269,4 +269,4 @@ async def a_main(*args, **kwargs): if __name__ == "__main__": - asyncio.run(a_main(Path("/tmp/mails"), 9995, password_hash=sha256("dummy").hexdigest())) + asyncio.run(a_main(Path("/tmp/mails"), 9995, password_hash=sha256("dummy".encode()).hexdigest()))