[gnutls-devel] [PATCH 2/3] Test for the existance of the /etc/system-fips file

Kurt Roeckx kurt at roeckx.be
Sat Apr 19 19:46:18 CEST 2014


We don't read it, the existance of the file is enough to say in what
mode we are.
---
 lib/fips.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/fips.c b/lib/fips.c
index 8cd4b94..71f7492 100644
--- a/lib/fips.c
+++ b/lib/fips.c
@@ -59,7 +59,7 @@ static int fips_mode = -1;
 		else f1p = 0;
 	}
 
-	f2p = !access(FIPS_SYSTEM_FILE, R_OK);
+	f2p = !access(FIPS_SYSTEM_FILE, F_OK);
 
 	if (f1p != 0 && f2p != 0) {
 		_gnutls_debug_log("FIPS140-2 mode enabled\n");
-- 
1.9.1




More information about the Gnutls-devel mailing list