aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2015-09-05 17:29:49 +0100
committerSteve Holme <steve_holme@hotmail.com>2015-11-12 18:25:33 +0000
commitd6d58dd5580f5737432cae1e65f2023dff2804b6 (patch)
tree6f0b4e74ba2a67e02d14a2f2be37d2f1cef837fb
parenta7c4bcd97109b42a665fcef0243173dc7db63f89 (diff)
sasl: Don't choose OAuth 2.0 if mechanism not advertised
Regression from commit 9e8ced9890 which meant if --oauth2-bearer was specified but the SASL mechanism wasn't supported by the server then the mechanism would be chosen.
-rw-r--r--lib/curl_sasl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index a0c989915..8ccfac84a 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -1455,7 +1455,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
}
else
#endif
- if((enabledmechs & SASL_MECH_XOAUTH2) || conn->oauth_bearer) {
+ if((enabledmechs & SASL_MECH_XOAUTH2) && ((conn->oauth_bearer) ||
+ (!conn->passwd))) {
mech = SASL_MECH_STRING_XOAUTH2;
state1 = SASL_XOAUTH2;
sasl->authused = SASL_MECH_XOAUTH2;