From 98c6ec85af2736059c39896ccf0f1becd0bfc6ea Mon Sep 17 00:00:00 2001 From: dmiller Date: Tue, 2 Apr 2024 21:32:24 +0000 Subject: [PATCH] Don't test for SSL_set_alpn_protos, present in all supported OpenSSL versions --- ncat/ncat_connect.c | 4 ---- ncat/ncat_main.c | 6 ------ nsock/include/nsock_config.h.in | 1 - nsock/src/configure | 27 --------------------------- nsock/src/configure.ac | 4 ---- 5 files changed, 42 deletions(-) diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c index 8bc1f2a8a..4a68d7e75 100644 --- a/ncat/ncat_connect.c +++ b/ncat/ncat_connect.c @@ -194,8 +194,6 @@ static void set_ssl_ctx_options(SSL_CTX *ctx) bye("Unable to set OpenSSL cipher list: %s", ERR_error_string(ERR_get_error(), NULL)); } -#ifdef HAVE_ALPN_SUPPORT - if (o.sslalpn) { size_t alpn_len; unsigned char *alpn = next_protos_parse(&alpn_len, o.sslalpn); @@ -215,8 +213,6 @@ static void set_ssl_ctx_options(SSL_CTX *ctx) free(alpn); } -#endif - } #endif diff --git a/ncat/ncat_main.c b/ncat/ncat_main.c index 91d4a7667..66ca4b728 100644 --- a/ncat/ncat_main.c +++ b/ncat/ncat_main.c @@ -509,16 +509,10 @@ int main(int argc, char *argv[]) o.ssl = 1; o.sslservername = Strdup(optarg); } -#ifdef HAVE_ALPN_SUPPORT else if (strcmp(long_options[option_index].name, "ssl-alpn") == 0) { o.ssl = 1; o.sslalpn = Strdup(optarg); } -#else - else if (strcmp(long_options[option_index].name, "ssl-alpn") == 0) { - bye("OpenSSL does not have ALPN support compiled in. The --ssl-alpn option cannot be chosen."); - } -#endif #else else if (strcmp(long_options[option_index].name, "ssl-cert") == 0) { bye("OpenSSL isn't compiled in. The --ssl-cert option cannot be chosen."); diff --git a/nsock/include/nsock_config.h.in b/nsock/include/nsock_config.h.in index 0c635fdbb..160918049 100644 --- a/nsock/include/nsock_config.h.in +++ b/nsock/include/nsock_config.h.in @@ -79,7 +79,6 @@ #undef HAVE_NETDB_H #undef HAVE_OPENSSL -#undef HAVE_ALPN_SUPPORT #undef HAVE_EPOLL #undef HAVE_POLL diff --git a/nsock/src/configure b/nsock/src/configure index 31e2c94d7..bcca84cbc 100755 --- a/nsock/src/configure +++ b/nsock/src/configure @@ -4914,33 +4914,6 @@ if test "$use_openssl" = "yes"; then $as_echo "#define HAVE_OPENSSL 1" >>confdefs.h OPENSSL_LIBS="-lssl -lcrypto" - LIBS_TMP="$LIBS" - LIBS="$OPENSSL_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_set_alpn_protos" >&5 -$as_echo_n "checking for SSL_set_alpn_protos... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -SSL_set_alpn_protos(NULL, NULL, 0) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; -$as_echo "#define HAVE_ALPN_SUPPORT 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$LIBS_TMP" fi diff --git a/nsock/src/configure.ac b/nsock/src/configure.ac index 9d3547382..7e64521b0 100644 --- a/nsock/src/configure.ac +++ b/nsock/src/configure.ac @@ -270,10 +270,6 @@ if test "$use_openssl" = "yes"; then OPENSSL_LIBS="-lssl -lcrypto" LIBS_TMP="$LIBS" LIBS="$OPENSSL_LIBS $LIBS" - AC_MSG_CHECKING([for SSL_set_alpn_protos]) - AC_TRY_LINK([#include ], [SSL_set_alpn_protos(NULL, NULL, 0)], - [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_ALPN_SUPPORT, 1, [SSL ALPN protos support])], - [AC_MSG_RESULT([no])]) LIBS="$LIBS_TMP" fi