From 29e4dce0a2ba187091b4644e2003297300162673 Mon Sep 17 00:00:00 2001
From: Bowe Strickland <bowe@redhat.com>
Date: Fri, 26 Oct 2018 23:03:01 +0200
Subject: [PATCH] Merge pull request #1 from RedHatTraining/bostrick-patch-sha1_check_to_bytes

---
 repoze/who/plugins/htpasswd.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/repoze/who/plugins/htpasswd.py b/repoze/who/plugins/htpasswd.py
index 353e23f..0940c9d 100644
--- a/repoze/who/plugins/htpasswd.py
+++ b/repoze/who/plugins/htpasswd.py
@@ -101,6 +101,8 @@
     from base64 import standard_b64encode
     from repoze.who._compat import must_encode
     encrypted_string = standard_b64encode(sha1(must_encode(password)).digest())
+    if hasattr(encrypted_string, "decode"):
+        encrypted_string = encrypted_string.decode()
     return _same_string(hashed, "%s%s" % ("{SHA}", encrypted_string))
 
 def plain_check(password, hashed):

--
Gitblit v1.9.3