changeset 830872341298 in /home/hg/repos/python-nbxmpp

details:http://hg.gajim.org/python-nbxmpp?cmd=changeset;node=830872341298
description: [thpo] fix handling of binary SASL data for mechanism GSSAPI. 
Fixes #30

diffstat:

 nbxmpp/auth_nb.py |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 7c7c2ca7effb -r 830872341298 nbxmpp/auth_nb.py
--- a/nbxmpp/auth_nb.py Sat Nov 08 22:21:36 2014 +0100
+++ b/nbxmpp/auth_nb.py Mon Dec 22 22:00:08 2014 +0100
@@ -301,7 +301,11 @@
                 split('\n'))
 
         incoming_data = challenge.getData()
-        data=base64.b64decode(incoming_data.encode('utf-8')).decode('utf-8')
+        data=base64.b64decode(incoming_data.encode('utf-8'))
+
+        if self.mechanism != 'GSSAPI':
+            data=data.decode('utf-8')
+
         ### Handle Auth result
         def on_auth_fail(reason):
             log.info('Failed SASL authentification: %s' % reason)
@@ -352,7 +356,10 @@
             raise NodeProcessed
 
         ### Perform auth step
-        log.info('Got challenge:' + data)
+        if self.mechanism != 'GSSAPI':
+            log.info('Got challenge:' + data)
+        else:
+            log.info('Got challenge')
 
         if self.mechanism == 'GSSAPI':
             if self.gss_step == GSS_STATE_STEP:
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to