From e256951eab4cc44367f8cc7bd2a51eeaacc10f7d Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Sun, 16 Jan 2022 07:57:02 +0100 Subject: cli: add --list-config option With this option gnutls-cli prints the build-time configuration of the library, retrieved through gnutls_get_library_config. Signed-off-by: Daiki Ueno --- src/cli.c | 9 +++++++++ src/gnutls-cli-options.json | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/cli.c b/src/cli.c index 09f7efc2c3..5378b72256 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1640,6 +1640,15 @@ static void cmd_parser(int argc, char **argv) exit(1); } + if (HAVE_OPT(LIST_CONFIG)) { + const gnutls_library_config_st *p; + + for (p = gnutls_get_library_config(); p->name; p++) { + log_msg(stdout, "%s: %s\n", p->name, p->value); + } + exit(0); + } + if (HAVE_OPT(BENCHMARK_CIPHERS)) { benchmark_cipher(OPT_VALUE_DEBUG); exit(0); diff --git a/src/gnutls-cli-options.json b/src/gnutls-cli-options.json index 0777e6b198..bffa18e365 100644 --- a/src/gnutls-cli-options.json +++ b/src/gnutls-cli-options.json @@ -386,6 +386,11 @@ "long-option": "fips140-mode", "desc": "Reports the status of the FIPS140-2 mode in gnutls library" }, + { + "detail": "", + "long-option": "list-config", + "desc": "Reports the configuration of the library" + }, { "desc": "Redirect informational messages to a specific file.", "arg-type": "string", @@ -418,4 +423,4 @@ } ] } -] \ No newline at end of file +] -- cgit v1.2.1