Allow to build against contemporary versions of OpenSSL.

This commit is contained in:
Alexey Dokuchaev 2020-08-28 06:53:53 +00:00
parent fdf265074b
commit 4ba80f827f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=546708
2 changed files with 25 additions and 5 deletions

View File

@ -25,11 +25,6 @@ XMPP_DESC= Enable XMPP Jabber support
.include <bsd.port.options.mk>
.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

View File

@ -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 */