imap: Fixed incorrect initial response generation for SASL AUTHENTICATE

Fixed incorrect initial response generation for the NTLM and LOGIN SASL
authentication mechanisms when the SASL-IR was detected.

Introduced in commit: 6da7dc026c.
This commit is contained in:
Steve Holme
2013-03-17 00:20:42 +00:00
parent 2dd56991f7
commit b3440f490f

View File

@@ -673,8 +673,9 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
imapc->authused = SASL_MECH_NTLM; imapc->authused = SASL_MECH_NTLM;
if(imapc->ir_supported) if(imapc->ir_supported)
result = Curl_sasl_create_login_message(conn->data, conn->user, result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
&initresp, &len); &conn->ntlm,
&initresp, &len);
} }
else else
#endif #endif
@@ -685,8 +686,8 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
imapc->authused = SASL_MECH_LOGIN; imapc->authused = SASL_MECH_LOGIN;
if(imapc->ir_supported) if(imapc->ir_supported)
result = Curl_sasl_create_plain_message(conn->data, conn->user, result = Curl_sasl_create_login_message(conn->data, conn->user,
conn->passwd, &initresp, &len); &initresp, &len);
} }
else if(imapc->authmechs & SASL_MECH_PLAIN) { else if(imapc->authmechs & SASL_MECH_PLAIN) {
mech = "PLAIN"; mech = "PLAIN";
@@ -703,8 +704,8 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
return result; return result;
if(mech) { if(mech) {
/* Perform SASL based authentication */
if(initresp) { if(initresp) {
/* Perform SASL based authentication */
result = imap_sendf(conn, "AUTHENTICATE %s %s", mech, initresp); result = imap_sendf(conn, "AUTHENTICATE %s %s", mech, initresp);
if(!result) if(!result)