summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-19 19:18:05 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-19 19:26:27 +0200
commit2e37e3c4a22e88024cca71269d25163e012ac146 (patch)
tree26ed06bc6329fa39c2371d0c04386f7a8066da74
parent1e409923cf9371737eb7c11f68afcfe2cf3db340 (diff)
downloadgnutls-2e37e3c4a22e88024cca71269d25163e012ac146.tar.gz
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.
-rw-r--r--src/cli-debug.c8
-rw-r--r--src/danetool.c4
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;