diff --git a/configure.ac b/configure.ac index 5721a150..444f6ed9 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,10 @@ 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) if test "x$not_found" = "x0"; then use_openssl_functions_rsa=1 use_openssl_functions_for="${use_openssl_functions_for}RSA " diff --git a/m4/ax_check_define.m4 b/m4/ax_check_define.m4 new file mode 100644 index 00000000..398d475d --- /dev/null +++ b/m4/ax_check_define.m4 @@ -0,0 +1,31 @@ +# SYNOPSIS +# +# AX_CHECK_DEFINE(includefile, define, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given #define is available in the given #include file +# +# LICENSE +# +# See the root directory of the libtpms project for the LICENSE +# +AC_DEFUN([AX_CHECK_DEFINE], + [AC_PREREQ(2.64) + AC_MSG_CHECKING(whether $2 is defined in $1) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include $1]], + [[#ifndef $2 + #error $2 not defined + #endif]])], + [ + AC_MSG_RESULT([yes]) + [$3] + ], + [ + AC_MSG_RESULT([no]) + [$4] + ] + ) + ] +)