git: 27ee864485ef - main - devel/cbang: upgrade to 1.7.1
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 01 Oct 2022 15:14:49 UTC
The branch main has been updated by thierry: URL: https://cgit.FreeBSD.org/ports/commit/?id=27ee864485efe8a692d4916f8fc8ed1a89ccf44e commit 27ee864485efe8a692d4916f8fc8ed1a89ccf44e Author: Thierry Thomas <thierry@FreeBSD.org> AuthorDate: 2022-10-01 15:10:27 +0000 Commit: Thierry Thomas <thierry@FreeBSD.org> CommitDate: 2022-10-01 15:10:27 +0000 devel/cbang: upgrade to 1.7.1 This includes the patches related to OpenSSL: see <https://github.com/CauldronDevelopmentLLC/cbang/issues/101#issuecomment-1263876852> Also bump compiler to c++17-lang as noticed by diizzy@. --- devel/cbang/Makefile | 4 +- devel/cbang/distinfo | 6 +- devel/cbang/files/patch-src_cbang_openssl_BigNum.h | 10 -- .../files/patch-src_cbang_openssl_KeyContext.cpp | 22 ---- .../files/patch-src_cbang_openssl_KeyPair.cpp | 142 --------------------- 5 files changed, 5 insertions(+), 179 deletions(-) diff --git a/devel/cbang/Makefile b/devel/cbang/Makefile index 47dde6ce3bdb..4ac7414c420c 100644 --- a/devel/cbang/Makefile +++ b/devel/cbang/Makefile @@ -1,5 +1,5 @@ PORTNAME= cbang -PORTVERSION= 1.7.0 +PORTVERSION= 1.7.1 CATEGORIES= devel MAINTAINER= thierry@FreeBSD.org @@ -22,7 +22,7 @@ LIB_DEPENDS= libv8.so:lang/v8 \ USE_GITHUB= yes GH_ACCOUNT= CauldronDevelopmentLLC -USES= compiler:c++14-lang localbase mysql:client python:test scons \ +USES= compiler:c++17-lang localbase mysql:client python:test scons \ sqlite ssl USE_LDCONFIG= yes diff --git a/devel/cbang/distinfo b/devel/cbang/distinfo index 41b6d6c20c4a..3e503cc02cac 100644 --- a/devel/cbang/distinfo +++ b/devel/cbang/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1664451834 -SHA256 (CauldronDevelopmentLLC-cbang-1.7.0_GH0.tar.gz) = 2f467928f949e27aa28a4355b9c3019a3b3c727f98e75fee88b5524dfdb7c868 -SIZE (CauldronDevelopmentLLC-cbang-1.7.0_GH0.tar.gz) = 4800847 +TIMESTAMP = 1664634579 +SHA256 (CauldronDevelopmentLLC-cbang-1.7.1_GH0.tar.gz) = 7bde42ededfe3294688f6c9ba673d3e10b4b46ba5eea9c3125cc56c4f540448e +SIZE (CauldronDevelopmentLLC-cbang-1.7.1_GH0.tar.gz) = 4801398 diff --git a/devel/cbang/files/patch-src_cbang_openssl_BigNum.h b/devel/cbang/files/patch-src_cbang_openssl_BigNum.h deleted file mode 100644 index e7667d6a6a34..000000000000 --- a/devel/cbang/files/patch-src_cbang_openssl_BigNum.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/cbang/openssl/BigNum.h.orig 2022-09-17 22:00:36 UTC -+++ src/cbang/openssl/BigNum.h -@@ -48,6 +48,7 @@ namespace cb { - ~BigNum(); - - BIGNUM *get() const {return bn;} -+ BIGNUM *adopt() {deallocate = false; return bn;} - bool isNull() const {return !bn;} - unsigned size() const; - std::string toBinString() const; diff --git a/devel/cbang/files/patch-src_cbang_openssl_KeyContext.cpp b/devel/cbang/files/patch-src_cbang_openssl_KeyContext.cpp deleted file mode 100644 index cb151817d4fb..000000000000 --- a/devel/cbang/files/patch-src_cbang_openssl_KeyContext.cpp +++ /dev/null @@ -1,22 +0,0 @@ ---- src/cbang/openssl/KeyContext.cpp.orig 2022-09-17 22:00:36 UTC -+++ src/cbang/openssl/KeyContext.cpp -@@ -121,8 +121,18 @@ void KeyContext::setRSAPubExp(uint64_t exp) { - BigNum num; - num.set(exp); - -- if (EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, num.get()) <= 0) -+#if OPENSSL_VERSION_NUMBER < 0x3000000fL -+ int ret = EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, num.get()); -+#else -+ int ret = EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, num.get()); -+#endif -+ -+ if (ret <= 0) - THROW("Failed to set RSA public exponent: " << SSL::getErrorStr()); -+ -+#if OPENSSL_VERSION_NUMBER < 0x3000000fL -+ num.adopt(); // Don't deallocate -+#endif - } - - diff --git a/devel/cbang/files/patch-src_cbang_openssl_KeyPair.cpp b/devel/cbang/files/patch-src_cbang_openssl_KeyPair.cpp deleted file mode 100644 index 3475015186bd..000000000000 --- a/devel/cbang/files/patch-src_cbang_openssl_KeyPair.cpp +++ /dev/null @@ -1,142 +0,0 @@ ---- src/cbang/openssl/KeyPair.cpp.orig 2022-09-17 22:00:36 UTC -+++ src/cbang/openssl/KeyPair.cpp -@@ -54,7 +54,10 @@ - #include <openssl/dh.h> - #include <openssl/engine.h> - #include <openssl/opensslv.h> -+ -+#if 0x3000000fL <= OPENSSL_VERSION_NUMBER - #include <openssl/core_names.h> -+#endif - - #include <string.h> - -@@ -127,21 +130,44 @@ BigNum KeyPair::getParam(const char *id) const { - - - BigNum KeyPair::getParam(const char *id) const { -+#if 0x3000000fL <= OPENSSL_VERSION_NUMBER - BIGNUM *param = 0; - EVP_PKEY_get_bn_param(key, id, ¶m); - return BigNum(param, true); -+ -+#else -+ THROW(__func__ << "() not supported with OpenSSL < v3.0"); -+#endif - } - - - BigNum KeyPair::getRSA_E() const { - if (!isRSA()) THROW("Not an RSA key"); -+ -+#if 0x3000000fL <= OPENSSL_VERSION_NUMBER - return getParam(OSSL_PKEY_PARAM_RSA_E); -+ -+#else -+ const BIGNUM *e; -+ RSA_get0_key(EVP_PKEY_get0_RSA(key), 0, &e, 0); -+ if (!e) THROW("RSA E not set"); -+ return BigNum(e); -+#endif - } - - - BigNum KeyPair::getRSA_N() const { - if (!isRSA()) THROW("Not an RSA key"); -+ -+#if 0x3000000fL <= OPENSSL_VERSION_NUMBER - return getParam(OSSL_PKEY_PARAM_RSA_N); -+ -+#else -+ const BIGNUM *n; -+ RSA_get0_key(EVP_PKEY_get0_RSA(key), &n, 0, 0); -+ if (!n) THROW("RSA N not set"); -+ return BigNum(n); -+#endif - } - - -@@ -154,14 +180,36 @@ BigNum KeyPair::getPublic() const { - case EVP_PKEY_EC: return EC_KEY_get0_public_key(key->pkey.ec); - } - --#else // OPENSSL_VERSION_NUMBER < 0x1010000fL -+#elif OPENSSL_VERSION_NUMBER < 0x3000000fL -+ const BIGNUM *n = 0; -+ - switch (EVP_PKEY_base_id(key)) { -+ case EVP_PKEY_RSA: RSA_get0_key(EVP_PKEY_get0_RSA(key), 0, &n, 0); return n; -+ case EVP_PKEY_DSA: DSA_get0_key(EVP_PKEY_get0_DSA(key), &n, 0); return n; -+ case EVP_PKEY_DH: DH_get0_key(EVP_PKEY_get0_DH(key), &n, 0); return n; -+ case EVP_PKEY_EC: { -+ const EC_KEY *ec = EVP_PKEY_get0_EC_KEY(key); -+ const EC_POINT *pt = EC_KEY_get0_public_key(ec); -+ const EC_GROUP *group = EC_KEY_get0_group(ec); -+ point_conversion_form_t form = EC_KEY_get_conv_form(ec); -+ -+ if (pt && group) { -+ BIGNUM *n = BN_new(); -+ EC_POINT_point2bn(group, pt, form, n, 0); -+ return BigNum(n, true); -+ } -+ return n; -+ } -+ } -+ -+#else -+ switch (EVP_PKEY_base_id(key)) { - case EVP_PKEY_RSA: return getParam(OSSL_PKEY_PARAM_RSA_E); - case EVP_PKEY_DSA: - case EVP_PKEY_DH: return getParam(OSSL_PKEY_PARAM_PUB_KEY); - case EVP_PKEY_EC: break; // Cannot get EC pub key as a BigNum - } --#endif // OPENSSL_VERSION_NUMBER < 0x1010000fL -+#endif - - THROW("Invalid key type"); - } -@@ -176,14 +224,24 @@ BigNum KeyPair::getPrivate() const { - case EVP_PKEY_EC: return EC_KEY_get0_private_key(key->pkey.ec); - } - --#else // OPENSSL_VERSION_NUMBER < 0x1010000fL -+#elif OPENSSL_VERSION_NUMBER < 0x3000000fL -+ const BIGNUM *n = 0; -+ - switch (EVP_PKEY_base_id(key)) { -+ case EVP_PKEY_RSA: RSA_get0_key(EVP_PKEY_get0_RSA(key), 0, 0, &n); return n; -+ case EVP_PKEY_DSA: DSA_get0_key(EVP_PKEY_get0_DSA(key), 0, &n); return n; -+ case EVP_PKEY_DH: DH_get0_key(EVP_PKEY_get0_DH(key), 0, &n); return n; -+ case EVP_PKEY_EC: return EC_KEY_get0_private_key(EVP_PKEY_get0_EC_KEY(key)); -+ } -+ -+#else -+ switch (EVP_PKEY_base_id(key)) { - case EVP_PKEY_RSA: return getParam(OSSL_PKEY_PARAM_RSA_D); - case EVP_PKEY_DSA: - case EVP_PKEY_DH: - case EVP_PKEY_EC: return getParam(OSSL_PKEY_PARAM_PRIV_KEY); - } --#endif // OPENSSL_VERSION_NUMBER < 0x1010000fL -+#endif - - THROW("Invalid key type"); - } -@@ -197,8 +255,15 @@ bool KeyPair::match(const KeyPair &o) const { - - - bool KeyPair::match(const KeyPair &o) const { -- switch (EVP_PKEY_eq(key, o.key)) { -- case 0: case -1: return false; -+#if 0x3000000fL <= OPENSSL_VERSION_NUMBER -+ int ret = EVP_PKEY_eq(key, o.key); -+ if (ret == -1) ret = 0; -+#else -+ int ret = EVP_PKEY_cmp(key, o.key); -+#endif -+ -+ switch (ret) { -+ case 0: return false; - case 1: return true; - default: THROW("Error comparing keys: " << SSL::getErrorStr()); - }