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. git-svn-id: file:///srv/svn/repo/suika/trunk@721 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
parent
292ad7748c
commit
8d130a9d92
@ -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…
x
Reference in New Issue
Block a user