1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00

Nsock: Use separate SSL_CTX for SSL vs DTLS

This commit is contained in:
dmiller
2022-08-25 16:29:49 +00:00
parent 49005f99a2
commit d43df98ab1
5 changed files with 33 additions and 15 deletions

View File

@@ -473,11 +473,14 @@ nsock_event_id nsock_connect_ssl(nsock_pool nsp, nsock_iod nsiod, nsock_ev_handl
struct npool *ms = (struct npool *)nsp;
struct nevent *nse;
if (!ms->sslctx)
if (proto == IPPROTO_UDP)
{
if (proto == IPPROTO_UDP)
if (!ms->dtlsctx)
nsock_pool_dtls_init(ms, 0);
else
}
else
{
if (!ms->sslctx)
nsock_pool_ssl_init(ms, 0);
}
@@ -523,6 +526,8 @@ nsock_event_id nsock_reconnect_ssl(nsock_pool nsp, nsock_iod nsiod, nsock_ev_han
struct niod *nsi = (struct niod *)nsiod;
struct npool *ms = (struct npool *)nsp;
struct nevent *nse;
/* nsock_reconnect_ssl not supported for DTLS (yet?) */
assert(nsi->lastproto != IPPROTO_UDP);
if (!ms->sslctx)
nsock_pool_ssl_init(ms, 0);