Only panic about a scram failure if it's a server-final-message failure (sasl)

This commit is contained in:
jesopo 2019-02-06 15:38:59 +00:00
parent 0e63700761
commit 09eb3d3314

View file

@ -83,8 +83,10 @@ class Module(ModuleManager.BaseModule):
if verified: if verified:
auth_text = "+" auth_text = "+"
else: else:
event["server"].disconnect() if current_scram.state == scram.SCRAMState.VerifyFailed:
raise ValueError("Server SCRAM verification failed") event["server"].disconnect()
raise ValueError("Server SCRAM verification failed")
self._end_sasl(event["server"])
else: else:
raise ValueError("unknown sasl mechanism '%s'" % mechanism) raise ValueError("unknown sasl mechanism '%s'" % mechanism)