aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-04-27 12:04:35 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-04-27 12:12:59 +0100
commitdacbdaab9422afc0dcc2d56579f8624cbd5e225e (patch)
treea6fc833e4d319c2ef65f109a7f103f1c8a068212
parent70e30f6caa5ca33fdcaa605a62b133ac1e3ad213 (diff)
imap: Added support for overriding the SASL initial response
In addition to checking for the SASL-IR capability the user can override the sending of the client's initial response in the AUTHENTICATION command with the use of CURLOPT_SASL_IR should the server erroneously not report SASL-IR when it does support it.
-rw-r--r--lib/imap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/imap.c b/lib/imap.c
index da09955dc..6bdd5c1ae 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -525,6 +525,7 @@ static CURLcode imap_perform_login(struct connectdata *conn)
static CURLcode imap_perform_authenticate(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+ struct SessionHandle *data = conn->data;
struct imap_conn *imapc = &conn->proto.imapc;
const char *mech = NULL;
char *initresp = NULL;
@@ -565,7 +566,7 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
state2 = IMAP_AUTHENTICATE_NTLM_TYPE2MSG;
imapc->authused = SASL_MECH_NTLM;
- if(imapc->ir_supported)
+ if(imapc->ir_supported || data->set.sasl_ir)
result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
&conn->ntlm,
&initresp, &len);
@@ -579,7 +580,7 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
state2 = IMAP_AUTHENTICATE_LOGIN_PASSWD;
imapc->authused = SASL_MECH_LOGIN;
- if(imapc->ir_supported)
+ if(imapc->ir_supported || data->set.sasl_ir)
result = Curl_sasl_create_login_message(conn->data, conn->user,
&initresp, &len);
}
@@ -590,7 +591,7 @@ static CURLcode imap_perform_authenticate(struct connectdata *conn)
state2 = IMAP_AUTHENTICATE_FINAL;
imapc->authused = SASL_MECH_PLAIN;
- if(imapc->ir_supported)
+ if(imapc->ir_supported || data->set.sasl_ir)
result = Curl_sasl_create_plain_message(conn->data, conn->user,
conn->passwd, &initresp, &len);
}