From owner-svn-ports-all@freebsd.org Tue Jun 30 09:49:26 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B617136498A; Tue, 30 Jun 2020 09:49:26 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49x01y4NNlz4Bfr; Tue, 30 Jun 2020 09:49:26 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 616AC1650E; Tue, 30 Jun 2020 09:49:26 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05U9nQei088455; Tue, 30 Jun 2020 09:49:26 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05U9nPTh088451; Tue, 30 Jun 2020 09:49:25 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <202006300949.05U9nPTh088451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Tue, 30 Jun 2020 09:49:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r540884 - in head/devel/ucommon: . files X-SVN-Group: ports-head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: in head/devel/ucommon: . files X-SVN-Commit-Revision: 540884 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2020 09:49:26 -0000 Author: danfe Date: Tue Jun 30 09:49:25 2020 New Revision: 540884 URL: https://svnweb.freebsd.org/changeset/ports/540884 Log: Allow to build against contemporary versions of OpenSSL. PR: 229027 Added: head/devel/ucommon/files/patch-openssl_cipher.cpp (contents, props changed) head/devel/ucommon/files/patch-openssl_digest.cpp (contents, props changed) head/devel/ucommon/files/patch-openssl_hmac.cpp (contents, props changed) Modified: head/devel/ucommon/Makefile Modified: head/devel/ucommon/Makefile ============================================================================== --- head/devel/ucommon/Makefile Tue Jun 30 09:48:30 2020 (r540883) +++ head/devel/ucommon/Makefile Tue Jun 30 09:49:25 2020 (r540884) @@ -13,23 +13,13 @@ COMMENT= Very lightweight C++ design pattern library LICENSE= LGPL3 LICENSE_FILE= ${WRKSRC}/COPYING.LESSER -BROKEN_SSL= openssl -BROKEN_SSL_REASON_openssl= error: allocation of incomplete type 'EVP_CIPHER_CTX' - USES= compiler:c++11-lib cmake pathfix pkgconfig ssl CMAKE_ARGS= -DBUILD_TESTING:BOOL=ON \ -DCMAKE_INSTALL_BINDIR:STRING=bin/${PORTNAME} USE_LDCONFIG= yes TEST_TARGET= test -.include - -.if ${SSL_DEFAULT} == base -BROKEN_FreeBSD_12= error: allocation of incomplete type 'EVP_CIPHER_CTX' (aka 'evp_cipher_ctx_st') -BROKEN_FreeBSD_13= error: allocation of incomplete type 'EVP_CIPHER_CTX' (aka 'evp_cipher_ctx_st') -.endif - post-install: ${INSTALL_DATA} ${BUILD_WRKSRC}/ucommon-config.h ${STAGEDIR}${PREFIX}/include/ucommon -.include +.include Added: head/devel/ucommon/files/patch-openssl_cipher.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/ucommon/files/patch-openssl_cipher.cpp Tue Jun 30 09:49:25 2020 (r540884) @@ -0,0 +1,28 @@ +--- openssl/cipher.cpp.orig 2015-10-11 02:32:36 UTC ++++ openssl/cipher.cpp +@@ -107,8 +107,12 @@ void Cipher::release(void) + { + keys.clear(); + if(context) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ EVP_CIPHER_CTX_free((EVP_CIPHER_CTX*)context); ++#else + EVP_CIPHER_CTX_cleanup((EVP_CIPHER_CTX*)context); + delete (EVP_CIPHER_CTX*)context; ++#endif + context = NULL; + } + } +@@ -125,8 +129,12 @@ void Cipher::set(const key_t key, mode_t mode, uint8_t + if(!keys.keysize) + return; + ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ context = EVP_MD_CTX_new(); ++#else + context = new EVP_CIPHER_CTX; + EVP_CIPHER_CTX_init((EVP_CIPHER_CTX *)context); ++#endif + EVP_CipherInit_ex((EVP_CIPHER_CTX *)context, (EVP_CIPHER *)keys.algotype, NULL, keys.keybuf, keys.ivbuf, (int)mode); + EVP_CIPHER_CTX_set_padding((EVP_CIPHER_CTX *)context, 0); + } Added: head/devel/ucommon/files/patch-openssl_digest.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/ucommon/files/patch-openssl_digest.cpp Tue Jun 30 09:49:25 2020 (r540884) @@ -0,0 +1,46 @@ +--- openssl/digest.cpp.orig 2015-10-11 02:32:36 UTC ++++ openssl/digest.cpp +@@ -37,20 +37,30 @@ void Digest::set(const char *type) + + hashtype = (void *)EVP_get_digestbyname(type); + if(hashtype) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ context = EVP_MD_CTX_new(); ++#else + context = new EVP_MD_CTX; + EVP_MD_CTX_init((EVP_MD_CTX *)context); ++#endif + EVP_DigestInit_ex((EVP_MD_CTX *)context, (const EVP_MD *)hashtype, NULL); + } + } + + void Digest::release(void) + { ++#if OPENSSL_VERSION_NUMBER < 0x10100005L + if(context) + EVP_MD_CTX_cleanup((EVP_MD_CTX *)context); ++#endif + + if(context) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ EVP_MD_CTX_free((EVP_MD_CTX *)context); ++#else + memset(context, 0, sizeof(EVP_MD_CTX)); + delete (EVP_MD_CTX *)context; ++#endif + context = NULL; + } + +@@ -71,8 +81,12 @@ void Digest::reset(void) + { + if(!context) { + if(hashtype) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ context = EVP_MD_CTX_new(); ++#else + context = new EVP_MD_CTX; + EVP_MD_CTX_init((EVP_MD_CTX *)context); ++#endif + } + else + return; Added: head/devel/ucommon/files/patch-openssl_hmac.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/ucommon/files/patch-openssl_hmac.cpp Tue Jun 30 09:49:25 2020 (r540884) @@ -0,0 +1,29 @@ +--- openssl/hmac.cpp.orig 2015-10-11 02:32:36 UTC ++++ openssl/hmac.cpp +@@ -35,8 +35,12 @@ void HMAC::set(const char *digest, const secure::keyby + + hmactype = EVP_get_digestbyname(digest); + if(hmactype && len) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ context = HMAC_CTX_new(); ++#else + context = new ::HMAC_CTX; + HMAC_CTX_init((HMAC_CTX *)context); ++#endif + HMAC_Init((HMAC_CTX *)context, *key, (int)len, (const EVP_MD *)hmactype); + } + } +@@ -44,9 +48,13 @@ void HMAC::set(const char *digest, const secure::keyby + void HMAC::release(void) + { + if(context) { ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ HMAC_CTX_free((HMAC_CTX *)context); ++#else + HMAC_cleanup((HMAC_CTX *)context); + memset(context, 0, sizeof(HMAC_CTX)); + delete (HMAC_CTX *)context; ++#endif + context = NULL; + } +