NLnetLabs / ldns

LDNS is a DNS library that facilitates DNS tool programming
https://nlnetlabs.nl/ldns
BSD 3-Clause "New" or "Revised" License
292 stars 97 forks source link

EVP_PKEY_base_id is no longer a function in Openssl 3.0 #143

Closed danielluke closed 2 years ago

danielluke commented 2 years ago

EVP_PKEY_base_id is a macro in evp.h in Openssl 3.0, so the ldns configure tests don't find it.

Something like this should fix things:

--- configure.ac.orig   2021-11-08 14:18:58.000000000 -0500
+++ configure.ac    2021-11-08 14:18:01.000000000 -0500
@@ -332,7 +332,12 @@
 else
    AC_MSG_RESULT([no])
 fi
-AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new EVP_PKEY_base_id DSA_SIG_set0 DSA_SIG_get0 EVP_dss1 DSA_get0_pqg DSA_get0_key OPENSSL_init_ssl OPENSSL_init_crypto ERR_load_crypto_strings])
+AC_CHECK_FUNCS([EVP_sha256 EVP_sha384 EVP_sha512 ENGINE_load_cryptodev EVP_PKEY_keygen ECDSA_SIG_get0 EVP_MD_CTX_new DSA_SIG_set0 DSA_SIG_get0 EVP_dss1 DSA_get0_pqg DSA_get0_key OPENSSL_init_ssl OPENSSL_init_crypto ERR_load_crypto_strings])
+AC_CHECK_DECLS([EVP_PKEY_base_id], [
+        AC_DEFINE_UNQUOTED([HAVE_EVP_PKEY_BASE_ID], [1], [Define to 1 if you have the EVP_PKEY_base_id function or macro.])
+      ], [], [AC_INCLUDES_DEFAULT
+#include <openssl/evp.h>
+      ])

 # for macosx, see if glibtool exists and use that
 # BSD's need to know the version...
wtoorop commented 2 years ago

Good catch! And just in time for the 1.8.0 release ;) Your suggestion works like a charm. Tested with OpenSSL 3.0.0 and earlier versions.