Make XEP-0474 configurable (default off).

As it is still experimental we should not enable it per default.
This commit is contained in:
Martin Dosch 2024-03-26 21:34:51 +01:00
parent bc81053dbc
commit 862c21f845

View File

@ -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 {