diff options
author | Werner Koch <[email protected]> | 2017-07-24 16:21:11 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-07-24 18:09:52 +0000 |
commit | e97548223948222a5c22acdf3775c7f93c1e17a9 (patch) | |
tree | 1472ece069b8c08cd4a7f62c860539cbaefeb29a /dirmngr/server.c | |
parent | dirmngr: New function dirmngr_status_printf. (diff) | |
download | gnupg-e97548223948222a5c22acdf3775c7f93c1e17a9.tar.gz gnupg-e97548223948222a5c22acdf3775c7f93c1e17a9.zip |
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 [email protected]. Without a SRV record
S SOURCE https://gnupg.org
would have been returned.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r-- | dirmngr/server.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |