aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2022-02-15 08:26:11 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2022-02-16 15:28:28 -0500
commited675ad6d033f67fc347607d295fb0a60f47bee0 (patch)
treef514b397aa529992bb0ded00e83419bed386770e
parent7b38bc6694b5a9c55760b550a662cdfa6c9d39b4 (diff)
downloadopenssl_tpm2_engine-ed675ad6d033f67fc347607d295fb0a60f47bee0.tar.gz
Add openssl-3 support
This is just a bandaid at the moment to prevent -Werror from breaking the compile on deprecated API warnings. Since the APIs will be removed in the next release, this buys some time. The final solution will likely have to be a conversion to the new provider interface. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac7
2 files changed, 11 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 787ba29..d5a514d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,10 @@ man1_MANS = create_tpm2_key.1 load_tpm2_key.1 seal_tpm2_data.1 \
CLEANFILES = $(man1_MANS)
endif
+if HAVE_OPENSSL3
+CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L
+endif
+
openssl_engine_LTLIBRARIES=libtpm2.la
bin_PROGRAMS=create_tpm2_key load_tpm2_key seal_tpm2_data unseal_tpm2_data
openssl_enginedir=@enginesdir@
diff --git a/configure.ac b/configure.ac
index e102dd2..90b68f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,11 @@ AC_ARG_WITH(openssl,
AC_SUBST(OPENSSL_INCLUDE_DIR)])
AC_LANG(C)
+
+PKG_CHECK_MODULES([DEPS], [libcrypto >= 3.0.0],
+ [ac_have_openssl3=1],
+ [PKG_CHECK_MODULES([DEPS], [libcrypto])])
+
AC_ARG_WITH(
[enginesdir],
[AC_HELP_STRING([--with-enginesdir], [OpenSSL engines directory])],
@@ -95,6 +100,8 @@ AC_SEARCH_LIBS([TSS_Create], [tss ibmtss], [
])
AM_CONDITIONAL(HAVE_IBM_TSS, test "$tsslibs" = "IBM")
+AM_CONDITIONAL(HAVE_OPENSSL3, test "$ac_have_openssl3" = "1")
+
AC_DISABLE_STATIC
AC_PROG_CC_STDC
AM_PROG_CC_C_O