From 6ffd595a06b624f869805e5066894afce16026d4 Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Thu, 1 Feb 2024 13:35:55 +0800 Subject: [PATCH] Improve RFC5802 compatibility. According to RFC 5802 5.1 only the "m" attribute should cause an authentication error. --- xmpp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmpp.go b/xmpp.go index c009c7f..be30176 100644 --- a/xmpp.go +++ b/xmpp.go @@ -580,8 +580,8 @@ func (c *Client) init(o *Options) error { return errors.New("SCRAM: downgrade protection hash mismatch") } dgh.Reset() - default: - return errors.New("unexpected content in SCRAM challenge") + case strings.HasPrefix(serverReply, "m="): + return errors.New("SCRAM: server sent reserved 'm' attribute.") } } if scramPlus {