mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
dirmngr: Let --gpgconf-list return the default keyserver.
* dirmngr/misc.c (get_default_keyserver): New. * dirmngr/http.c: Include misc.h (http_session_new): Use get_default_keyserver instead of hardwired "hkps.pool.sks-keyservers.net". * dirmngr/http-ntbtls.c (gnupg_http_tls_verify_cb): Ditto. * dirmngr/dirmngr.c (main) <aGPGCongList>: Return default keyserver. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0c4d0620d3
commit
de6d8313f6
5 changed files with 37 additions and 5 deletions
|
@ -30,6 +30,29 @@
|
|||
#include "util.h"
|
||||
#include "misc.h"
|
||||
|
||||
/* Return a static string with the default keyserver. If NAME_ONLY is
|
||||
* given only the name part is returned. */
|
||||
const char *
|
||||
get_default_keyserver (int name_only)
|
||||
{
|
||||
static const char *result;
|
||||
|
||||
if (!name_only)
|
||||
return DIRMNGR_DEFAULT_KEYSERVER;
|
||||
|
||||
if (!result)
|
||||
{
|
||||
/* Strip the scheme from the constant. */
|
||||
result = strstr (DIRMNGR_DEFAULT_KEYSERVER, "://");
|
||||
log_assert (result && strlen (result) > 3);
|
||||
result += 3;
|
||||
/* Assert that there is no port given. */
|
||||
log_assert (strchr (result, ':'));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Convert the hex encoded STRING back into binary and store the
|
||||
result into the provided buffer RESULT. The actual size of that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue