From 21d4cd5acdc6dc88b339724f484cec1521c8be46 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 12 Nov 2013 12:46:10 +0100 Subject: Updated FIPS140 initialization and added a self test for it. --- configure.ac | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7681b56b79..18b03117d7 100644 --- a/configure.ac +++ b/configure.ac @@ -131,8 +131,20 @@ AC_ARG_ENABLE(fips140-mode, enable_fips=$enableval, enable_fips=no) AM_CONDITIONAL(ENABLE_FIPS140, test "$enable_fips" = "yes") if [ test "$enable_fips" = "yes" ];then - enable_self_checks=yes - AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode]) + AC_LIB_HAVE_LINKFLAGS(dl,, [#include ], [dladdr (0, 0);]) + if test "x$HAVE_LIBDL" = "xyes";then + enable_self_checks=yes + AC_DEFINE([ENABLE_FIPS140], 1, [Enable FIPS140-2 mode]) + + AC_SUBST([FIPS140_LIBS], $LIBDL) + else + enable_fips=no + AC_MSG_WARN([[ +*** +*** This system is not supported in FIPS140 mode. +*** libdl and dladdr() are required. +*** ]]) + fi fi AM_CONDITIONAL(ENABLE_SELF_CHECKS, test "$enable_self_checks" = "yes") -- cgit v1.2.1