Abort SASL if in-progress while completing registration
Implements the following recommendation from the spec: > If the client completes registration (with CAP END, NICK, USER and any other > necessary messages) while the SASL authentication is still in progress, the > server SHOULD abort it and send a 906 numeric, then register the client > without authentication.
This commit is contained in:
parent
c6f5508765
commit
b5a868bbcd
@ -1110,6 +1110,15 @@ func (dc *downstreamConn) register(ctx context.Context) error {
|
||||
return fmt.Errorf("tried to register twice")
|
||||
}
|
||||
|
||||
if dc.saslServer != nil {
|
||||
dc.saslServer = nil
|
||||
dc.SendMessage(&irc.Message{
|
||||
Prefix: dc.srv.prefix(),
|
||||
Command: irc.ERR_SASLABORTED,
|
||||
Params: []string{"*", "SASL authentication aborted"},
|
||||
})
|
||||
}
|
||||
|
||||
password := dc.password
|
||||
dc.password = ""
|
||||
if dc.user == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user