From 522cf716f8d84f1d491aa286542a322553ffa75f Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Mon, 20 Jul 2015 12:57:30 +0200 Subject: [PATCH] LibreSSL support: check for OPENSSL_NO_COMP --- CHANGES | 3 +++ sslcls.c | 2 +- sslcls.h | 2 +- xio-openssl.c | 4 ++-- xioopts.c | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 28cac7d..16b9b22 100644 --- a/CHANGES +++ b/CHANGES @@ -72,6 +72,9 @@ porting: AIX-7 uses an extended O_ACCMODE that does not fit socat's internal requirements. Thanks to Garrick Trowsdale for providing a patch + LibreSSL support: check for OPENSSL_NO_COMP + Thanks to Bernard Spil for providing a patch + testing: socks4echo.sh and socks4a-echo.sh hung with new bash with read -n diff --git a/sslcls.c b/sslcls.c index 1b54265..8964663 100644 --- a/sslcls.c +++ b/sslcls.c @@ -385,7 +385,7 @@ int sycFIPS_mode_set(int onoff) { } #endif /* WITH_FIPS */ -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl) { const COMP_METHOD *result; Debug1("SSL_get_current_compression(%p)", ssl); diff --git a/sslcls.h b/sslcls.h index d7b9ff6..7c3e226 100644 --- a/sslcls.h +++ b/sslcls.h @@ -55,7 +55,7 @@ BIO *sycBIO_new_file(const char *filename, const char *mode); int sycFIPS_mode_set(int onoff); -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) const COMP_METHOD *sycSSL_get_current_compression(SSL *ssl); const COMP_METHOD *sycSSL_get_current_expansion(SSL *ssl); const char *sycSSL_COMP_get_name(const COMP_METHOD *comp); diff --git a/xio-openssl.c b/xio-openssl.c index bd95ad2..c690ee4 100644 --- a/xio-openssl.c +++ b/xio-openssl.c @@ -110,7 +110,7 @@ const struct optdesc opt_openssl_cafile = { "openssl-cafile", "cafile", const struct optdesc opt_openssl_capath = { "openssl-capath", "capath", OPT_OPENSSL_CAPATH, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; const struct optdesc opt_openssl_egd = { "openssl-egd", "egd", OPT_OPENSSL_EGD, GROUP_OPENSSL, PH_SPEC, TYPE_FILENAME, OFUNC_SPEC }; const struct optdesc opt_openssl_pseudo = { "openssl-pseudo", "pseudo", OPT_OPENSSL_PSEUDO, GROUP_OPENSSL, PH_SPEC, TYPE_BOOL, OFUNC_SPEC }; -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) const struct optdesc opt_openssl_compress = { "openssl-compress", "compress", OPT_OPENSSL_COMPRESS, GROUP_OPENSSL, PH_SPEC, TYPE_STRING, OFUNC_SPEC }; #endif #if WITH_FIPS @@ -147,7 +147,7 @@ int xio_reset_fips_mode(void) { static void openssl_conn_loginfo(SSL *ssl) { Notice1("SSL connection using %s", SSL_get_cipher(ssl)); -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) { const COMP_METHOD *comp, *expansion; diff --git a/xioopts.c b/xioopts.c index 178842f..b65407c 100644 --- a/xioopts.c +++ b/xioopts.c @@ -296,7 +296,7 @@ const struct optname optionnames[] = { #if WITH_EXT2 && defined(EXT2_COMPR_FL) IF_ANY ("compr", &opt_ext2_compr) #endif -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) IF_OPENSSL("compress", &opt_openssl_compress) #endif #ifdef TCP_CONN_ABORT_THRESHOLD /* HP_UX */ @@ -1098,7 +1098,7 @@ const struct optname optionnames[] = { IF_OPENSSL("openssl-certificate", &opt_openssl_certificate) IF_OPENSSL("openssl-cipherlist", &opt_openssl_cipherlist) IF_OPENSSL("openssl-commonname", &opt_openssl_commonname) -#if OPENSSL_VERSION_NUMBER >= 0x00908000L +#if OPENSSL_VERSION_NUMBER >= 0x00908000L && !defined(OPENSSL_NO_COMP) IF_OPENSSL("openssl-compress", &opt_openssl_compress) #endif IF_OPENSSL("openssl-dhparam", &opt_openssl_dhparam)