Improve RFC5802 compatibility.

According to RFC 5802 5.1 only the "m" attribute should
cause an authentication error.
This commit is contained in:
Martin Dosch 2024-02-01 13:35:55 +08:00
parent 3f0cbac307
commit 6ffd595a06

View File

@ -580,8 +580,8 @@ func (c *Client) init(o *Options) error {
return errors.New("SCRAM: downgrade protection hash mismatch") return errors.New("SCRAM: downgrade protection hash mismatch")
} }
dgh.Reset() dgh.Reset()
default: case strings.HasPrefix(serverReply, "m="):
return errors.New("unexpected content in SCRAM challenge") return errors.New("SCRAM: server sent reserved 'm' attribute.")
} }
} }
if scramPlus { if scramPlus {