aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-hkp.c
diff options
context:
space:
mode:
authorKristian Fiskerstrand <[email protected]>2014-11-25 18:24:18 +0000
committerWerner Koch <[email protected]>2014-11-26 09:25:20 +0000
commit68a7ccc0c870cce6ab9fefb1aa6fd100e1de129b (patch)
tree9e8dae4e092692b620ebb43439e0c617b24eb7d6 /dirmngr/ks-engine-hkp.c
parentgpg: Change a bug() call to a regular error message. (diff)
downloadgnupg-68a7ccc0c870cce6ab9fefb1aa6fd100e1de129b.tar.gz
gnupg-68a7ccc0c870cce6ab9fefb1aa6fd100e1de129b.zip
dirmngr: Only report hkps scheme when available
* dirmngr/ks-engine-hkp.c (ks_hkp_help): Make use of TLS macros. -- Only report support for the hkps scheme when GnuPG / dirmngr has been built with a TLS library. This helps debuging and enable the user to detect whether support for hkps is included by doing a `gpg-connect-agent --dirmngr 'keyserver --help' /bye`. Currently hkps will be listed as a supported scheme but trying to add a keyserver using it will silently fail. As a digression, https is never listed as a valid scheme.
Diffstat (limited to 'dirmngr/ks-engine-hkp.c')
-rw-r--r--dirmngr/ks-engine-hkp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 12b1778c6..83e878ad7 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -767,12 +767,20 @@ ks_hkp_help (ctrl_t ctrl, parsed_uri_t uri)
const char const data[] =
"Handler for HKP URLs:\n"
" hkp://\n"
+#if HTTP_USE_GNUTLS || HTTP_USE_NTBTLS
" hkps://\n"
+#endif
"Supported methods: search, get, put\n";
gpg_error_t err;
+#if HTTP_USE_GNUTLS || HTTP_USE_NTBTLS
+ const char data2[] = " hkp\n hkps";
+#else
+ const char data2[] = " hkp";
+#endif
+
if (!uri)
- err = ks_print_help (ctrl, " hkp\n hkps");
+ err = ks_print_help (ctrl, data2);
else if (uri->is_http && (!strcmp (uri->scheme, "hkp")
|| !strcmp (uri->scheme, "hkps")))
err = ks_print_help (ctrl, data);