On Sun, Aug 26, 2018 at 11:07:36PM +1000, Joel Sing wrote: > On Sunday 26 August 2018 12:52:52 Theo Buehler wrote: > > A simple one: > > This doesn't look right - the entire OPENSSL_VERSION_NUMBER < 1.1.0 path (on > line 40 of include/libssl_compat.h) should no longer be taken (or > substantially reduced).
Right. It looks like we can get rid of many (most?) of the LIBRESSL_VERSION_NUMBER patches in this port. I'd rather do this in several steps. Here's a first step that excludes the code path mentioned above. Index: Makefile =================================================================== RCS file: /var/cvs/ports/net/ntp/Makefile,v retrieving revision 1.74 diff -u -p -r1.74 Makefile --- Makefile 11 Jan 2018 19:27:07 -0000 1.74 +++ Makefile 26 Aug 2018 13:45:31 -0000 @@ -7,7 +7,7 @@ COMMENT= Network Time Protocol reference # 'pl' for local use. VERSION= 4.2.8p10 -REVISION= 1 +REVISION= 2 DISTNAME= ntp-${VERSION} PKGNAME= ntp-${VERSION:S/p/pl/} CATEGORIES= net Index: patches/patch-include_libssl_compat_h =================================================================== RCS file: patches/patch-include_libssl_compat_h diff -N patches/patch-include_libssl_compat_h --- patches/patch-include_libssl_compat_h 26 Aug 2018 11:57:49 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -$OpenBSD: patch-include_libssl_compat_h,v 1.3 2018/08/26 11:57:49 tb Exp $ -Index: include/libssl_compat.h ---- include/libssl_compat.h.orig -+++ include/libssl_compat.h -@@ -37,7 +37,7 @@ - #endif - - /* ----------------------------------------------------------------- */ --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - /* ----------------------------------------------------------------- */ - - # include <openssl/objects.h> -@@ -107,10 +107,12 @@ extern int sslshim_X509_get_signature_nid(const X509 * - - #define OpenSSL_version_num SSLeay - #define OpenSSL_version SSLeay_version -+#if !defined(LIBRESSL_VERSION_NUMBER) - #define X509_get0_notBefore X509_get_notBefore - #define X509_getm_notBefore X509_get_notBefore - #define X509_get0_notAfter X509_get_notAfter - #define X509_getm_notAfter X509_get_notAfter -+#endif - - /* ----------------------------------------------------------------- */ - #endif /* OPENSSL_VERSION_NUMBER < v1.1.0 */ Index: patches/patch-libntp_libssl_compat_c =================================================================== RCS file: patches/patch-libntp_libssl_compat_c diff -N patches/patch-libntp_libssl_compat_c --- patches/patch-libntp_libssl_compat_c 27 Mar 2017 11:33:40 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-libntp_libssl_compat_c,v 1.2 2017/03/27 11:33:40 bluhm Exp $ ---- libntp/libssl_compat.c.orig Thu Mar 23 19:36:53 2017 -+++ libntp/libssl_compat.c Thu Mar 23 21:47:42 2017 -@@ -26,7 +26,7 @@ - /* ----------------------------------------------------------------- */ - - /* ----------------------------------------------------------------- */ --#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L -+#if defined(OPENSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - /* ----------------------------------------------------------------- */ - - #include "libssl_compat.h" Index: patches/patch-sntp_libevent_test_regress_ssl_c =================================================================== RCS file: /var/cvs/ports/net/ntp/patches/patch-sntp_libevent_test_regress_ssl_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-sntp_libevent_test_regress_ssl_c --- patches/patch-sntp_libevent_test_regress_ssl_c 27 Mar 2017 11:33:40 -0000 1.1 +++ patches/patch-sntp_libevent_test_regress_ssl_c 26 Aug 2018 13:36:59 -0000 @@ -1,6 +1,7 @@ $OpenBSD: patch-sntp_libevent_test_regress_ssl_c,v 1.1 2017/03/27 11:33:40 bluhm Exp $ ---- sntp/libevent/test/regress_ssl.c.orig Thu Mar 23 21:54:28 2017 -+++ sntp/libevent/test/regress_ssl.c Thu Mar 23 21:59:01 2017 +Index: sntp/libevent/test/regress_ssl.c +--- sntp/libevent/test/regress_ssl.c.orig ++++ sntp/libevent/test/regress_ssl.c @@ -61,7 +61,7 @@ #include <string.h> @@ -10,12 +11,3 @@ $OpenBSD: patch-sntp_libevent_test_regre #define OpenSSL_version_num SSLeay #endif /* OPENSSL_VERSION_NUMBER */ -@@ -130,7 +130,7 @@ getcert(void) - X509_set_subject_name(x509, name); - X509_set_issuer_name(x509, name); - --#if OPENSSL_VERSION_NUMBER < 0x10100000L -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - X509_time_adj(X509_get_notBefore(x509), 0, &now); - now += 3600; - X509_time_adj(X509_get_notAfter(x509), 0, &now);