diff options
author | Daiki Ueno <dueno@redhat.com> | 2020-04-06 14:37:53 +0200 |
---|---|---|
committer | Daiki Ueno <dueno@redhat.com> | 2020-04-24 18:30:21 +0200 |
commit | b2cf035b754211c34d0559e57e1dbc82365af83a (patch) | |
tree | 621d760509c96afb23e4f444218a42f9f919422b /configure.ac | |
parent | 804a7da030609a3eafcf25f6905f450ad000e0a8 (diff) | |
download | gnutls-b2cf035b754211c34d0559e57e1dbc82365af83a.tar.gz |
fips: check library soname during configuretmp-check-soname
Previously, we hard-coded the sonames of linked libraries for FIPS
integrity checking. That required downstream packagers to manually
adjust the relevant code in lib/fips.c, when a new interface version
of the dependent libraries (nettle, gmp) becomes available and linked
to libgnutls.
This patch automates that process with the configure script.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 7d70d205c7..2d0a42665e 100644 --- a/configure.ac +++ b/configure.ac @@ -669,6 +669,49 @@ LIBS="$LIBS $NETTLE_LIBS $HOGWEED_LIBS" AC_CHECK_FUNCS(nettle_gostdsa_vko) LIBS=$save_LIBS +# Check sonames of the linked libraries needed for FIPS selftests. +save_LIBS=$LIBS +LIBS="$LIBS $GMP_LIBS" +AC_MSG_CHECKING([gmp soname]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [gmp_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libgmp\.so'`], + [gmp_so=none]) +if test -z "$gmp_so"; then + gmp_so=none +fi +AC_MSG_RESULT($gmp_so) +AC_DEFINE_UNQUOTED([GMP_LIBRARY_SONAME], ["$gmp_so"], [The soname of gmp library]) +LIBS=$save_LIBS + +save_LIBS=$LIBS +LIBS="$LIBS $NETTLE_LIBS" +AC_MSG_CHECKING([nettle soname]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [nettle_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libnettle\.so'`], + [nettle_so=none]) +if test -z "$nettle_so"; then + nettle_so=none +fi +AC_MSG_RESULT($nettle_so) +AC_DEFINE_UNQUOTED([NETTLE_LIBRARY_SONAME], ["$nettle_so"], [The soname of nettle library]) +LIBS=$save_LIBS + +save_LIBS=$LIBS +LIBS="$LIBS $HOGWEED_LIBS" +AC_MSG_CHECKING([hogweed soname]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [hogweed_so=`(eval "$LDDPROG conftest$EXEEXT $LDDPOSTPROC") | grep '^libhogweed\.so'`], + [hogweed_so=none]) +if test -z "$hogweed_so"; then + hogweed_so=none +fi +AC_MSG_RESULT($hogweed_so) +AC_DEFINE_UNQUOTED([HOGWEED_LIBRARY_SONAME], ["$hogweed_so"], [The soname of hogweed library]) +LIBS=$save_LIBS + +gnutls_so=libgnutls.so.`expr "$LT_CURRENT" - "$LT_AGE"` +AC_DEFINE_UNQUOTED([GNUTLS_LIBRARY_SONAME], ["$gnutls_so"], [The soname of gnutls library]) + AC_MSG_CHECKING([whether to build libdane]) AC_ARG_ENABLE(libdane, AS_HELP_STRING([--disable-libdane], |