diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-06-30 09:49:25 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-06-30 09:49:25 +0000 |
commit | 2a151b217745b2361d40b326ecdf1c335fcc1258 (patch) | |
tree | 1356ad6dea1f1d28ec7c3eca9f3233baade2b16a /devel | |
parent | 621ca8a23515719c685f95f885c94f01d21d0d44 (diff) | |
download | ports-2a151b217745b2361d40b326ecdf1c335fcc1258.tar.gz ports-2a151b217745b2361d40b326ecdf1c335fcc1258.zip |
Notes
Diffstat (limited to 'devel')
-rw-r--r-- | devel/ucommon/Makefile | 12 | ||||
-rw-r--r-- | devel/ucommon/files/patch-openssl_cipher.cpp | 28 | ||||
-rw-r--r-- | devel/ucommon/files/patch-openssl_digest.cpp | 46 | ||||
-rw-r--r-- | devel/ucommon/files/patch-openssl_hmac.cpp | 29 |
4 files changed, 104 insertions, 11 deletions
diff --git a/devel/ucommon/Makefile b/devel/ucommon/Makefile index 33fd3dbd22b5..066c4b7bf2dc 100644 --- a/devel/ucommon/Makefile +++ b/devel/ucommon/Makefile @@ -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 <bsd.port.pre.mk> - -.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 <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/devel/ucommon/files/patch-openssl_cipher.cpp b/devel/ucommon/files/patch-openssl_cipher.cpp new file mode 100644 index 000000000000..87f9db0b237b --- /dev/null +++ b/devel/ucommon/files/patch-openssl_cipher.cpp @@ -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); + } diff --git a/devel/ucommon/files/patch-openssl_digest.cpp b/devel/ucommon/files/patch-openssl_digest.cpp new file mode 100644 index 000000000000..ded8beb8b8f7 --- /dev/null +++ b/devel/ucommon/files/patch-openssl_digest.cpp @@ -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; diff --git a/devel/ucommon/files/patch-openssl_hmac.cpp b/devel/ucommon/files/patch-openssl_hmac.cpp new file mode 100644 index 000000000000..943230260c99 --- /dev/null +++ b/devel/ucommon/files/patch-openssl_hmac.cpp @@ -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; + } + |