summaryrefslogtreecommitdiff
path: root/sleekxmpp/features/feature_mechanisms/mechanisms.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-03-13 11:07:14 -0700
committerLance Stout <lancestout@gmail.com>2012-03-13 11:07:14 -0700
commit1b00b7e8dfb4d4b0d069853493d7292d587d5cbe (patch)
tree167b979561c74584b879f70f6b27fb7b49d135e1 /sleekxmpp/features/feature_mechanisms/mechanisms.py
parent7284ceb90ccc3f612b93fa5548ba22677f869bc7 (diff)
downloadslixmpp-1b00b7e8dfb4d4b0d069853493d7292d587d5cbe.tar.gz
slixmpp-1b00b7e8dfb4d4b0d069853493d7292d587d5cbe.tar.bz2
slixmpp-1b00b7e8dfb4d4b0d069853493d7292d587d5cbe.tar.xz
slixmpp-1b00b7e8dfb4d4b0d069853493d7292d587d5cbe.zip
Correct handling SASL auth failures when forcing the use of a specific mechanism.
Diffstat (limited to 'sleekxmpp/features/feature_mechanisms/mechanisms.py')
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 570b7141..3818c70e 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -105,14 +105,17 @@ class FeatureMechanisms(BasePlugin):
# server has incorrectly offered it again.
return False
- self.mech_list = set(features['mechanisms'])
+ if not self.use_mech:
+ self.mech_list = set(features['mechanisms'])
+ else:
+ self.mech_list = set([self.use_mech])
return self._send_auth()
def _send_auth(self):
mech_list = self.mech_list - self.attempted_mechs
self.mech = self.sasl.choose_mechanism(mech_list)
- if self.mech is not None:
+ if mech_list and self.mech is not None:
resp = stanza.Auth(self.xmpp)
resp['mechanism'] = self.mech.name
try: