TB while authing with SASL
First the TB:
Traceback (most recent call last):
File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
self.run()
File "/usr/lib/python2.4/threading.py", line 422, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/travis/src/gajim-trunk/src/common/connection.py", line 1826, in change_status2
self.connect_and_init(show, msg, signed)
File "/home/travis/src/gajim-trunk/src/common/connection.py", line 1798, in connect_and_init
self.connection = self.connect_and_auth()
File "/home/travis/src/gajim-trunk/src/common/connection.py", line 1691, in connect_and_auth
auth = con.auth(name, self.password, resource, 1)
File "/home/travis/src/gajim-trunk/src/common/xmpp/client.py", line 219, in auth
while self.SASL.startsasl=='in-process' and self.Process(): pass
File "/home/travis/src/gajim-trunk/src/common/xmpp/dispatcher.py", line 292, in dispatch
handler['func'](session,stanza)
File "/home/travis/src/gajim-trunk/src/common/xmpp/auth.py", line 178, in SASLHandler
key,value=pair.split('=')
ValueError: too many values to unpack
The reason for this is the nonce in the SASL challenge: nonce="pUImNB/DkBgFxQoVUpPXLJbSVAg3K/Riw6Gd/UmJeMY="
Notice there are 2 '=' characters which happens to be the split delimiter. In order to allow '=' in the value of a name/value pair we should be explicit and specify at most one split.
--- src/common/xmpp/auth.py (revision 4525)
+++ src/common/xmpp/auth.py (working copy)
@@ -174,7 +174,8 @@
data=base64.decodestring(incoming_data)
self.DEBUG('Got challenge:'+data,'ok')
for pair in data.split(','):
- key,value=pair.split('=')
+ key,value=pair.split('=', 1)
if value[:1]=='"' and value[-1:]=='"': value=value[1:-1]
chal[key]=value
if chal.has_key('qop') and chal['qop']=='auth':