Put StringPrep exception handler with the right try block.
This commit is contained in:
parent
a186972f09
commit
1f137735e1
@ -173,6 +173,9 @@ class FeatureMechanisms(BasePlugin):
|
|||||||
self.xmpp.event("no_auth", direct=True)
|
self.xmpp.event("no_auth", direct=True)
|
||||||
self.attempted_mechs = set()
|
self.attempted_mechs = set()
|
||||||
return self.xmpp.disconnect()
|
return self.xmpp.disconnect()
|
||||||
|
except StringPrepError:
|
||||||
|
log.exception("A credential value did not pass SASLprep.")
|
||||||
|
self.xmpp.disconnect()
|
||||||
|
|
||||||
resp = stanza.Auth(self.xmpp)
|
resp = stanza.Auth(self.xmpp)
|
||||||
resp['mechanism'] = self.mech.name
|
resp['mechanism'] = self.mech.name
|
||||||
@ -189,9 +192,6 @@ class FeatureMechanisms(BasePlugin):
|
|||||||
"A security breach is possible.")
|
"A security breach is possible.")
|
||||||
self.attempted_mechs.add(self.mech.name)
|
self.attempted_mechs.add(self.mech.name)
|
||||||
self.xmpp.disconnect()
|
self.xmpp.disconnect()
|
||||||
except StringPrepError:
|
|
||||||
log.exception("A credential value did not pass SASLprep.")
|
|
||||||
self.xmpp.disconnect()
|
|
||||||
else:
|
else:
|
||||||
resp.send(now=True)
|
resp.send(now=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user