From c2f303f79bddeaebf007f27697f07479847ea717 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 22 Dec 2023 10:57:46 +0100 Subject: [PATCH] Fix C compatibility issues Related to: --- certmonger-c99-2.patch | 20 ++++++++++++++++++++ certmonger-c99.patch | 19 +++++++++++++++++++ certmonger.spec | 7 ++++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 certmonger-c99-2.patch create mode 100644 certmonger-c99.patch diff --git a/certmonger-c99-2.patch b/certmonger-c99-2.patch new file mode 100644 index 0000000..a0aa37b --- /dev/null +++ b/certmonger-c99-2.patch @@ -0,0 +1,20 @@ +Adjust parameter type for util_EVP_PKEY_id + +The function pointer needs to match the prototype for i2d_PublicKey +and i2d_PrivateKey. + +Submitted upstream: + +diff --git a/src/util-o.c b/src/util-o.c +index c05872ceb1495cee..7feecb9d6a2adf23 100644 +--- a/src/util-o.c ++++ b/src/util-o.c +@@ -551,7 +551,7 @@ util_NETSCAPE_SPKI_set_sig_alg(NETSCAPE_SPKI *spki, const X509_ALGOR *sig_alg) + + static EVP_PKEY * + util_EVP_PKEY_dup(EVP_PKEY *pkey, +- int (*i2d)(EVP_PKEY *, unsigned char **), ++ int (*i2d)(const EVP_PKEY *, unsigned char **), + EVP_PKEY *(*d2i)(int, EVP_PKEY **, const unsigned char **, long)) + { + EVP_PKEY *k; diff --git a/certmonger-c99.patch b/certmonger-c99.patch new file mode 100644 index 0000000..ffc738e --- /dev/null +++ b/certmonger-c99.patch @@ -0,0 +1,19 @@ +Fix type error in cm_tdbusm_get_vn + +This fixes an out-of-bounds stack write on 32-bit architectures. + +Submitted upstream: + +diff --git a/src/tdbusm.c b/src/tdbusm.c +index 5e3341172398051d..8f2383dc62bef75e 100644 +--- a/src/tdbusm.c ++++ b/src/tdbusm.c +@@ -223,7 +223,7 @@ cm_tdbusm_get_vn(DBusMessage *msg, void *parent, long *n) + { + DBusError err; + DBusMessageIter iter, sub_iter; +- int64_t *i64; ++ int64_t i64; + + dbus_error_init(&err); + diff --git a/certmonger.spec b/certmonger.spec index f8ad071..b1ee528 100644 --- a/certmonger.spec +++ b/certmonger.spec @@ -28,12 +28,14 @@ Name: certmonger Version: 0.79.19 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Certificate status monitor and PKI enrollment client License: GPL-3.0-or-later URL: http://pagure.io/certmonger/ Source0: http://releases.pagure.org/certmonger/certmonger-%{version}.tar.gz +Patch0: certmonger-c99.patch +Patch1: certmonger-c99-2.patch #Source1: http://releases.pagure.org/certmonger/certmonger-%%{version}.tar.gz.sig BuildRequires: autoconf @@ -264,6 +266,9 @@ exit 0 %endif %changelog +* Fri Dec 22 2023 Florian Weimer - 0.79.19-2 +- Fix C compatibility issues + * Tue Oct 10 2023 Rob Crittenden - 0.79.19-1 - Update to upstream 0.79.19