aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-hkp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-10-24 14:27:47 +0000
committerWerner Koch <[email protected]>2015-10-25 15:47:11 +0000
commit816505958ac4308ee0dfe787d1b706982428b6cc (patch)
tree5e30e1463c53d988ba5b698d8d179628b5a5401d /dirmngr/ks-engine-hkp.c
parentgpg: Provide an interface to patch TOFU updates. (diff)
downloadgnupg-816505958ac4308ee0dfe787d1b706982428b6cc.tar.gz
gnupg-816505958ac4308ee0dfe787d1b706982428b6cc.zip
dirmngr: Implement a getnameinfo wrapper.
* dirmngr/dns-stuff.h (DNS_NUMERICHOST): New. (DNS_WITHBRACKET): New. * dirmngr/dns-stuff.c (resolve_name_standard): Factor code out to... (map_eai_to_gpg_error): new. (resolve_addr_standard): New. (resolve_dns_addr): New. * dirmngr/ks-engine-hkp.c (is_ip_address): Move to ... * dirmngr/dns-stuff.c (is_ip_address): here. Add support for non bracketed v6 addresses. * dirmngr/t-dns-stuff.c: Remove header netdb.h. (main): Add option --bracket. Use resolve_dns_name instead of getnameinfo. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--dirmngr/ks-engine-hkp.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 444f3057d..809204dcf 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -280,38 +280,6 @@ my_getnameinfo (dns_addrinfo_t ai, char *host, size_t hostlen,
}
-/* Check whether NAME is an IP address. */
-static int
-is_ip_address (const char *name)
-{
- int ndots, n;
-
- if (*name == '[')
- return 1;
- /* Check whether it is legacy IP address. */
- if (*name == '.')
- return 0; /* No. */
- ndots = n = 0;
- for (; *name; name++)
- {
- if (*name == '.')
- {
- if (name[1] == '.')
- return 0; /* No. */
- if (atoi (name+1) > 255)
- return 0; /* Value too large. */
- ndots++;
- n = 0;
- }
- else if (!strchr ("012345678", *name))
- return 0; /* Not a digit. */
- else if (++n > 3)
- return 0; /* More than 3 digits. */
- }
- return !!(ndots == 3);
-}
-
-
/* Map the host name NAME to the actual to be used host name. This
allows us to manage round robin DNS names. We use our own strategy
to choose one of the hosts. For example we skip those hosts which