From 3091ef1184a8e99da20b18e3222c13e1a7ec2020 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 14 Sep 2021 17:43:46 -0400 Subject: [PATCH] build-sys: Test for functions if #defines are not found (OSSL 3) OpenSSL 3.0 has converted several RSA-related #defines to functions, so that AX_CHECK_DEFINE only works for OpenSSL 1.1.0 but for OpenSSL 3.0.0 we have to also use AC_CHECK_LIB to determine whether the function is available. Signed-off-by: Stefan Berger --- configure.ac | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 002e55af..c8c7b379 100644 --- a/configure.ac +++ b/configure.ac @@ -221,10 +221,19 @@ AS_IF([test "x$enable_use_openssl_functions" != "xno"], [ AC_CHECK_LIB([crypto], [EVP_PKEY_verify_init],, not_found=1) AC_CHECK_LIB([crypto], [EVP_PKEY_verify],, not_found=1) AC_CHECK_LIB([crypto], [EVP_get_digestbyname],, not_found=1) - AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set0_rsa_oaep_label],, not_found=1) - AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_rsa_padding],, not_found=1) - AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_rsa_oaep_md],, not_found=1) - AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_signature_md],, not_found=1) + # OpenSSL 3.0 turned some #defines into functions + AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set0_rsa_oaep_label],, + AC_CHECK_LIB([crypto], [EVP_PKEY_CTX_set0_rsa_oaep_label],, not_found=1) + ) + AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_rsa_padding],, + AC_CHECK_LIB([crypto], [EVP_PKEY_CTX_set_rsa_padding],, not_found=1) + ) + AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_rsa_oaep_md],, + AC_CHECK_LIB([crypto], [EVP_PKEY_CTX_set_rsa_oaep_md],, not_found=1) + ) + AX_CHECK_DEFINE([], [EVP_PKEY_CTX_set_signature_md],, + AC_CHECK_LIB([crypto], [EVP_PKEY_CTX_set_signature_md],, not_found=1) + ) if test "x$not_found" = "x0"; then use_openssl_functions_rsa=1 use_openssl_functions_for="${use_openssl_functions_for}RSA "