Remove SCRAM debug logging (sasl.py)
This commit is contained in:
parent
51a4b8ef4e
commit
d68c73affa
1 changed files with 0 additions and 10 deletions
|
@ -73,26 +73,18 @@ class Module(ModuleManager.BaseModule):
|
||||||
first_withchannel = "n,,%s" % first_base
|
first_withchannel = "n,,%s" % first_base
|
||||||
auth_text = first_withchannel.encode("utf8")
|
auth_text = first_withchannel.encode("utf8")
|
||||||
event["server"]._scram_first = first_base.encode("utf8")
|
event["server"]._scram_first = first_base.encode("utf8")
|
||||||
self.log.debug("SCRAM client-first-message: %s",
|
|
||||||
[first_withchannel])
|
|
||||||
else:
|
else:
|
||||||
data = base64.b64decode(event["message"]).decode("utf8")
|
data = base64.b64decode(event["message"]).decode("utf8")
|
||||||
pieces = dict(piece.split("=", 1) for piece in data.split(","))
|
pieces = dict(piece.split("=", 1) for piece in data.split(","))
|
||||||
if "s" in pieces:
|
if "s" in pieces:
|
||||||
# server-first-message
|
# server-first-message
|
||||||
self.log.debug("SCRAM server-first-message: %s", [data])
|
|
||||||
|
|
||||||
nonce = pieces["r"].encode("utf8")
|
nonce = pieces["r"].encode("utf8")
|
||||||
salt = base64.b64decode(pieces["s"])
|
salt = base64.b64decode(pieces["s"])
|
||||||
iterations = pieces["i"]
|
iterations = pieces["i"]
|
||||||
password = sasl_password.encode("utf8")
|
password = sasl_password.encode("utf8")
|
||||||
self.log.debug("SCRAM server-first-message salt: %s",
|
|
||||||
[salt])
|
|
||||||
|
|
||||||
salted_password = hashlib.pbkdf2_hmac(algo, password, salt,
|
salted_password = hashlib.pbkdf2_hmac(algo, password, salt,
|
||||||
int(iterations), dklen=None)
|
int(iterations), dklen=None)
|
||||||
self.log.debug("SCRAM server-first-message salted: %s",
|
|
||||||
[salted_password])
|
|
||||||
event["server"]._scram_salted_password = salted_password
|
event["server"]._scram_salted_password = salted_password
|
||||||
|
|
||||||
client_key = hmac.digest(salted_password, b"Client Key",
|
client_key = hmac.digest(salted_password, b"Client Key",
|
||||||
|
@ -103,8 +95,6 @@ class Module(ModuleManager.BaseModule):
|
||||||
auth_noproof = b"c=%s,r=%s" % (channel, nonce)
|
auth_noproof = b"c=%s,r=%s" % (channel, nonce)
|
||||||
auth_message = b"%s,%s,%s" % (event["server"]._scram_first,
|
auth_message = b"%s,%s,%s" % (event["server"]._scram_first,
|
||||||
data.encode("utf8"), auth_noproof)
|
data.encode("utf8"), auth_noproof)
|
||||||
self.log.debug("SCRAM server-first-message auth msg: %s",
|
|
||||||
[auth_message])
|
|
||||||
event["server"]._scram_auth_message = auth_message
|
event["server"]._scram_auth_message = auth_message
|
||||||
|
|
||||||
client_signature = hmac.digest(stored_key, auth_message,
|
client_signature = hmac.digest(stored_key, auth_message,
|
||||||
|
|
Loading…
Reference in a new issue