diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-08-14 11:26:33 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-08-14 11:26:35 +0200 |
commit | a3175ff6177a3feab8e1da134924851827bd0900 (patch) | |
tree | d419887c2df773159e9db73eb0879fa4f7a9cc67 | |
parent | df2a9540df2d187f90f5f45ee5cd7c9358f1ba7b (diff) | |
download | gnutls-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.
-rw-r--r-- | src/cli-args.def | 7 | ||||
-rw-r--r-- | src/cli.c | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/cli-args.def b/src/cli-args.def index facc22ca1e..600c10fefe 100644 --- a/src/cli-args.def +++ b/src/cli-args.def @@ -343,7 +343,6 @@ flag = { doc = "Change the default (^) delimiter used for inline commands. The delimiter is expected to be a single US-ASCII character (octets 0 - 127). This option is only relevant if inline commands are enabled via the inline-commands option"; }; - flag = { name = provider; arg-type = file; @@ -352,6 +351,12 @@ flag = { doc = "This will override the default options in /etc/gnutls/pkcs11.conf"; }; +flag = { + name = fips140-mode; + descrip = "Reports the status of the FIPS140-2 mode in gnutls library"; + doc = ""; +}; + doc-section = { ds-type = 'SEE ALSO'; // or anything else ds-format = 'texi'; // or texi or mdoc format @@ -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); |