From 69be3d82ef17ef93a988bc85734151f74f5e338e Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Sun, 14 Aug 2016 22:46:04 +0200 Subject: [PATCH] znc: fix compilation without ssl compression Update Csocket to a newer version with compile fixes for OpenSSL with disabled compression support. Since we don't get zlib as an transitive dependency anymore, also add zlib as an explicit dependency. Signed-off-by: Jonas Gorski --- net/znc/Makefile | 4 +- ...socket-Add-some-ifdef-feature-checks.patch | 71 +++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch diff --git a/net/znc/Makefile b/net/znc/Makefile index 47ef2c903..4fa31c468 100644 --- a/net/znc/Makefile +++ b/net/znc/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=znc PKG_VERSION:=1.6.3 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://znc.in/releases \ @@ -35,7 +35,7 @@ endef define Package/znc $(Package/znc/default) - DEPENDS:=+libopenssl +libpthread +libstdcpp +ZNC_ICU:icu + DEPENDS:=+libopenssl +libpthread +libstdcpp +ZNC_ICU:icu +zlib MENU:=1 endef diff --git a/net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch b/net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch new file mode 100644 index 000000000..a0dbe015a --- /dev/null +++ b/net/znc/patches/103-Csocket-Add-some-ifdef-feature-checks.patch @@ -0,0 +1,71 @@ +From d81a18d87d15bbf54ddbd675bfa829cf7dfdce9e Mon Sep 17 00:00:00 2001 +From: Edoardo Spadolini +Date: Mon, 8 Feb 2016 14:01:51 +0100 +Subject: [PATCH] Add some #ifdef feature checks to fix compilation with + BoringSSL + +--- + Csocket.cc | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/src/Csocket.cpp ++++ b/src/Csocket.cpp +@@ -45,9 +45,12 @@ + + #ifdef HAVE_LIBSSL + #include ++#include + #include + #include ++#ifndef OPENSSL_NO_COMP + #include ++#endif + #endif /* HAVE_LIBSSL */ + + #ifdef HAVE_ICU +@@ -531,8 +534,12 @@ void ShutdownCsocket() + { + #ifdef HAVE_LIBSSL + ERR_remove_state( 0 ); ++#ifndef OPENSSL_NO_ENGINE + ENGINE_cleanup(); ++#endif ++#ifndef OPENSSL_IS_BORINGSSL + CONF_modules_unload( 1 ); ++#endif + ERR_free_strings(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); +@@ -573,6 +580,7 @@ bool InitSSL( ECompType eCompressionType + } + #endif /* _WIN32 */ + ++#ifndef OPENSSL_NO_COMP + COMP_METHOD *cm = NULL; + + if( CT_ZLIB & eCompressionType ) +@@ -588,6 +596,7 @@ bool InitSSL( ECompType eCompressionType + if( cm ) + SSL_COMP_add_compression_method( CT_RLE, cm ); + } ++#endif + + // setting this up once in the begining + s_iCsockSSLIdx = SSL_get_ex_new_index( 0, NULL, NULL, NULL, NULL ); +@@ -1724,6 +1733,8 @@ SSL_CTX * Csock::SetupServerCTX() + #ifndef OPENSSL_NO_ECDH + // Errors for the following block are non-fatal (ECDHE is nice to have + // but not a requirement) ++#ifndef OPENSSL_IS_BORINGSSL ++ // BoringSSL does this thing automatically + #if defined( SSL_CTX_set_ecdh_auto ) + // Auto-select sensible curve + if( !SSL_CTX_set_ecdh_auto( pCTX , 1 ) ) +@@ -1742,6 +1753,7 @@ SSL_CTX * Csock::SetupServerCTX() + ERR_clear_error(); + } + #endif /* SSL_CTX_set_tmp_ecdh */ ++#endif /* !OPENSSL_IS_BORINGSSL */ + #endif /* OPENSSL_NO_ECDH */ + + if( !ConfigureCTXOptions( pCTX ) )