build-sys: Check for availability of SSKDF (KDFe) in OpenSSL

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2024-07-15 11:32:47 -04:00 committed by Stefan Berger
parent d635ef81e2
commit 37ca5d3ddb

View File

@ -164,6 +164,7 @@ use_openssl_functions_symmetric=0
use_openssl_functions_ec=0
use_openssl_functions_ecdsa=0
use_openssl_functions_rsa=0
use_openssl_functions_sskdf=0
AC_ARG_ENABLE(use-openssl-functions,
AS_HELP_STRING([--disable-use-openssl-functions],
[Use TPM 2 crypot code rather than OpenSSL crypto functions]),
@ -240,12 +241,20 @@ AS_IF([test "x$enable_use_openssl_functions" != "xno"], [
use_openssl_functions_rsa=1
use_openssl_functions_for="${use_openssl_functions_for}RSA "
fi
not_found=0
AX_CHECK_DEFINE([<openssl/core_names.h>], [OSSL_KDF_NAME_SSKDF],, not_found=1)
if test "x$not_found" = "x0"; then
use_openssl_functions_sskdf=1
use_openssl_functions_for="${use_openssl_functions_for}SSKDF (KDFe) "
fi
LIBS=$LIBS_save
])
CFLAGS="$CFLAGS -DUSE_OPENSSL_FUNCTIONS_SYMMETRIC=$use_openssl_functions_symmetric"
CFLAGS="$CFLAGS -DUSE_OPENSSL_FUNCTIONS_EC=$use_openssl_functions_ec"
CFLAGS="$CFLAGS -DUSE_OPENSSL_FUNCTIONS_ECDSA=$use_openssl_functions_ecdsa"
CFLAGS="$CFLAGS -DUSE_OPENSSL_FUNCTIONS_RSA=$use_openssl_functions_rsa"
CFLAGS="$CFLAGS -DUSE_OPENSSL_FUNCTIONS_SSKDF=$use_openssl_functions_sskdf"
AC_CHECK_LIB([crypto], [EC_POINT_get_affine_coordinates], found=1, found=0)
CFLAGS="$CFLAGS -DUSE_EC_POINT_GET_AFFINE_COORDINATES_API=$found"