public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Yaakov Selkowitz <yselkowi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/hitch] rawhide: Fix compatibility with openssl 4.0
Date: Mon, 12 Oct 2026 20:08:16 GMT	[thread overview]
Message-ID: <179183569683.1.8587762302440738490.rpms-hitch-26529b8803f7@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/hitch
Branch : rawhide
Commit : 26529b8803f7b08ea5774166812f6088f66a6265
Author : Yaakov Selkowitz <yselkowi@redhat.com>
Date   : 2026-09-18T12:18:23-04:00
Stats  : +186/-3 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/hitch/c/26529b8803f7b08ea5774166812f6088f66a6265?branch=rawhide

Log:
Fix compatibility with openssl 4.0

---
diff --git a/hitch-1.8.0-openssl4.patch b/hitch-1.8.0-openssl4.patch
new file mode 100644
index 0000000..d57d903
--- /dev/null
+++ b/hitch-1.8.0-openssl4.patch
@@ -0,0 +1,175 @@
+From 6d571c5404a831de81402b0905c16dd26c963f22 Mon Sep 17 00:00:00 2001
+From: Dag Haavi Finstad <daghf@varnish-software.com>
+Date: Fri, 24 Oct 2025 14:37:12 +0200
+Subject: [PATCH 1/3] Allow building without libssl ENGINE support
+
+---
+ configure.ac        | 6 ++++++
+ src/configuration.c | 8 ++++++++
+ src/hitch.c         | 2 ++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index e95e213..580ff78 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -234,6 +234,12 @@ HITCH_CHECK_FUNC([X509_OBJECT_get0_X509], [$CRYPTO_LIBS], [
+ 		[OpenSSL has X509_OBJECT_get0_X509()])
+ ])
+ 
++AC_CHECK_DECLS([ENGINE_init],
++	[AC_DEFINE([HAVE_OPENSSL_ENGINE], [1],
++	    [Defined if we have openssl ENGINE support])],
++	[],
++	[[#include <openssl/engine.h>]])
++
+ AC_CHECK_MEMBERS([struct ssl_st.s3], [], [], [[#include <openssl/ssl.h>]])
+ 
+ AS_VERSION_COMPARE([$($PKG_CONFIG --modversion openssl)], [1.1.1],
+diff --git a/src/configuration.c b/src/configuration.c
+index eeb94f9..487ad93 100644
+--- a/src/configuration.c
++++ b/src/configuration.c
+@@ -923,7 +923,13 @@ config_param_validate(const char *k, char *v, hitch_config *cfg,
+ 		}
+ 	} else if (strcmp(k, CFG_SSL_ENGINE) == 0) {
+ 		if (strlen(v) > 0) {
++#ifndef HAVE_OPENSSL_ENGINE
++			config_error_set("ssl-engine setting is not available"
++			    " for this version of OpenSSL");
++			r = 0;
++#else
+ 			config_assign_str(&cfg->ENGINE, v);
++#endif
+ 		}
+ 	} else if (strcmp(k, CFG_PREFER_SERVER_CIPHERS) == 0) {
+ 		r = config_param_val_bool(v, &cfg->PREFER_SERVER_CIPHERS);
+@@ -1341,9 +1347,11 @@ config_print_usage_fd(char *prog, FILE *out)
+ 	fprintf(out, "\t-c  --ciphers=SUITE\n");
+ 	fprintf(out, "\t\tSets allowed ciphers (Default: \"%s\")\n",
+ 	    config_disp_str(cfg->CIPHERS_TLSv12));
++#ifdef HAVE_OPENSSL_ENGINE
+ 	fprintf(out, "\t-e  --ssl-engine=NAME\n");
+ 	fprintf(out, "\t\tSets OpenSSL engine (Default: \"%s\")\n",
+ 	    config_disp_str(cfg->ENGINE));
++#endif
+ 	fprintf(out, "\t-O  --prefer-server-ciphers[=on|off]\n");
+ 	fprintf(out, "\t\tPrefer server list order (Default: \"%s\")\n",
+ 	    config_disp_bool(cfg->PREFER_SERVER_CIPHERS));
+diff --git a/src/hitch.c b/src/hitch.c
+index a7198e9..2aa66d8 100644
+--- a/src/hitch.c
++++ b/src/hitch.c
+@@ -1332,6 +1332,7 @@ init_openssl(void)
+ 	SSL_load_error_strings();
+ 	OpenSSL_add_all_digests();
+ 
++#ifdef HAVE_OPENSSL_ENGINE
+ 	if (CONFIG->ENGINE) {
+ 		ENGINE *e = NULL;
+ 		ENGINE_load_builtin_engines();
+@@ -1352,6 +1353,7 @@ init_openssl(void)
+ 			ENGINE_free(e);
+ 		}
+ 	}
++#endif
+ }
+ 
+ static void
+
+From 793266afda3730e0f0c0a03d28aa687f4c26cc09 Mon Sep 17 00:00:00 2001
+From: Finn Rayk Gartner <finn.gartner@canonical.com>
+Date: Sun, 9 Aug 2026 18:18:37 +0200
+Subject: [PATCH 2/3] fix: Use ASN1_STRING accessors
+
+---
+ src/foreign/asn_gentm.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/foreign/asn_gentm.c b/src/foreign/asn_gentm.c
+index 660f8e9c..1c717989 100644
+--- a/src/foreign/asn_gentm.c
++++ b/src/foreign/asn_gentm.c
+@@ -129,13 +129,20 @@ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d)
+ {
+ 	static const int min[9] = { 0, 0, 1, 1, 0, 0, 0, 0, 0 };
+ 	static const int max[9] = { 99, 99, 12, 31, 23, 59, 59, 12, 59 };
+-	char *a;
++	const char *a;
+ 	int n, i, l, o;
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ 	if (d->type != V_ASN1_GENERALIZEDTIME)
+ 		return (0);
+ 	l = d->length;
+-	a = (char *)d->data;
++	a = (const char *)d->data;
++#else
++	if (ASN1_STRING_type(d) != V_ASN1_GENERALIZEDTIME)
++		return (0);
++	l = ASN1_STRING_length(d);
++	a = (const char *)ASN1_STRING_get0_data(d);
++#endif
+ 	o = 0;
+ 	/*
+ 	 * GENERALIZEDTIME is similar to UTCTIME except the year is represented
+
+From 95c2c3cee565c2435b341379769bf3d118b94f4a Mon Sep 17 00:00:00 2001
+From: Finn Rayk Gartner <finn.gartner@canonical.com>
+Date: Sun, 9 Aug 2026 18:22:47 +0200
+Subject: [PATCH 3/3] fix: Make libssl ENGINE support optional
+
+---
+ configure.ac | 9 ++++-----
+ src/hitch.c  | 2 ++
+ src/hitch.h  | 2 ++
+ 3 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 580ff789..aa6e5be8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -234,11 +234,10 @@ HITCH_CHECK_FUNC([X509_OBJECT_get0_X509], [$CRYPTO_LIBS], [
+ 		[OpenSSL has X509_OBJECT_get0_X509()])
+ ])
+ 
+-AC_CHECK_DECLS([ENGINE_init],
+-	[AC_DEFINE([HAVE_OPENSSL_ENGINE], [1],
+-	    [Defined if we have openssl ENGINE support])],
+-	[],
+-	[[#include <openssl/engine.h>]])
++HITCH_CHECK_FUNC([ENGINE_init], [$CRYPTO_LIBS], [
++	AC_DEFINE([HAVE_OPENSSL_ENGINE], [1],
++		[Defined if we have openssl ENGINE support])
++])
+ 
+ AC_CHECK_MEMBERS([struct ssl_st.s3], [], [], [[#include <openssl/ssl.h>]])
+ 
+diff --git a/src/hitch.c b/src/hitch.c
+index 6ea1ac48..6f267297 100644
+--- a/src/hitch.c
++++ b/src/hitch.c
+@@ -39,7 +39,9 @@
+ 
+ #include <openssl/x509.h>
+ #include <openssl/x509_vfy.h>
++#ifdef HAVE_OPENSSL_ENGINE
+ #include <openssl/engine.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+diff --git a/src/hitch.h b/src/hitch.h
+index 6fda054e..7b6fe028 100644
+--- a/src/hitch.h
++++ b/src/hitch.h
+@@ -42,7 +42,9 @@
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <openssl/asn1.h>
++#ifdef HAVE_OPENSSL_ENGINE
+ #include <openssl/engine.h>
++#endif
+ #include <openssl/evp.h>
+ #include <openssl/err.h>
+ #include <openssl/ssl.h>

diff --git a/hitch.spec b/hitch.spec
index c14654f..b7794f8 100644
--- a/hitch.spec
+++ b/hitch.spec
@@ -12,7 +12,7 @@
 
 Name:		hitch
 Version:	1.8.0
-Release:	13%{?dist}
+Release:	14%{?dist}
 Summary:	Network proxy that terminates TLS/SSL connections
 
 # Automatically converted from old format: BSD - review is highly recommended.
@@ -27,7 +27,7 @@ BuildRequires:	openssl
 BuildRequires:	pkgconfig
 BuildRequires:	libtool
 #BuildRequires:	python-docutils >= 0.6
-%if 0%{?fedora} >= 41
+%if 0%{?fedora} >= 41 && 0%{?fedora} < 45
 BuildRequires:  openssl-devel-engine
 %else
 BuildRequires:	openssl-devel
@@ -37,6 +37,9 @@ Requires:	openssl
 Patch0:		hitch.systemd.service.patch
 # https://github.com/varnish/hitch/issues/395
 Patch1:		hitch-1.8.0.fix_el10_build.patch
+# https://github.com/varnish/hitch/pull/399
+# https://github.com/varnish/hitch/pull/406
+Patch2:         hitch-1.8.0-openssl4.patch
 
 Requires(post): systemd
 Requires(preun): systemd
@@ -57,8 +60,10 @@ of connections efficiently on multicore machines.
 %patch -P1
 %endif
 
+%patch -P2 -p1
+
 %build
-#./bootstrap
+autoreconf -fiv
 
 # manpages are prebuilt, no need to build again
 export RST2MAN=/bin/true
@@ -131,6 +136,9 @@ make check
 %ghost %verify(not md5 size mtime)  /run/%{name}/%{name}.pid
 
 %changelog
+* Fri Sep 18 2026 Yaakov Selkowitz <yselkowi@redhat.com> - 1.8.0-14
+- Fix compatibility with openssl 4.0
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-10-12 20:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179183569683.1.8587762302440738490.rpms-hitch-26529b8803f7@fedoraproject.org \
    --to=yselkowi@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox