1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-21 23:19:03 +00:00

Don't rely on -1 return value from SSL_read, just check SSL_get_error() directly

This commit is contained in:
dmiller
2021-12-14 18:36:55 +00:00
parent 0467fa7866
commit 3e08021083

View File

@@ -452,11 +452,11 @@ void handle_connect_result(struct npool *ms, struct nevent *nse, enum nse_status
#endif
sslerr = SSL_get_error(iod->ssl, rc);
if (rc == -1 && sslerr == SSL_ERROR_WANT_READ) {
if (sslerr == SSL_ERROR_WANT_READ) {
nse->sslinfo.ssl_desire = sslerr;
socket_count_read_inc(iod);
update_events(iod, ms, nse, EV_READ, EV_NONE);
} else if (rc == -1 && sslerr == SSL_ERROR_WANT_WRITE) {
} else if (sslerr == SSL_ERROR_WANT_WRITE) {
nse->sslinfo.ssl_desire = sslerr;
socket_count_write_inc(iod);
update_events(iod, ms, nse, EV_WRITE, EV_NONE);