From 4ba80f827f9e788ab6189a478ddc43311f967fb1 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Fri, 28 Aug 2020 06:53:53 +0000 Subject: [PATCH] Allow to build against contemporary versions of OpenSSL. --- net-im/climm/Makefile | 5 ---- net-im/climm/files/patch-src_io_io__openssl.c | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 net-im/climm/files/patch-src_io_io__openssl.c diff --git a/net-im/climm/Makefile b/net-im/climm/Makefile index 5929d02cf1b7..573d74525011 100644 --- a/net-im/climm/Makefile +++ b/net-im/climm/Makefile @@ -25,11 +25,6 @@ XMPP_DESC= Enable XMPP Jabber support .include -.if ${SSL_DEFAULT} == base -BROKEN_FreeBSD_12= incomplete definition of type 'struct dh_st' -BROKEN_FreeBSD_13= incomplete definition of type 'struct dh_st' -.endif - .if ${PORT_OPTIONS:MOTR} CPPFLAGS+= -I${LOCALBASE}/include CONFIGURE_ARGS+= --enable-otr diff --git a/net-im/climm/files/patch-src_io_io__openssl.c b/net-im/climm/files/patch-src_io_io__openssl.c new file mode 100644 index 000000000000..07e36c4cadd7 --- /dev/null +++ b/net-im/climm/files/patch-src_io_io__openssl.c @@ -0,0 +1,25 @@ +--- src/io/io_openssl.c.orig 2010-03-20 14:13:15 UTC ++++ src/io/io_openssl.c +@@ -96,10 +96,22 @@ static DH *get_dh512() + DH *dh; + + if ((dh=DH_new()) == NULL) return(NULL); ++#if OPENSSL_VERSION_NUMBER >= 0x10100005L ++ BIGNUM *p, *g; ++ ++ p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL); ++ g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL); ++ if (p == NULL || g == NULL) { ++ BN_free(p); BN_free(g); ++ DH_free(dh); return(NULL); ++ } else ++ DH_set0_pqg(dh, p, NULL, g); ++#else + dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL); + dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL); + if ((dh->p == NULL) || (dh->g == NULL)) + { DH_free(dh); return(NULL); } ++#endif + return(dh); + } + /* END AUTOGENERATED */