downstream: error out if SASL PLAIN identity is specified

This commit is contained in:
Simon Ser 2023-04-05 21:18:57 +02:00
parent b3be05559b
commit 43e6febc15

View file

@ -918,6 +918,9 @@ func (dc *downstreamConn) handleAuthenticate(msg *irc.Message) (result *downstre
switch mech { switch mech {
case "PLAIN": case "PLAIN":
server = sasl.NewPlainServer(sasl.PlainAuthenticator(func(identity, username, password string) error { server = sasl.NewPlainServer(sasl.PlainAuthenticator(func(identity, username, password string) error {
if identity != "" && identity != username {
return fmt.Errorf("SASL PLAIN identity not supported")
}
dc.sasl.plain = &saslPlain{ dc.sasl.plain = &saslPlain{
Username: username, Username: username,
Password: password, Password: password,