git: 135861ca0d31 - main - security/sslsplit: Fix build with OpenSSL 3

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Fri, 15 Mar 2024 21:23:58 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=135861ca0d3119b359c0666ac3a8fcb893f4df9a

commit 135861ca0d3119b359c0666ac3a8fcb893f4df9a
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2024-03-15 21:23:11 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-03-15 21:23:45 +0000

    security/sslsplit: Fix build with OpenSSL 3
---
 security/sslsplit/Makefile              | 13 ++++---------
 security/sslsplit/distinfo              |  2 +-
 security/sslsplit/files/patch-pxyconn.c | 31 +++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/security/sslsplit/Makefile b/security/sslsplit/Makefile
index 155ac68ce36c..dcf46acc9232 100644
--- a/security/sslsplit/Makefile
+++ b/security/sslsplit/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	sslsplit
-PORTVERSION=	0.5.5
-PORTREVISION=	2
+DISTVERSION=	0.5.5
+PORTREVISION=	3
 CATEGORIES=	security
 MASTER_SITES=	http://mirror.roe.ch/rel/sslsplit/
 
@@ -17,19 +17,14 @@ LIB_DEPENDS=	libevent.so:devel/libevent \
 		libnet.so:net/libnet
 
 USES=		gmake pkgconfig tar:bzip2 uidfix ssl
+
 MAKEFILE=	GNUmakefile
 MAKE_ENV=	MANDIR=${PREFIX}/share/man INSTALLUID=${UID} INSTALLGID=${GID}
+
 PLIST_FILES=	bin/sslsplit share/man/man1/sslsplit.1.gz \
 		share/man/man5/sslsplit.conf.5.gz \
 		"@sample %%ETCDIR%%/sslsplit.conf.sample"
 
-.include <bsd.port.options.mk>
-
-.if ( ${OPSYS} == FreeBSD && ${OSVERSION} >= 1400092 && ${SSL_DEFAULT} == base ) || ${SSL_DEFAULT:Mopenssl} || ${SSL_DEFAULT:Mopenssl3*}
-IGNORE_SSL=	base openssl openssl31
-IGNORE_SSL_REASON=	error: undefined symbol: ERR_GET_FUNC which were deprecated in OpenSSL 3.0.0 and later
-.endif
-
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/sslsplit
 
diff --git a/security/sslsplit/distinfo b/security/sslsplit/distinfo
index 53b878d4b4d0..d99e8a7e13bd 100644
--- a/security/sslsplit/distinfo
+++ b/security/sslsplit/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1570828243
+TIMESTAMP = 1710537207
 SHA256 (sslsplit-0.5.5.tar.bz2) = ba0473fd01428439e0cf22fae80fdd26d08a0bcf85e17c82177cb0810b700faf
 SIZE (sslsplit-0.5.5.tar.bz2) = 532788
diff --git a/security/sslsplit/files/patch-pxyconn.c b/security/sslsplit/files/patch-pxyconn.c
new file mode 100644
index 000000000000..1e593e668bee
--- /dev/null
+++ b/security/sslsplit/files/patch-pxyconn.c
@@ -0,0 +1,31 @@
+--- pxyconn.c.orig	2024-03-15 21:14:16 UTC
++++ pxyconn.c
+@@ -72,6 +72,10 @@ bufferevent_openssl_set_allow_dirty_shutdown(UNUSED st
+ }
+ #endif /* LIBEVENT_VERSION_NUMBER < 0x02010000 */
+ 
++#if OPENSSL_VERSION_NUMBER >= 0x30000000L
++#define ERR_GET_FUNC(x) 0
++#define ERR_func_error_string(x) ""
++#endif
+ 
+ /*
+  * Maximum size of data to buffer per connection direction before
+@@ -586,7 +590,7 @@ out:
+  * keep a pointer to the object (which we never do here).
+  */
+ #ifdef HAVE_SSLV2
+-#define MAYBE_UNUSED 
++#define MAYBE_UNUSED
+ #else /* !HAVE_SSLV2 */
+ #define MAYBE_UNUSED UNUSED
+ #endif /* !HAVE_SSLV2 */
+@@ -2428,7 +2432,7 @@ pxy_sni_resolve_cb(int errcode, struct evutil_addrinfo
+  * after the first ssl callout failed because of client cert auth.
+  */
+ #ifndef OPENSSL_NO_TLSEXT
+-#define MAYBE_UNUSED 
++#define MAYBE_UNUSED
+ #else /* OPENSSL_NO_TLSEXT */
+ #define MAYBE_UNUSED UNUSED
+ #endif /* OPENSSL_NO_TLSEXT */