summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-11-27 19:54:46 -0500
committerLance Stout <lancestout@gmail.com>2012-11-27 19:54:46 -0500
commitb820351f6468e6718dc75b69a0088b2433a658af (patch)
tree21606c63f808a833b88076d0e7f386c9b982aa32
parent0eb009496e4e2998f6387f835f8ae29830f1a61b (diff)
downloadslixmpp-b820351f6468e6718dc75b69a0088b2433a658af.tar.gz
slixmpp-b820351f6468e6718dc75b69a0088b2433a658af.tar.bz2
slixmpp-b820351f6468e6718dc75b69a0088b2433a658af.tar.xz
slixmpp-b820351f6468e6718dc75b69a0088b2433a658af.zip
Fix DIGEST-MD5 support for picky servers
-rw-r--r--sleekxmpp/features/feature_mechanisms/stanza/auth.py2
-rw-r--r--sleekxmpp/util/sasl/mechanisms.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/stanza/auth.py b/sleekxmpp/features/feature_mechanisms/stanza/auth.py
index 7b665345..6b6f85a3 100644
--- a/sleekxmpp/features/feature_mechanisms/stanza/auth.py
+++ b/sleekxmpp/features/feature_mechanisms/stanza/auth.py
@@ -40,7 +40,7 @@ class Auth(StanzaBase):
if not self['mechanism'] in self.plain_mechs:
if values:
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
- else:
+ elif values == b'':
self.xml.text = '='
else:
self.xml.text = bytes(values).decode('utf-8')
diff --git a/sleekxmpp/util/sasl/mechanisms.py b/sleekxmpp/util/sasl/mechanisms.py
index 55ae44dd..80cb7219 100644
--- a/sleekxmpp/util/sasl/mechanisms.py
+++ b/sleekxmpp/util/sasl/mechanisms.py
@@ -467,7 +467,8 @@ class DIGEST(Mech):
'qop': self.qop,
'digest-uri': quote(self.digest_uri()),
'response': self.response(b'AUTHENTICATE'),
- 'maxbuf': self.maxbuf
+ 'maxbuf': self.maxbuf,
+ 'charset': 'utf-8'
}
resp = b''
for key, value in data.items():
@@ -480,7 +481,7 @@ class DIGEST(Mech):
if self.cnonce and self.nonce and self.nonce_count and self.qop:
self.nonce_count += 1
return self.respond()
- return b''
+ return None
data = self.parse(challenge)
if 'rspauth' in data: