BUILD: ssl: guard Client Hello callbacks with HAVE_SSL_CLIENT_HELLO_CB macro instead...
authorIlya Shipitsin <chipitsine@gmail.com>
Fri, 22 Jan 2021 19:09:14 +0000 (00:09 +0500)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 22 Jan 2021 19:45:24 +0000 (20:45 +0100)
let us introduce new macro HAVE_SSL_CLIENT_HELLO_CB and guard
callback functions with it

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

index 3cba362..b4af429 100644 (file)
 #define HAVE_SSL_CTX_SET_CIPHERSUITES
 #endif
 
+#if (defined(SSL_CLIENT_HELLO_CB) || defined(OPENSSL_IS_BORINGSSL))
+#define HAVE_SSL_CLIENT_HELLO_CB
+#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
index ebfdb19..c52d991 100644 (file)
@@ -92,7 +92,7 @@ int ssl_sock_load_global_dh_param_from_file(const char *filename);
 void ssl_free_dh(void);
 #endif
 void ssl_free_engines(void);
-#if ((HA_OPENSSL_VERSION_NUMBER >= 0x10101000L) || defined(OPENSSL_IS_BORINGSSL))
+#ifdef HAVE_SSL_CLIENT_HELLO_CB
 int ssl_sock_switchctx_err_cbk(SSL *ssl, int *al, void *priv);
 #ifdef OPENSSL_IS_BORINGSSL
 int ssl_sock_switchctx_cbk(const struct ssl_early_callback_ctx *ctx);
index 611ecce..24a38e4 100644 (file)
@@ -2291,7 +2291,7 @@ static void ssl_sock_switchctx_set(SSL *ssl, SSL_CTX *ctx)
        SSL_set_SSL_CTX(ssl, ctx);
 }
 
-#if ((HA_OPENSSL_VERSION_NUMBER >= 0x10101000L) || defined(OPENSSL_IS_BORINGSSL))
+#ifdef HAVE_SSL_CLIENT_HELLO_CB
 
 int ssl_sock_switchctx_err_cbk(SSL *ssl, int *al, void *priv)
 {