certmonger/SOURCES/0004-Add-compile-check-for-EVP_PKEY_get_id-along-with-EVP.patch

47 lines
1.4 KiB
Diff
Raw Normal View History

2022-01-11 18:02:25 +00:00
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