2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-07-16 19:00:45 +00:00

fix(conserver): Port DH key setup to OpenSSL 3 opaque structs

OpenSSL 3.x made the DH struct opaque. Replace direct dh->p/dh->g
member access with DH_set0_pqg() behind a version guard so older
OpenSSL (< 1.1.0) keeps the original code path.
This commit is contained in:
Vinícius Ferrão
2026-05-11 13:08:38 -03:00
parent dea988bc53
commit 30dfa85538
3 changed files with 110 additions and 2 deletions
+2
View File
@@ -22,6 +22,7 @@ Group: System Environment/Daemons
URL: http://www.conserver.com/
Source: http://www.conserver.com/%{pkg}-%{ver}.tar.gz
Patch: initscript_8.2.1.patch
Patch1: openssl3-dh-opaque.patch
BuildRoot: %{_tmppath}/%{pkg}-buildroot
BuildRequires: openssl-devel
Prefix: %{_prefix}
@@ -40,6 +41,7 @@ bells and whistles to accentuate that basic functionality.
%{__rm} -rf %{buildroot}
%setup -n %{pkg}-%{ver}
%patch -p1
%patch1 -p1
%build
+106
View File
@@ -0,0 +1,106 @@
--- a/conserver/main.c 2026-05-11 12:58:13
+++ b/conserver/main.c 2026-05-11 13:01:10
@@ -112,12 +112,25 @@
if ((dh = DH_new()) == NULL)
return (NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL >= 1.1.0 */
+ {
+ BIGNUM *p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL);
+ BIGNUM *g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL);
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
+ BN_free(p);
+ BN_free(g);
+ DH_free(dh);
+ return (NULL);
+ }
+ }
+#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);
}
@@ -146,12 +159,25 @@
if ((dh = DH_new()) == NULL)
return (NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL >= 1.1.0 */
+ {
+ BIGNUM *p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
+ BIGNUM *g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
+ BN_free(p);
+ BN_free(g);
+ DH_free(dh);
+ return (NULL);
+ }
+ }
+#else
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
if ((dh->p == NULL) || (dh->g == NULL)) {
DH_free(dh);
return (NULL);
}
+#endif
return (dh);
}
@@ -193,12 +219,25 @@
if ((dh = DH_new()) == NULL)
return (NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL >= 1.1.0 */
+ {
+ BIGNUM *p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
+ BIGNUM *g = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
+ BN_free(p);
+ BN_free(g);
+ DH_free(dh);
+ return (NULL);
+ }
+ }
+#else
dh->p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
dh->g = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
if ((dh->p == NULL) || (dh->g == NULL)) {
DH_free(dh);
return (NULL);
}
+#endif
return (dh);
}
@@ -266,12 +305,25 @@
if ((dh = DH_new()) == NULL)
return (NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L /* OpenSSL >= 1.1.0 */
+ {
+ BIGNUM *p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), NULL);
+ BIGNUM *g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), NULL);
+ if (p == NULL || g == NULL || !DH_set0_pqg(dh, p, NULL, g)) {
+ BN_free(p);
+ BN_free(g);
+ DH_free(dh);
+ return (NULL);
+ }
+ }
+#else
dh->p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), NULL);
dh->g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), NULL);
if ((dh->p == NULL) || (dh->g == NULL)) {
DH_free(dh);
return (NULL);
}
+#endif
return (dh);
}
@@ -1,5 +1,5 @@
--- ipmitool-1.8.18.orig/configure.ac 2026-05-11 11:35:37
+++ ipmitool-1.8.18/configure.ac 2026-05-11 11:36:20
--- a/configure.ac 2026-05-11 11:35:37
+++ b/configure.ac 2026-05-11 11:36:20
@@ -184,9 +184,12 @@
[if test "x$xenable_internal_md5" != "xyes"; then
if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then