summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-08-14 11:26:33 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-08-14 11:26:35 +0200
commita3175ff6177a3feab8e1da134924851827bd0900 (patch)
treed419887c2df773159e9db73eb0879fa4f7a9cc67 /src/cli.c
parentdf2a9540df2d187f90f5f45ee5cd7c9358f1ba7b (diff)
downloadgnutls-a3175ff6177a3feab8e1da134924851827bd0900.tar.gz
gnutls-cli: added --fips140-mode command line option
That option will report the status of the FIPS140-2 mode in the library.
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index 0d2215a07d..867c646fcb 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1303,6 +1303,16 @@ static void cmd_parser(int argc, char **argv)
if (rest == NULL && argc > 0)
rest = argv[0];
+
+ if (HAVE_OPT(FIPS140_MODE)) {
+ if (gnutls_fips140_mode_enabled() != 0) {
+ fprintf(stderr, "library is in FIPS140-2 mode\n");
+ exit(0);
+ }
+ fprintf(stderr, "library is NOT in FIPS140-2 mode\n");
+ exit(1);
+ }
+
if (HAVE_OPT(BENCHMARK_CIPHERS)) {
benchmark_cipher(OPT_VALUE_DEBUG);
exit(0);