Fix FTBFS due to OpenSSL 3.0.0 API change between beta1 and 2.

This commit is contained in:
Rob Crittenden 2021-09-29 07:46:34 -04:00
parent 11000d1148
commit d48f9ad6fb
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From f6672effea3cf9e50d6d3f29c1fbfbf6b1578e06 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Tue, 28 Sep 2021 10:01:35 -0400
Subject: [PATCH] Add compile check for EVP_PKEY_get_id along with EVP_PKEY_id
EVP_PKEY_id is no longer available as a function, only as a preprocessor
macro, so AC_CHECK_FUNCS cannot recognize it.
This was changed in OpenSSL 3.0.0-beta2
https://bugzilla.redhat.com/show_bug.cgi?id=2008451
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
configure.ac | 1 +
src/util-o.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 8bfa3fa..3b413a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -374,6 +374,7 @@ if ! ${configure_dist_target_only:-false} ; then
AC_CHECK_FUNCS(ASN1_TIME_set)
AC_CHECK_FUNCS(EVP_PKEY_base_id)
AC_CHECK_FUNCS(EVP_PKEY_id)
+ AC_CHECK_FUNCS(EVP_PKEY_get_id)
AC_CHECK_FUNCS(OBJ_get0_data)
AC_CHECK_FUNCS(OBJ_length)
AC_CHECK_FUNCS(X509_ATTRIBUTE_get0_object)
diff --git a/src/util-o.c b/src/util-o.c
index 2208ab6..db45964 100644
--- a/src/util-o.c
+++ b/src/util-o.c
@@ -329,7 +329,7 @@ util_ASN1_TIME_set(ASN1_TIME *str, time_t t)
int
util_EVP_PKEY_id(const EVP_PKEY *pkey)
{
-#ifdef HAVE_EVP_PKEY_ID
+#if defined(HAVE_EVP_PKEY_ID) || defined(HAVE_EVP_PKEY_GET_ID)
return EVP_PKEY_id(pkey);
#else
return pkey->type;
--
2.31.1

View File

@ -28,7 +28,7 @@
Name: certmonger
Version: 0.79.14
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Certificate status monitor and PKI enrollment client
License: GPLv3+
@ -37,6 +37,7 @@ Source0: http://releases.pagure.org/certmonger/certmonger-%{version}.tar.gz
#Source1: http://releases.pagure.org/certmonger/certmonger-%%{version}.tar.gz.sig
Patch0001: 0001-candidate-openssl-3.0-compat-fixes.patch
Patch0002: 0002-Add-compile-check-for-EVP_PKEY_get_id-along-with-EVP.patch
BuildRequires: autoconf
BuildRequires: automake
@ -265,6 +266,9 @@ exit 0
%endif
%changelog
* Wed Sep 29 2021 Rob Crittenden <rcritten@redhat.com> - 0.79.14-5
- Fix FTBFS due to OpenSSL 3.0.0 API change between beta1 and 2.
* Wed Sep 15 2021 Rob Crittenden <rcritten@redhat.com> - 0.79.14-4
- Port to OpenSSL 3.0.0