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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-07-24 18:21:11 +02:00
parent 9b88cfa096
commit e975482239
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 7 additions and 1 deletions

View File

@ -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)
{