email: Added support for cancelling NTLM authentication
This commit is contained in:
26
lib/imap.c
26
lib/imap.c
@@ -1290,24 +1290,32 @@ static CURLcode imap_state_auth_ntlm_type2msg_resp(struct connectdata *conn,
|
||||
/* Get the challenge message */
|
||||
imap_get_message(data->state.buffer, &type2msg);
|
||||
|
||||
/* Create the type-3 message */
|
||||
result = Curl_sasl_create_ntlm_type3_message(data, type2msg, conn->user,
|
||||
conn->passwd, &conn->ntlm,
|
||||
&type3msg, &len);
|
||||
/* Decode the type-2 message */
|
||||
result = Curl_sasl_decode_ntlm_type2_message(data, type2msg, &conn->ntlm);
|
||||
if(result) {
|
||||
/* Send the cancellation */
|
||||
result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*");
|
||||
|
||||
/* Send the message */
|
||||
if(!result) {
|
||||
if(type3msg) {
|
||||
if(!result)
|
||||
state(conn, IMAP_AUTHENTICATE_CANCEL);
|
||||
}
|
||||
else {
|
||||
/* Create the type-3 message */
|
||||
result = Curl_sasl_create_ntlm_type3_message(data, conn->user,
|
||||
conn->passwd, &conn->ntlm,
|
||||
&type3msg, &len);
|
||||
if(!result && type3msg) {
|
||||
/* Send the message */
|
||||
result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", type3msg);
|
||||
|
||||
if(!result)
|
||||
state(conn, IMAP_AUTHENTICATE_FINAL);
|
||||
}
|
||||
|
||||
Curl_safefree(type3msg);
|
||||
}
|
||||
}
|
||||
|
||||
Curl_safefree(type3msg);
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user