From d083e3f2af9baf1910a69c1cc4a06a26be99d40c Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 18 Jul 2021 15:51:16 +0100 Subject: [PATCH] ALPN: feature macro --- doc/doc-docbook/spec.xfpt | 3 ++- src/src/tls-gnu.c | 3 +++ src/src/tls-openssl.c | 3 +++ test/confs/{1115 => 1190} | 2 +- test/confs/2038 | 1 - test/confs/2090 | 1 + test/confs/2138 | 1 - test/confs/2190 | 1 + test/log/{1115 => 1190} | 0 test/log/{2038 => 2090} | 0 test/log/{2138 => 2190} | 0 test/scripts/{1100-Basic-TLS/1115 => 1190-TLS-ALPN/1190} | 0 test/scripts/1190-TLS-ALPN/REQUIRES | 1 + test/scripts/{2000-GnuTLS/2038 => 2090-GnuTLS-ALPN/2090} | 0 test/scripts/2090-GnuTLS-ALPN/REQUIRES | 3 +++ test/scripts/{2100-OpenSSL/2138 => 2190-OpenSSL-ALPN/2190} | 0 test/scripts/2190-OpenSSL-ALPN/REQUIRES | 3 +++ 17 files changed, 18 insertions(+), 4 deletions(-) rename test/confs/{1115 => 1190} (96%) delete mode 120000 test/confs/2038 create mode 120000 test/confs/2090 delete mode 120000 test/confs/2138 create mode 120000 test/confs/2190 rename test/log/{1115 => 1190} (100%) rename test/log/{2038 => 2090} (100%) rename test/log/{2138 => 2190} (100%) rename test/scripts/{1100-Basic-TLS/1115 => 1190-TLS-ALPN/1190} (100%) create mode 100644 test/scripts/1190-TLS-ALPN/REQUIRES rename test/scripts/{2000-GnuTLS/2038 => 2090-GnuTLS-ALPN/2090} (100%) create mode 100644 test/scripts/2090-GnuTLS-ALPN/REQUIRES rename test/scripts/{2100-OpenSSL/2138 => 2190-OpenSSL-ALPN/2190} (100%) create mode 100644 test/scripts/2190-OpenSSL-ALPN/REQUIRES diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 2687f6048..fef3dfce6 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -29953,7 +29953,8 @@ depends on the behavious of the peer (not all peers can send a feature-specific TLS Alert). This feature is available when Exim is built with -OpenSSL 1.1.0 or later or GnuTLS 3.2.0 or later. +OpenSSL 1.1.0 or later or GnuTLS 3.2.0 or later; +the macro _HAVE_TLS_ALPN will be defined when this is so. .wen diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c index f63a8375b..b9f8d2a51 100644 --- a/src/src/tls-gnu.c +++ b/src/src/tls-gnu.c @@ -154,6 +154,9 @@ builtin_macro_create(US"_HAVE_TLS_OCSP_LIST"); #if defined(EXIM_HAVE_INOTIFY) || defined(EXIM_HAVE_KEVENT) builtin_macro_create(US"_HAVE_TLS_CA_CACHE"); # endif +# ifdef EXIM_HAVE_ALPN +builtin_macro_create(US"_HAVE_TLS_ALPN"); +# endif } #else diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index d9ec82dc2..5bf6a6002 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -307,6 +307,9 @@ builtin_macro_create(US"_TLS_BAD_MULTICERT_IN_OURCERT"); builtin_macro_create(US"_HAVE_TLS_OCSP"); builtin_macro_create(US"_HAVE_TLS_OCSP_LIST"); # endif +# ifdef EXIM_HAVE_ALPN +builtin_macro_create(US"_HAVE_TLS_ALPN"); +# endif } #else diff --git a/test/confs/1115 b/test/confs/1190 similarity index 96% rename from test/confs/1115 rename to test/confs/1190 index c1d571821..c65bf5b0c 100644 --- a/test/confs/1115 +++ b/test/confs/1190 @@ -1,4 +1,4 @@ -# Exim test configuration 1115 +# Exim test configuration 1190 # ALPN SERVER = diff --git a/test/confs/2038 b/test/confs/2038 deleted file mode 120000 index 03a524df8..000000000 --- a/test/confs/2038 +++ /dev/null @@ -1 +0,0 @@ -1115 \ No newline at end of file diff --git a/test/confs/2090 b/test/confs/2090 new file mode 120000 index 000000000..e55dbc5cd --- /dev/null +++ b/test/confs/2090 @@ -0,0 +1 @@ +1190 \ No newline at end of file diff --git a/test/confs/2138 b/test/confs/2138 deleted file mode 120000 index 03a524df8..000000000 --- a/test/confs/2138 +++ /dev/null @@ -1 +0,0 @@ -1115 \ No newline at end of file diff --git a/test/confs/2190 b/test/confs/2190 new file mode 120000 index 000000000..e55dbc5cd --- /dev/null +++ b/test/confs/2190 @@ -0,0 +1 @@ +1190 \ No newline at end of file diff --git a/test/log/1115 b/test/log/1190 similarity index 100% rename from test/log/1115 rename to test/log/1190 diff --git a/test/log/2038 b/test/log/2090 similarity index 100% rename from test/log/2038 rename to test/log/2090 diff --git a/test/log/2138 b/test/log/2190 similarity index 100% rename from test/log/2138 rename to test/log/2190 diff --git a/test/scripts/1100-Basic-TLS/1115 b/test/scripts/1190-TLS-ALPN/1190 similarity index 100% rename from test/scripts/1100-Basic-TLS/1115 rename to test/scripts/1190-TLS-ALPN/1190 diff --git a/test/scripts/1190-TLS-ALPN/REQUIRES b/test/scripts/1190-TLS-ALPN/REQUIRES new file mode 100644 index 000000000..44d5cc0cb --- /dev/null +++ b/test/scripts/1190-TLS-ALPN/REQUIRES @@ -0,0 +1 @@ +feature _HAVE_TLS_ALPN diff --git a/test/scripts/2000-GnuTLS/2038 b/test/scripts/2090-GnuTLS-ALPN/2090 similarity index 100% rename from test/scripts/2000-GnuTLS/2038 rename to test/scripts/2090-GnuTLS-ALPN/2090 diff --git a/test/scripts/2090-GnuTLS-ALPN/REQUIRES b/test/scripts/2090-GnuTLS-ALPN/REQUIRES new file mode 100644 index 000000000..878f1a3c0 --- /dev/null +++ b/test/scripts/2090-GnuTLS-ALPN/REQUIRES @@ -0,0 +1,3 @@ +support GnuTLS +running IPv4 +feature _HAVE_TLS_ALPN diff --git a/test/scripts/2100-OpenSSL/2138 b/test/scripts/2190-OpenSSL-ALPN/2190 similarity index 100% rename from test/scripts/2100-OpenSSL/2138 rename to test/scripts/2190-OpenSSL-ALPN/2190 diff --git a/test/scripts/2190-OpenSSL-ALPN/REQUIRES b/test/scripts/2190-OpenSSL-ALPN/REQUIRES new file mode 100644 index 000000000..d97fd9744 --- /dev/null +++ b/test/scripts/2190-OpenSSL-ALPN/REQUIRES @@ -0,0 +1,3 @@ +support OpenSSL +running IPv4 +feature _HAVE_TLS_ALPN -- 2.30.2