mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH mediagoblin] Add one more str - byte conversion for bcrypt.


From: ~eroca
Subject: [PATCH mediagoblin] Add one more str - byte conversion for bcrypt.
Date: Fri, 28 Jan 2022 20:46:22 +0100

From: Elisei Roca <eroca@mailbox.org>

---
 mediagoblin/plugins/basic_auth/tools.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mediagoblin/plugins/basic_auth/tools.py 
b/mediagoblin/plugins/basic_auth/tools.py
index fcc00b72..a0a149a1 100644
--- a/mediagoblin/plugins/basic_auth/tools.py
+++ b/mediagoblin/plugins/basic_auth/tools.py
@@ -48,7 +48,7 @@ def bcrypt_check_password(raw_pass, stored_hash, 
extra_salt=None):
     #
     # See also:
     rand_salt = bcrypt.gensalt(5)
-    randplus_stored_hash = bcrypt.hashpw(stored_hash, rand_salt)
+    randplus_stored_hash = bcrypt.hashpw(stored_hash.encode('utf-8'), 
rand_salt)
     randplus_hashed_pass = bcrypt.hashpw(hashed_pass, rand_salt)
 
     return randplus_stored_hash == randplus_hashed_pass
-- 
2.32.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]