Disconnect from server and throw an exception if SCRAM server verification fails

(sasl)
This commit is contained in:
jesopo 2019-02-05 17:03:41 +00:00
parent fd08e23bd4
commit ff2d5ef7e7

View file

@ -79,6 +79,11 @@ class Module(ModuleManager.BaseModule):
elif current_scram.state == scram.SCRAMState.ClientFinal:
auth_text = current_scram.server_final(event["message"])
del event["server"]._scram
if current_scram.state == scram.SCRAMState.VerifyFailed:
event["server"].disconnect()
raise ValueError("Server SCRAM verification failed")
else:
raise ValueError("unknown sasl mechanism '%s'" % mechanism)