From ac8c1341fbb1d03b32d6feb0c18e1276c3d43c75 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Mon, 21 Nov 2022 12:06:59 -0600 Subject: [PATCH] cf: Check for OpenSSL 3.0 This check is admittedly lame. But it's all I have time for at the moment. A better check would be a program that includes the correct headers and succeeds if the OpenSSL version macro indicates it's at 3.0 or higher. Or perhaps we could run the openssl(1) version command- line and parse its output. But checking for functions that are in 3.0 and not 1.1 will do for the time being. --- cf/crypto.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cf/crypto.m4 b/cf/crypto.m4 index b8b011dd1..059b0aa9e 100644 --- a/cf/crypto.m4 +++ b/cf/crypto.m4 @@ -134,6 +134,14 @@ if test "$with_openssl" != "no"; then LDFLAGS="${saved_LDFLAGS}" fi +if test "$openssl" = "yes"; then + AC_CHECK_LIB([crypto], + [OSSL_EC_curve_nid2name], + [AC_DEFINE_UNQUOTED([HAVE_OPENSSL_30], 1, + [whether OpenSSL is 3.0 or higher])] + ) +fi + LIB_hcrypto='$(top_builddir)/lib/hcrypto/libhcrypto.la' LIB_hcrypto_a='$(top_builddir)/lib/hcrypto/.libs/libhcrypto.a' LIB_hcrypto_so='$(top_builddir)/lib/hcrypto/.libs/libhcrypto.so'