From 75cd7fd66762bbfb73830553c8229aa0182f8987 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 13 Dec 2013 22:57:13 +0000 Subject: imap: Fixed incorrect fallback to clear text authentication If a specific SASL authentication mechanism was requested by the user as part of the login options but wasn't supported by the server then curl would fallback to clear text, when it shouldn't, rather than reporting "No known authentication mechanisms supported" as the POP3 and SMTP protocols do. --- lib/imap.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/imap.h') diff --git a/lib/imap.h b/lib/imap.h index 7c9a72066..95e55bef7 100644 --- a/lib/imap.h +++ b/lib/imap.h @@ -78,6 +78,7 @@ struct imap_conn { imapstate state; /* Always use imap.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ unsigned int authmechs; /* Accepted authentication mechanisms */ + unsigned int preftype; /* Preferred authentication type */ unsigned int prefmech; /* Preferred authentication mechanism */ unsigned int authused; /* Auth mechanism used for the connection */ int cmdid; /* Last used command ID */ @@ -92,4 +93,12 @@ struct imap_conn { extern const struct Curl_handler Curl_handler_imap; extern const struct Curl_handler Curl_handler_imaps; +/* Authentication type flags */ +#define IMAP_TYPE_CLEARTEXT (1 << 0) +#define IMAP_TYPE_SASL (1 << 1) + +/* Authentication type values */ +#define IMAP_TYPE_NONE 0 +#define IMAP_TYPE_ANY ~0U + #endif /* HEADER_CURL_IMAP_H */ -- cgit v1.2.3