From: Michal Nowak Date: Tue, 20 Oct 2020 10:12:00 +0000 (+0200) Subject: Add FIPS-detecting option to feature-test helper X-Git-Tag: v9.19.12~38^2~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe8b41286fe27a19570d4a068ef07fdf3cf3aa5b;p=thirdparty%2Fbind9.git Add FIPS-detecting option to feature-test helper The '--have-fips' option of feature-test detects FIPS mode. --- diff --git a/bin/tests/system/Makefile.am b/bin/tests/system/Makefile.am index c4ba3a0266b..3998b0d6f7e 100644 --- a/bin/tests/system/Makefile.am +++ b/bin/tests/system/Makefile.am @@ -36,6 +36,11 @@ feature_test_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(LIBDNS_CFLAGS) +feature_test_LDADD = \ + $(LDADD) \ + $(LIBDNS_LIBS) \ + $(OPENSSL_LIBS) + makejournal_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(LIBDNS_CFLAGS) diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c index eb09f59f334..82a7269f361 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -33,6 +34,7 @@ usage(void) { fprintf(stderr, "\t--enable-querytrace\n"); fprintf(stderr, "\t--gethostname\n"); fprintf(stderr, "\t--gssapi\n"); + fprintf(stderr, "\t--have-fips-mode\n"); fprintf(stderr, "\t--have-geoip2\n"); fprintf(stderr, "\t--have-json-c\n"); fprintf(stderr, "\t--have-libxml2\n"); @@ -107,6 +109,14 @@ main(int argc, char **argv) { #endif /* HAVE_GSSAPI */ } + if (strcmp(argv[1], "--have-fips-mode") == 0) { +#if defined(ENABLE_FIPS_MODE) + return (0); +#else + return (isc_fips_mode() ? 0 : 1); +#endif + } + if (strcmp(argv[1], "--have-geoip2") == 0) { #ifdef HAVE_GEOIP2 return (0);