diff options
author | Werner Koch <wk@gnupg.org> | 2020-09-10 10:19:44 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-09-10 10:50:40 +0200 |
commit | 5a87011c46b5b01659c3cbc3c7a04da94ae5ca9e (patch) | |
tree | b7805202b5c456a7c216a676eb5d2c54baa348a6 /dirmngr | |
parent | dirmngr: Align the gnutls use of CAs with the ntbtls code. (diff) | |
download | gnupg2-5a87011c46b5b01659c3cbc3c7a04da94ae5ca9e.tar.xz gnupg2-5a87011c46b5b01659c3cbc3c7a04da94ae5ca9e.zip |
dirmngr: Fix the pool keyserver case for a single host in the pool.
* dirmngr/ks-engine-hkp.c (map_host): Set R_HOSTNAME also for
localhost and if there is no pool.
Diffstat (limited to 'dirmngr')
-rw-r--r-- | dirmngr/ks-engine-hkp.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c index 653e164ea..b31557b60 100644 --- a/dirmngr/ks-engine-hkp.c +++ b/dirmngr/ks-engine-hkp.c @@ -479,7 +479,20 @@ map_host (ctrl_t ctrl, const char *name, const char *srvtag, int force_reselect, if (!name || !*name) { *r_host = xtrystrdup ("localhost"); - return *r_host? 0 : gpg_error_from_syserror (); + if (!*r_host) + return gpg_error_from_syserror (); + if (r_httphost) + { + *r_httphost = xtrystrdup (*r_host); + if (!*r_httphost) + { + err = gpg_error_from_syserror (); + xfree (*r_host); + *r_host = NULL; + return err; + } + } + return 0; } /* See whether the host is in our table. */ @@ -652,6 +665,12 @@ map_host (ctrl_t ctrl, const char *name, const char *srvtag, int force_reselect, } free_dns_addrinfo (aibuf); } + else if (r_httphost) + { + *r_httphost = xtrystrdup (hi->name); + if (!*r_httphost) + return gpg_error_from_syserror (); + } if (hi->dead) { |