From e97548223948222a5c22acdf3775c7f93c1e17a9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 24 Jul 2017 18:21:11 +0200 Subject: [PATCH] dirmngr: Print a SOURCE status for WKD requests. * dirmngr/server.c (cmd_wkd_get): Print a SOURCE status. -- This status allows to see whether the the WKD requests has been resolved from the standard address or from a SRV record derived one. We return only host and port and not the .well-known suffix because that is obvious. HTTP redirects are not taken in account because they may chnage at any time due to load balancing etc and not relevant for gpg which may use the URL to detect changes in the WKD results. For example my current setup returns S SOURCE https://wkd.gnupg.org for wk@gnupg.org. Without a SRV record S SOURCE https://gnupg.org would have been returned. Signed-off-by: Werner Koch --- dirmngr/server.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dirmngr/server.c b/dirmngr/server.c index 903953486..4f5a3b218 100644 --- a/dirmngr/server.c +++ b/dirmngr/server.c @@ -896,7 +896,6 @@ cmd_wkd_get (assuan_context_t ctx, char *line) } } xfree (srvs); - log_debug ("srv: got '%s%s'\n", domain, portstr); } gcry_md_hash_buffer (GCRY_MD_SHA1, sha1buf, mbox, strlen (mbox)); @@ -932,6 +931,13 @@ cmd_wkd_get (assuan_context_t ctx, char *line) encodedhash, NULL); no_log = 1; + if (uri) + { + err = dirmngr_status_printf (ctrl, "SOURCE", "https://%s%s", + domain, portstr); + if (err) + goto leave; + } } if (!uri) {