From 2d228bdb56373ef006f59eed107a2f9d6757e917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Tue, 30 Oct 2018 22:29:20 +0000 Subject: [PATCH] Decode bytes in GSSAPI handling, as expected by the kerberos module API. --- slixmpp/util/sasl/mechanisms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slixmpp/util/sasl/mechanisms.py b/slixmpp/util/sasl/mechanisms.py index 36b2795c..874787a9 100644 --- a/slixmpp/util/sasl/mechanisms.py +++ b/slixmpp/util/sasl/mechanisms.py @@ -516,13 +516,13 @@ else: def setup(self, name): authzid = self.credentials['authzid'] if not authzid: - authzid = 'xmpp@%s' % self.credentials['service-name'] + authzid = 'xmpp@' + self.credentials['service-name'].decode() _, self.gss = kerberos.authGSSClientInit(authzid) self.step = 0 def process(self, challenge=b''): - b64_challenge = b64encode(challenge) + b64_challenge = b64encode(challenge).decode('ascii') try: if self.step == 0: result = kerberos.authGSSClientStep(self.gss, b64_challenge) @@ -536,7 +536,7 @@ else: kerberos.authGSSClientUnwrap(self.gss, b64_challenge) resp = kerberos.authGSSClientResponse(self.gss) - kerberos.authGSSClientWrap(self.gss, resp, username) + kerberos.authGSSClientWrap(self.gss, resp, username.decode()) resp = kerberos.authGSSClientResponse(self.gss) except kerberos.GSSError as e: