1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-03 13:19:04 +00:00

Ncat: Don't call SSL_shutdown if --no-shutdown

This commit is contained in:
dmiller
2024-12-06 18:41:57 +00:00
parent 4c52894f25
commit 53d2a7587d
3 changed files with 6 additions and 3 deletions

View File

@@ -286,7 +286,8 @@ int fdinfo_close(struct fdinfo *fdn)
{
#ifdef HAVE_OPENSSL
if (o.ssl && fdn->ssl != NULL) {
SSL_shutdown(fdn->ssl);
if (!o.noshutdown)
SSL_shutdown(fdn->ssl);
SSL_free(fdn->ssl);
fdn->ssl = NULL;
}

View File

@@ -294,8 +294,10 @@ static void subprocess_info_close(struct subprocess_info *info)
{
#ifdef HAVE_OPENSSL
if (info->fdn.ssl != NULL) {
SSL_shutdown(info->fdn.ssl);
if (!o.noshutdown)
SSL_shutdown(info->fdn.ssl);
SSL_free(info->fdn.ssl);
info->fdn.ssl = NULL;
}
#endif
closesocket(info->fdn.fd);

View File

@@ -629,7 +629,7 @@ static void close_fd(struct fdinfo *fdn, int eof) {
logdebug("Closing connection.\n");
#ifdef HAVE_OPENSSL
if (o.ssl && fdn->ssl) {
if (eof)
if (eof && !o.noshutdown)
SSL_shutdown(fdn->ssl);
SSL_free(fdn->ssl);
}