aboutsummaryrefslogtreecommitdiffstats
path: root/tools/call-dirmngr.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-01-19 09:52:43 +0000
committerWerner Koch <[email protected]>2023-01-19 09:52:43 +0000
commit227c78ce0e4d0e7cf910f87c08a9459c25f419cc (patch)
tree2036e3b6bc2026ab023344cb4a57ad5b2890007e /tools/call-dirmngr.c
parentgpg: Detect already compressed data also when using a pipe. (diff)
downloadgnupg-227c78ce0e4d0e7cf910f87c08a9459c25f419cc.tar.gz
gnupg-227c78ce0e4d0e7cf910f87c08a9459c25f419cc.zip
wkd: Let gpg-wks-client --supported print some diagnostics.
* tools/call-dirmngr.c (wkd_get_status_cb): Deetect and output warning and note stati from dirmngr. -- This is in particular helpful to check for non-proper TLS certificates.
Diffstat (limited to 'tools/call-dirmngr.c')
-rw-r--r--tools/call-dirmngr.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/tools/call-dirmngr.c b/tools/call-dirmngr.c
index 4eef9b264..c0ddcf568 100644
--- a/tools/call-dirmngr.c
+++ b/tools/call-dirmngr.c
@@ -124,10 +124,54 @@ wkd_get_status_cb (void *opaque, const char *line)
{
struct wkd_get_parm_s *parm = opaque;
gpg_error_t err = 0;
+ const char *s, *s2;
+ const char *warn = NULL;
+ int is_note = 0;
- (void)line;
(void)parm;
+ /* Note: The code below is mostly duplicated from g10/call-dirmngr.c */
+ if ((s = has_leading_keyword (line, "WARNING"))
+ || (is_note = !!(s = has_leading_keyword (line, "NOTE"))))
+ {
+ if ((s2 = has_leading_keyword (s, "wkd_cached_result")))
+ {
+ if (opt.verbose)
+ warn = _("WKD uses a cached result");
+ }
+ else if ((s2 = has_leading_keyword (s, "tor_not_running")))
+ warn = _("Tor is not running");
+ else if ((s2 = has_leading_keyword (s, "tor_config_problem")))
+ warn = _("Tor is not properly configured");
+ else if ((s2 = has_leading_keyword (s, "dns_config_problem")))
+ warn = _("DNS is not properly configured");
+ else if ((s2 = has_leading_keyword (s, "http_redirect")))
+ warn = _("unacceptable HTTP redirect from server");
+ else if ((s2 = has_leading_keyword (s, "http_redirect_cleanup")))
+ warn = _("unacceptable HTTP redirect from server was cleaned up");
+ else if ((s2 = has_leading_keyword (s, "tls_cert_error")))
+ warn = _("server uses an invalid certificate");
+ else
+ warn = NULL;
+
+ if (warn)
+ {
+ if (is_note)
+ log_info (_("Note: %s\n"), warn);
+ else
+ log_info (_("WARNING: %s\n"), warn);
+ if (s2 && opt.verbose)
+ {
+ while (*s2 && !spacep (s2))
+ s2++;
+ while (*s2 && spacep (s2))
+ s2++;
+ if (*s2)
+ log_info ("(%s)\n", s2);
+ }
+ }
+ }
+
return err;
}