]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: ssl: fix latest LibreSSL reg-test error
authorIlya Shipitsin <chipitsine@gmail.com>
Sat, 25 May 2019 14:30:50 +0000 (19:30 +0500)
committerWilly Tarreau <w@1wt.eu>
Sun, 26 May 2019 19:26:02 +0000 (21:26 +0200)
starting with OpenSSL 1.0.0 recommended way to disable compression is
using SSL_OP_NO_COMPRESSION when creating context.

manipulations with SSL_COMP_get_compression_methods, sk_SSL_COMP_num
are only required for OpenSSL < 1.0.0

src/ssl_sock.c

index 4a0ad76847271ed3b0cf168ff5c22125a903f671..6f62375ac4e25fce8453a67cf3c0577769492667 100644 (file)
@@ -9701,8 +9701,10 @@ static void ssl_sock_capture_free_func(void *parent, void *ptr, CRYPTO_EX_DATA *
 __attribute__((constructor))
 static void __ssl_sock_init(void)
 {
+#if (!defined(OPENSSL_NO_COMP) && !defined(SSL_OP_NO_COMPRESSION))
        STACK_OF(SSL_COMP)* cm;
        int n;
+#endif
 
        if (global_ssl.listen_default_ciphers)
                global_ssl.listen_default_ciphers = strdup(global_ssl.listen_default_ciphers);
@@ -9719,11 +9721,13 @@ static void __ssl_sock_init(void)
 #if HA_OPENSSL_VERSION_NUMBER < 0x10100000L
        SSL_library_init();
 #endif
+#if (!defined(OPENSSL_NO_COMP) && !defined(SSL_OP_NO_COMPRESSION))
        cm = SSL_COMP_get_compression_methods();
        n = sk_SSL_COMP_num(cm);
        while (n--) {
                (void) sk_SSL_COMP_pop(cm);
        }
+#endif
 
 #if defined(USE_THREAD) && (HA_OPENSSL_VERSION_NUMBER < 0x10100000L)
        ssl_locking_init();