Disconnect from server and throw an exception if SCRAM server verification fails
(sasl)
This commit is contained in:
parent
fd08e23bd4
commit
ff2d5ef7e7
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue