summaryrefslogtreecommitdiff
path: root/net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2019-11-27 17:04:00 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2019-11-27 17:04:00 +0000
commitf231709c64f745cd2185b92976b56c198b932a32 (patch)
tree3b7e20a4d21032c2dc5ea1e6afb724511420e291 /net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp
parentUpdate to 6.8.5 (diff)
- Allow to build against contemporary versions of OpenSSL and set
missing INSTALLS_ICONS as reported by portlint(1) - Revert WITH_DEBUG part of the r512774 as explained by mat@: WITH_DEBUG means the port will be built with debugging symbols and will not be stripped. So before, if WITH_DEBUG was set, it was built with all debugging bells and whistles. Now, it only adds debug=1 to MAKE_ARGS, and it gets stripped in the end. WITH_DEBUG must not be set by port options, it is a user-facing variable. PR: 233972
Diffstat (limited to 'net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp')
-rw-r--r--net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp b/net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp
new file mode 100644
index 000000000000..3584893ee6af
--- /dev/null
+++ b/net-p2p/linuxdcpp/files/patch-dcpp_CryptoManager.cpp
@@ -0,0 +1,26 @@
+--- dcpp/CryptoManager.cpp.orig 2011-04-17 17:57:09 UTC
++++ dcpp/CryptoManager.cpp
+@@ -107,12 +107,20 @@ CryptoManager::CryptoManager()
+ };
+
+ if(dh) {
+- dh->p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0);
+- dh->g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0);
++ BIGNUM *p, *g;
+
+- if (!dh->p || !dh->g) {
++ p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0);
++ g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0);
++
++ if (!p || !g) {
+ dh.reset();
+ } else {
++#if OPENSSL_VERSION_NUMBER < 0x10100005L
++ dh->p = p;
++ dh->g = g;
++#else
++ DH_set0_pqg(dh, p, NULL, g);
++#endif
+ SSL_CTX_set_options(serverContext, SSL_OP_SINGLE_DH_USE);
+ SSL_CTX_set_options(serverVerContext, SSL_OP_SINGLE_DH_USE);
+ SSL_CTX_set_tmp_dh(serverContext, (DH*)dh);