aboutsummaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/imap.c b/lib/imap.c
index f856dcd3d..b17b7e533 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -426,6 +426,7 @@ static void state(struct connectdata *conn, imapstate newstate)
"AUTHENTICATE_NTLM",
"AUTHENTICATE_NTLM_TYPE2MSG",
"AUTHENTICATE_XOAUTH2",
+ "AUTHENTICATE_CANCEL",
"AUTHENTICATE_FINAL",
"LOGIN",
"LIST",
@@ -1287,7 +1288,7 @@ static CURLcode imap_state_auth_ntlm_type2msg_resp(struct connectdata *conn,
}
#endif
-/* For AUTH XOAUTH2 (without initial response) responses */
+/* For AUTHENTICATE XOAUTH2 (without initial response) responses */
static CURLcode imap_state_auth_xoauth2_resp(struct connectdata *conn,
int imapcode,
imapstate instate)
@@ -1325,7 +1326,22 @@ static CURLcode imap_state_auth_xoauth2_resp(struct connectdata *conn,
return result;
}
-/* For final responses to the AUTHENTICATE sequence */
+/* For AUTHENTICATE cancellation responses */
+static CURLcode imap_state_auth_cancel_resp(struct connectdata *conn,
+ int imapcode,
+ imapstate instate)
+{
+ struct SessionHandle *data = conn->data;
+
+ (void)imapcode;
+ (void)instate; /* no use for this yet */
+
+ failf(data, "Authentication cancelled");
+
+ return CURLE_LOGIN_DENIED;
+}
+
+/* For final responses in the AUTHENTICATE sequence */
static CURLcode imap_state_auth_final_resp(struct connectdata *conn,
int imapcode,
imapstate instate)
@@ -1678,6 +1694,10 @@ static CURLcode imap_statemach_act(struct connectdata *conn)
result = imap_state_auth_xoauth2_resp(conn, imapcode, imapc->state);
break;
+ case IMAP_AUTHENTICATE_CANCEL:
+ result = imap_state_auth_cancel_resp(conn, imapcode, imapc->state);
+ break;
+
case IMAP_AUTHENTICATE_FINAL:
result = imap_state_auth_final_resp(conn, imapcode, imapc->state);
break;