aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2022-06-13 16:32:45 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2022-06-13 18:12:08 -0400
commitd6e4bff8f1ec1118282bea9413d74a94388108ac (patch)
tree1a07bea2f7a805f569dd37cad93a549f53f095d2
parent25af2eb5e39b5d54703d4489182a6b9d0af58b76 (diff)
downloadsbsigntools-d6e4bff8f1ec1118282bea9413d74a94388108ac.tar.gz
Add support for openssl-3
We're currently using a raft of APIs which trigger deprecation warnings, so add OPENSSL_API_COMPAT to the command line for openssl-3 to cause them not to break the build. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--configure.ac9
-rw-r--r--src/Makefile.am4
2 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 23dbc54..23c17f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,9 +55,12 @@ AC_DEFINE_UNQUOTED(HAVE_LITTLE_ENDIAN, $little_endian, [Little-endian system])
AC_DEFINE_UNQUOTED(HAVE_BIG_ENDIAN, $big_endian, [Big-endian system])
PKG_PROG_PKG_CONFIG()
-PKG_CHECK_MODULES(libcrypto, libcrypto,
- [],
- AC_MSG_ERROR([libcrypto (from the OpenSSL package) is required]))
+PKG_CHECK_MODULES(libcrypto, [libcrypto >= 3.0.0],
+ [ac_have_openssl3=1],
+ [PKG_CHECK_MODULES(libcrypto, libcrypto,
+ [],
+ AC_MSG_ERROR([libcrypto (from the OpenSSL package) is required]))])
+AM_CONDITIONAL(HAVE_OPENSSL3, test "$ac_have_openssl3" = "1")
PKG_CHECK_MODULES(uuid, uuid,
[],
diff --git a/src/Makefile.am b/src/Makefile.am
index e3f039b..38f93ff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,6 +4,10 @@ bin_PROGRAMS = sbsign sbverify sbattach sbvarsign sbsiglist sbkeysync
coff_headers = coff/external.h coff/pe.h
AM_CFLAGS = -Wall -Wextra --std=gnu99
+if HAVE_OPENSSL3
+AM_CFLAGS += -DOPENSSL_API_COMPAT=0x10100000L
+endif
+
common_SOURCES = idc.c idc.h image.c image.h fileio.c fileio.h \
efivars.h $(coff_headers)
common_LDADD = ../lib/ccan/libccan.a $(libcrypto_LIBS)