From 8a23f28dfa3ac6b97d35cb81bb071cd2802271e8 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Mon, 14 May 2012 22:26:06 -0700 Subject: Add an exception handler for SASLprep failures. --- sleekxmpp/features/feature_mechanisms/mechanisms.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sleekxmpp') diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py index b7af81d0..cc3579e8 100644 --- a/sleekxmpp/features/feature_mechanisms/mechanisms.py +++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py @@ -129,6 +129,9 @@ class FeatureMechanisms(BasePlugin): except SASLError: self.attempted_mechs.add(self.mech.name) self._send_auth() + except UnicodeError as e: + log.exception("A credential value did not pass SASLprep.") + self.xmpp.disconnect() else: resp.send(now=True) else: -- cgit v1.2.3