mirror of
https://github.com/moparisthebest/curl
synced 2024-11-15 05:55:04 -05:00
sasl: prefer PLAIN mechanism over LOGIN
SASL PLAIN is a standard, LOGIN only a draft. The LOGIN draft says PLAIN should be used instead if available.
This commit is contained in:
parent
7b71b5150b
commit
de97b5fcef
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 2012 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -361,15 +361,6 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
|
|||||||
conn->oauth_bearer,
|
conn->oauth_bearer,
|
||||||
&resp, &len);
|
&resp, &len);
|
||||||
}
|
}
|
||||||
else if(enabledmechs & SASL_MECH_LOGIN) {
|
|
||||||
mech = SASL_MECH_STRING_LOGIN;
|
|
||||||
state1 = SASL_LOGIN;
|
|
||||||
state2 = SASL_LOGIN_PASSWD;
|
|
||||||
sasl->authused = SASL_MECH_LOGIN;
|
|
||||||
|
|
||||||
if(force_ir || data->set.sasl_ir)
|
|
||||||
result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
|
|
||||||
}
|
|
||||||
else if(enabledmechs & SASL_MECH_PLAIN) {
|
else if(enabledmechs & SASL_MECH_PLAIN) {
|
||||||
mech = SASL_MECH_STRING_PLAIN;
|
mech = SASL_MECH_STRING_PLAIN;
|
||||||
state1 = SASL_PLAIN;
|
state1 = SASL_PLAIN;
|
||||||
@ -379,6 +370,15 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
|
|||||||
result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
|
result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
|
||||||
&resp, &len);
|
&resp, &len);
|
||||||
}
|
}
|
||||||
|
else if(enabledmechs & SASL_MECH_LOGIN) {
|
||||||
|
mech = SASL_MECH_STRING_LOGIN;
|
||||||
|
state1 = SASL_LOGIN;
|
||||||
|
state2 = SASL_LOGIN_PASSWD;
|
||||||
|
sasl->authused = SASL_MECH_LOGIN;
|
||||||
|
|
||||||
|
if(force_ir || data->set.sasl_ir)
|
||||||
|
result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!result && mech) {
|
if(!result && mech) {
|
||||||
|
Loading…
Reference in New Issue
Block a user