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 {
case "PLAIN":
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{
Username: username,
Password: password,