aboutsummaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-10-27 22:20:18 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-10-27 22:25:18 +0000
commitf68559c086b74e092f72b72641d3a1a043cfa636 (patch)
tree04e40781d6e13993b166ced7555d6ceb6ba85069 /lib/pop3.c
parent08f97f3b1d66e65ead0c32730ec5e37bf44b59fb (diff)
email: Added support for cancelling NTLM authentication
Diffstat (limited to 'lib/pop3.c')
-rw-r--r--lib/pop3.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index cd7a4a4d3..b22d66e05 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -1148,24 +1148,32 @@ static CURLcode pop3_state_auth_ntlm_type2msg_resp(struct connectdata *conn,
/* Get the type-2 message */
pop3_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.pop3c.pp, "%s", "*");
- /* Send the message */
- if(!result) {
- if(type3msg) {
+ if(!result)
+ state(conn, POP3_AUTH_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.pop3c.pp, "%s", type3msg);
if(!result)
state(conn, POP3_AUTH_FINAL);
}
-
- Curl_safefree(type3msg);
}
}
+ Curl_safefree(type3msg);
+
return result;
}
#endif