981bbce
From 89f57e39b69f92beacb6bad9c68d61f9c4fb0e77 Mon Sep 17 00:00:00 2001
144c414
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
144c414
Date: Fri, 2 Mar 2018 13:17:04 +0100
144c414
Subject: [PATCH] Print warning on FIPS machine with dnssec enabled. Dnsmasq
144c414
 has no proper FIPS 140-2 compliant implementation.
144c414
144c414
---
981bbce
 src/dnsmasq.c | 6 +++++-
981bbce
 1 file changed, 5 insertions(+), 1 deletion(-)
144c414
144c414
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
981bbce
index ce44809..9f6c020 100644
144c414
--- a/src/dnsmasq.c
144c414
+++ b/src/dnsmasq.c
981bbce
@@ -187,6 +187,7 @@ int main (int argc, char **argv)
144c414
       
144c414
       if (daemon->cachesize < CACHESIZ)
144c414
 	die(_("cannot reduce cache size from default when DNSSEC enabled"), NULL, EC_BADCONF);
144c414
+           
144c414
 #else 
144c414
       die(_("DNSSEC not available: set HAVE_DNSSEC in src/config.h"), NULL, EC_BADCONF);
144c414
 #endif
981bbce
@@ -769,7 +770,10 @@ int main (int argc, char **argv)
144c414
 	}
144c414
       
144c414
       my_syslog(LOG_INFO, _("DNSSEC validation enabled"));
981bbce
-      
981bbce
+
981bbce
+      if (access("/etc/system-fips", F_OK) == 0)
981bbce
+        my_syslog(LOG_WARNING, _("DNSSEC support is not FIPS 140-2 compliant"));
144c414
+
144c414
       daemon->dnssec_no_time_check = option_bool(OPT_DNSSEC_TIME);
144c414
       if (option_bool(OPT_DNSSEC_TIME) && !daemon->back_to_the_future)
981bbce
 	my_syslog(LOG_INFO, _("DNSSEC signature timestamps not checked until receipt of SIGINT"));
144c414
-- 
981bbce
2.14.4
144c414