From 862c21f845b08ad18bc7c4c4629771df19d219fd Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Tue, 26 Mar 2024 21:34:51 +0100 Subject: [PATCH] Make XEP-0474 configurable (default off). As it is still experimental we should not enable it per default. --- xmpp.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmpp.go b/xmpp.go index 0c287dc..2ac0a09 100644 --- a/xmpp.go +++ b/xmpp.go @@ -230,6 +230,9 @@ type Options struct { // Auth mechanism to use Mechanism string + + // XEP-0474: SASL SCRAM Downgrade Protection + SSDP bool } // NewClient establishes a new Client connection based on a set of Options. @@ -582,7 +585,7 @@ func (c *Client) init(o *Options) error { if err != nil { return err } - case strings.HasPrefix(serverReply, "d="): + case strings.HasPrefix(serverReply, "d=") && o.SSDP: serverDgProtectHash := strings.SplitN(serverReply, "=", 2)[1] slices.Sort(f.Mechanisms.Mechanism) for _, mech := range f.Mechanisms.Mechanism {