]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: SSL: fine guard for SSL_CTX_add_server_custom_ext call
authorIlya Shipitsin <chipitsine@gmail.com>
Thu, 26 Nov 2020 21:39:48 +0000 (02:39 +0500)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 15 Dec 2020 15:13:35 +0000 (16:13 +0100)
SSL_CTX_add_server_custom_ext is openssl specific function present
since openssl-1.0.2, let us define readable guard for it, not depending
on HA_OPENSSL_VERSION

include/haproxy/openssl-compat.h
src/ssl_sock.c

index 42349d7c11a815b78458e321bb7e1d5ade8955fa..564d1ea783be9d09caa8d1319e316fac0db05f57 100644 (file)
 #define HAVE_SSL_CTX_SET_CIPHERSUITES
 #endif
 
+#if ((OPENSSL_VERSION_NUMBER >= 0x1000200fL) && !defined(OPENSSL_NO_TLSEXT) && !defined(LIBRESSL_VERSION_NUMBER) && !defined(OPENSSL_IS_BORINGSSL))
+#define HAVE_SL_CTX_ADD_SERVER_CUSTOM_EXT
+#endif
+
 #if (HA_OPENSSL_VERSION_NUMBER < 0x0090800fL)
 /* Functions present in OpenSSL 0.9.8, older not tested */
 static inline const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *sess, unsigned int *sid_length)
index 732f58605331e96e587010ef3f3c587d7f1bdc1d..9bb1d1cb4b9a53c0c5dd7e1267a864daf95100c8 100644 (file)
@@ -1495,7 +1495,7 @@ static int ssl_sock_load_ocsp(SSL_CTX *ctx, const struct cert_key_and_chain *ckc
 #endif
 
 
-#if (HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined OPENSSL_NO_TLSEXT && !defined OPENSSL_IS_BORINGSSL)
+#ifdef HAVE_SL_CTX_ADD_SERVER_CUSTOM_EXT
 
 #define CT_EXTENSION_TYPE 18
 
@@ -3168,7 +3168,7 @@ static int ssl_sock_put_ckch_into_ctx(const char *path, const struct cert_key_an
        }
 #endif
 
-#if (HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL && !defined OPENSSL_NO_TLSEXT && !defined OPENSSL_IS_BORINGSSL)
+#ifdef HAVE_SL_CTX_ADD_SERVER_CUSTOM_EXT
        if (sctl_ex_index >= 0 && ckch->sctl) {
                if (ssl_sock_load_sctl(ctx, ckch->sctl) < 0) {
                        memprintf(err, "%s '%s.sctl' is present but cannot be read or parsed'.\n",