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>
This commit is contained in:
James Bottomley 2022-06-13 16:32:45 -04:00
parent 25af2eb5e3
commit d6e4bff8f1
2 changed files with 10 additions and 3 deletions

View file

@ -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,
[],

View file

@ -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)