pop3.c: Fixed default authentication detection

Fixed an issue where a server may positively respond to the CAPA command
but not list clear text as a valid authentication type.
This commit is contained in:
Steve Holme 2013-01-06 23:06:29 +00:00
parent d6bebd56f7
commit 494b8664da
1 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -588,9 +588,7 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */ (void)instate; /* no use for this yet */
if(pop3code != '+') if(pop3code == '+' && conn->proto.pop3c.authtypes) {
result = pop3_state_user(conn);
else {
/* Check supported authentication types by decreasing order of security */ /* Check supported authentication types by decreasing order of security */
if(conn->proto.pop3c.authtypes & POP3_TYPE_SASL) if(conn->proto.pop3c.authtypes & POP3_TYPE_SASL)
result = pop3_authenticate(conn); result = pop3_authenticate(conn);
@ -605,6 +603,8 @@ static CURLcode pop3_state_capa_resp(struct connectdata *conn,
result = CURLE_LOGIN_DENIED; /* Other types not supported */ result = CURLE_LOGIN_DENIED; /* Other types not supported */
} }
} }
else
result = pop3_state_user(conn);
return result; return result;
} }