pop3.c: Fixed failure detection during TLS upgrade
pop3_state_upgrade_tls() would attempt to incorrectly complete the upgrade to pop3s and start the CAPA command if Curl_ssl_connect_nonblocking() returned a failure code and if ssldone was set to TRUE. This would only happen when a non-blocking API hadn't been provided by the SSL implementation and curlssl_connect() was called underneath.
This commit is contained in:
parent
379d63ecc7
commit
8b275718e2
15
lib/pop3.c
15
lib/pop3.c
@ -568,10 +568,8 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
|
|||||||
else
|
else
|
||||||
result = pop3_state_capa(conn);
|
result = pop3_state_capa(conn);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
state(conn, POP3_UPGRADETLS);
|
|
||||||
result = pop3_state_upgrade_tls(conn);
|
result = pop3_state_upgrade_tls(conn);
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -583,9 +581,14 @@ static CURLcode pop3_state_upgrade_tls(struct connectdata *conn)
|
|||||||
|
|
||||||
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
|
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
|
||||||
|
|
||||||
if(pop3c->ssldone) {
|
if(!result) {
|
||||||
pop3_to_pop3s(conn);
|
if(pop3c->state != POP3_UPGRADETLS)
|
||||||
result = pop3_state_capa(conn);
|
state(conn, POP3_UPGRADETLS);
|
||||||
|
|
||||||
|
if(pop3c->ssldone) {
|
||||||
|
pop3_to_pop3s(conn);
|
||||||
|
result = pop3_state_capa(conn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user