From 2e37e3c4a22e88024cca71269d25163e012ac146 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 19 Apr 2016 19:18:05 +0200 Subject: tools: avoid extracting the value of the app-proto alias Instead always extract the starttls-proto value, as it seems that libopts doesn't report any value for the former. This corrects the starttls capability of danetool and gnutls-cli-debug. --- src/cli-debug.c | 8 ++++---- src/danetool.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli-debug.c b/src/cli-debug.c index 0c2e31226f..8ebec4e426 100644 --- a/src/cli-debug.c +++ b/src/cli-debug.c @@ -235,11 +235,11 @@ int main(int argc, char **argv) } #endif - if (HAVE_OPT(APP_PROTO)) { - snprintf(app_proto, sizeof(app_proto), "%s", OPT_ARG(APP_PROTO)); + if (HAVE_OPT(STARTTLS_PROTO)) { + snprintf(app_proto, sizeof(app_proto), "%s", OPT_ARG(STARTTLS_PROTO)); } - if (app_proto == NULL) { + if (app_proto[0] == 0) { snprintf(app_proto, sizeof(app_proto), "%s", port_to_service(portname, "tcp")); } @@ -340,7 +340,7 @@ static void cmd_parser(int argc, char **argv) if (HAVE_OPT(PORT)) port = OPT_VALUE_PORT; else { - if (HAVE_OPT(APP_PROTO)) + if (HAVE_OPT(STARTTLS_PROTO)) port = starttls_proto_to_port(OPT_ARG(STARTTLS_PROTO)); else port = 443; diff --git a/src/danetool.c b/src/danetool.c index b05c49b78c..bdccbb3c8b 100644 --- a/src/danetool.c +++ b/src/danetool.c @@ -220,8 +220,8 @@ static void dane_check(const char *host, const char *proto, if (!cinfo->cert) { const char *app_proto = NULL; - if (HAVE_OPT(APP_PROTO)) - app_proto = OPT_ARG(APP_PROTO); + if (HAVE_OPT(STARTTLS_PROTO)) + app_proto = OPT_ARG(STARTTLS_PROTO); cinfo->cert = obtain_cert(host, proto, service, app_proto, HAVE_OPT(QUIET)); del = 1; -- cgit v1.2.1