summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/curl_sasl.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2024-01-31 18:58:27 +0300
committerdartraiden <wowemuh@gmail.com>2024-01-31 19:00:01 +0300
commit1e6eb7b2eec5520b510b4437a6f13578f0acddc6 (patch)
tree01f0471822749ef254c71680b9aec022a7765260 /libs/libcurl/src/curl_sasl.c
parentd4ca709d1c304a6d831feff16d9551015c66dde5 (diff)
libcurl: update to 8.6.0
Diffstat (limited to 'libs/libcurl/src/curl_sasl.c')
-rw-r--r--libs/libcurl/src/curl_sasl.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/libs/libcurl/src/curl_sasl.c b/libs/libcurl/src/curl_sasl.c
index 8d78d49129..8ec942cd1c 100644
--- a/libs/libcurl/src/curl_sasl.c
+++ b/libs/libcurl/src/curl_sasl.c
@@ -205,18 +205,23 @@ void Curl_sasl_init(struct SASL *sasl, struct Curl_easy *data,
sasl->force_ir = FALSE; /* Respect external option */
if(auth != CURLAUTH_BASIC) {
- sasl->resetprefs = FALSE;
- sasl->prefmech = SASL_AUTH_NONE;
+ unsigned short mechs = SASL_AUTH_NONE;
+
+ /* If some usable http authentication options have been set, determine
+ new defaults from them. */
if(auth & CURLAUTH_BASIC)
- sasl->prefmech |= SASL_MECH_PLAIN | SASL_MECH_LOGIN;
+ mechs |= SASL_MECH_PLAIN | SASL_MECH_LOGIN;
if(auth & CURLAUTH_DIGEST)
- sasl->prefmech |= SASL_MECH_DIGEST_MD5;
+ mechs |= SASL_MECH_DIGEST_MD5;
if(auth & CURLAUTH_NTLM)
- sasl->prefmech |= SASL_MECH_NTLM;
+ mechs |= SASL_MECH_NTLM;
if(auth & CURLAUTH_BEARER)
- sasl->prefmech |= SASL_MECH_OAUTHBEARER | SASL_MECH_XOAUTH2;
+ mechs |= SASL_MECH_OAUTHBEARER | SASL_MECH_XOAUTH2;
if(auth & CURLAUTH_GSSAPI)
- sasl->prefmech |= SASL_MECH_GSSAPI;
+ mechs |= SASL_MECH_GSSAPI;
+
+ if(mechs != SASL_AUTH_NONE)
+ sasl->prefmech = mechs;
}
}