From fc309562dac09904a012b151c0d6128ff4673991 Mon Sep 17 00:00:00 2001 From: Unrud Date: Tue, 23 May 2017 03:01:56 +0200 Subject: [PATCH] Repair SSHA method --- radicale/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radicale/auth.py b/radicale/auth.py index 8ae493a..a716bd1 100644 --- a/radicale/auth.py +++ b/radicale/auth.py @@ -169,11 +169,11 @@ class Auth(BaseAuth): written with e.g. openssl, and nginx can parse it. """ - hash_value = hash_value.replace( - "{SSHA}", "").encode("ascii").decode("base64") + hash_value = base64.b64decode(hash_value.replace( + "{SSHA}", "").encode("ascii")) password = password.encode(self.configuration.get("encoding", "stock")) - hash_value = hash_value[:20] salt_value = hash_value[20:] + hash_value = hash_value[:20] sha1 = hashlib.sha1() sha1.update(password) sha1.update(salt_value)