From d21ed7527e22f34a1297878caded022db6e87c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Mon, 28 Sep 2020 09:21:59 +0200 Subject: [PATCH] Make native PKCS#11 require dlopen() support PKCS#11 support in BIND requires dlopen() support from the operating system and thus building with "--enable-native-pkcs11 --without-dlopen" should not be possible. Add an Autoconf check which enforces that constraint. Adjust the pairwise testing model accordingly. (cherry picked from commit 187dca9cf7e3b7473352a7bd416abbc5c6f64cd4) --- configure | 4 ++++ configure.ac | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 887787faef..50b0fb2770 100755 --- a/configure +++ b/configure @@ -24393,6 +24393,10 @@ fi fi +if test "$with_dlopen" = "no" -a "$want_native_pkcs11" = "yes"; then : + as_fn_error $? "PKCS11 requires dlopen() support" "$LINENO" 5 +fi + CFLAGS="$CFLAGS $SO_CFLAGS" diff --git a/configure.ac b/configure.ac index bdfd4d3f1a..30bd71b957 100644 --- a/configure.ac +++ b/configure.ac @@ -1489,7 +1489,7 @@ AC_SUBST(INSTALL_LIBRARY) # was --enable-native-pkcs11 specified? # (note it implies both --without-openssl and --with-pkcs11) # -# [pairwise: --enable-native-pkcs11, --disable-native-pkcs11] +# [pairwise: --enable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --with-dlopen, --disable-native-pkcs11 --without-dlopen] AC_ARG_ENABLE(native-pkcs11, AS_HELP_STRING([--enable-native-pkcs11], [use native PKCS11 for all crypto [default=no]]), @@ -5151,7 +5151,7 @@ SO_LD="" SO_TARGETS="" SO_STRIP="cat" -# [pairwise: --with-dlopen, --without-dlopen] +# [pairwise: skip] AC_ARG_WITH([dlopen], AS_HELP_STRING([--with-dlopen=ARG], [support dynamically loadable DLZ drivers]), @@ -5245,6 +5245,9 @@ AS_IF([test "$with_dlopen" = "yes"], ]) ]) +AS_IF([test "$with_dlopen" = "no" -a "$want_native_pkcs11" = "yes"], + [AC_MSG_ERROR([PKCS11 requires dlopen() support])]) + CFLAGS="$CFLAGS $SO_CFLAGS" AC_SUBST(SO)