Repair SSHA method

This commit is contained in:
Unrud 2017-05-23 03:01:56 +02:00
parent 99bda37839
commit fc309562da

View File

@ -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)