1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

dirmngr: Fix specifying keyservers by IP address.

* dirmngr/ks-engine-hkp.c (map_host): Update the original 'hosttable'
entry instead of creating another one.
--
Previously, if a keyserver was given using its IP address
(e.g. 'hkp://127.0.0.1'), 'map_host' would create two entries in the
'hosttable', one with the name '127.0.0.1', and the second one with
the name 'localhost' and 'v4addr' being set to '127.0.0.1'.  But the
first entry is the one being used for lookups, and since the 'v4' flag
is not set, the 'HTTP_FLAG_IGNORE_IPv4' is used when doing the http
request, making it fail.

Signed-off-by: Justus Winter <justus@g10code.com>
GnuPG-bug-id: 2012
This commit is contained in:
Justus Winter 2015-11-16 18:18:25 +01:00
parent 58e4a492e2
commit 1e3dbb15af

View File

@ -378,7 +378,11 @@ map_host (ctrl_t ctrl, const char *name, int force_reselect,
}
else
{
tmpidx = find_hostinfo (tmphost);
if (!is_pool && is_ip_address (name))
/* Update the original entry. */
tmpidx = idx;
else
tmpidx = find_hostinfo (tmphost);
log_info ("resolve_dns_addr for '%s': '%s'%s\n",
name, tmphost,
tmpidx == -1? "" : " [already known]");