"AUTHENTICATE_NTLM",
"AUTHENTICATE_NTLM_TYPE2MSG",
"AUTHENTICATE_XOAUTH2",
+ "AUTHENTICATE_CANCEL",
"AUTHENTICATE_FINAL",
"LOGIN",
"LIST",
}
#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)
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)
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;
IMAP_AUTHENTICATE_NTLM,
IMAP_AUTHENTICATE_NTLM_TYPE2MSG,
IMAP_AUTHENTICATE_XOAUTH2,
+ IMAP_AUTHENTICATE_CANCEL,
IMAP_AUTHENTICATE_FINAL,
IMAP_LOGIN,
IMAP_LIST,
"AUTH_NTLM",
"AUTH_NTLM_TYPE2MSG",
"AUTH_XOAUTH2",
+ "AUTH_CANCEL",
"AUTH_FINAL",
"APOP",
"USER",
return result;
}
-/* For final responses to the AUTH sequence */
+/* For AUTH cancellation responses */
+static CURLcode pop3_state_auth_cancel_resp(struct connectdata *conn,
+ int pop3code,
+ pop3state instate)
+{
+ struct SessionHandle *data = conn->data;
+
+ (void)pop3code;
+ (void)instate; /* no use for this yet */
+
+ failf(data, "Authentication cancelled");
+
+ return CURLE_LOGIN_DENIED;
+}
+
+/* For final responses in the AUTH sequence */
static CURLcode pop3_state_auth_final_resp(struct connectdata *conn,
int pop3code,
pop3state instate)
result = pop3_state_auth_xoauth2_resp(conn, pop3code, pop3c->state);
break;
+ case POP3_AUTH_CANCEL:
+ result = pop3_state_auth_cancel_resp(conn, pop3code, pop3c->state);
+ break;
+
case POP3_AUTH_FINAL:
result = pop3_state_auth_final_resp(conn, pop3code, pop3c->state);
break;
POP3_AUTH_NTLM,
POP3_AUTH_NTLM_TYPE2MSG,
POP3_AUTH_XOAUTH2,
+ POP3_AUTH_CANCEL,
POP3_AUTH_FINAL,
POP3_APOP,
POP3_USER,
"AUTH_NTLM",
"AUTH_NTLM_TYPE2MSG",
"AUTH_XOAUTH2",
+ "AUTH_CANCEL",
"AUTH_FINAL",
"MAIL",
"RCPT",
return result;
}
-/* For the final responses to the AUTH sequence */
+/* For AUTH cancellation responses */
+static CURLcode smtp_state_auth_cancel_resp(struct connectdata *conn,
+ int smtpcode,
+ smtpstate instate)
+{
+ struct SessionHandle *data = conn->data;
+
+ (void)smtpcode;
+ (void)instate; /* no use for this yet */
+
+ failf(data, "Authentication cancelled");
+
+ return CURLE_LOGIN_DENIED;
+}
+
+/* For final responses in the AUTH sequence */
static CURLcode smtp_state_auth_final_resp(struct connectdata *conn,
int smtpcode,
smtpstate instate)
result = smtp_state_auth_xoauth2_resp(conn, smtpcode, smtpc->state);
break;
+ case SMTP_AUTH_CANCEL:
+ result = smtp_state_auth_cancel_resp(conn, smtpcode, smtpc->state);
+ break;
+
case SMTP_AUTH_FINAL:
result = smtp_state_auth_final_resp(conn, smtpcode, smtpc->state);
break;
SMTP_AUTH_NTLM,
SMTP_AUTH_NTLM_TYPE2MSG,
SMTP_AUTH_XOAUTH2,
+ SMTP_AUTH_CANCEL,
SMTP_AUTH_FINAL,
SMTP_MAIL, /* MAIL FROM */
SMTP_RCPT, /* RCPT TO */