upgrade to 2.1.21

This commit is contained in:
Tomas Mraz 2017-05-16 08:49:25 +02:00
parent 9c42951fbe
commit 11b4600636
4 changed files with 9 additions and 270 deletions

2
.gitignore vendored
View File

@ -52,3 +52,5 @@ gnupg-2.0.16.tar.bz2.sig
/gnupg-2.1.19.tar.bz2.sig
/gnupg-2.1.20.tar.bz2
/gnupg-2.1.20.tar.bz2.sig
/gnupg-2.1.21.tar.bz2
/gnupg-2.1.21.tar.bz2.sig

View File

@ -1,264 +0,0 @@
diff -up gnupg-2.1.20/dirmngr/dns.c.libdns gnupg-2.1.20/dirmngr/dns.c
--- gnupg-2.1.20/dirmngr/dns.c.libdns 2017-04-25 13:20:12.051976169 +0200
+++ gnupg-2.1.20/dirmngr/dns.c 2017-04-25 14:24:52.951679817 +0200
@@ -9439,29 +9439,32 @@ void dns_ai_close(struct dns_addrinfo *a
static int dns_ai_setent(struct addrinfo **ent, union dns_any *any, enum dns_type type, struct dns_addrinfo *ai) {
- struct sockaddr *saddr;
- struct sockaddr_in sin;
- struct sockaddr_in6 sin6;
+ union u {
+ struct sockaddr_in sin;
+ struct sockaddr_in6 sin6;
+ struct sockaddr_storage ss;
+ } addr;
const char *cname;
size_t clen;
+ sa_family_t f;
switch (type) {
case DNS_T_A:
- saddr = memset(&sin, '\0', sizeof sin);
+ memset(&addr.sin, '\0', sizeof addr.sin);
- sin.sin_family = AF_INET;
- sin.sin_port = htons(ai->port);
+ addr.sin.sin_family = AF_INET;
+ addr.sin.sin_port = htons(ai->port);
- memcpy(&sin.sin_addr, any, sizeof sin.sin_addr);
+ memcpy(&addr.sin.sin_addr, any, sizeof addr.sin.sin_addr);
break;
case DNS_T_AAAA:
- saddr = memset(&sin6, '\0', sizeof sin6);
+ memset(&addr.sin6, '\0', sizeof addr.sin6);
- sin6.sin6_family = AF_INET6;
- sin6.sin6_port = htons(ai->port);
+ addr.sin6.sin6_family = AF_INET6;
+ addr.sin6.sin6_port = htons(ai->port);
- memcpy(&sin6.sin6_addr, any, sizeof sin6.sin6_addr);
+ memcpy(&addr.sin6.sin6_addr, any, sizeof addr.sin6.sin6_addr);
break;
default:
@@ -9476,20 +9479,20 @@ static int dns_ai_setent(struct addrinfo
clen = 0;
}
- if (!(*ent = malloc(sizeof **ent + dns_sa_len(saddr) + ((ai->hints.ai_flags & AI_CANONNAME)? clen + 1 : 0))))
+ if (!(*ent = malloc(sizeof **ent + dns_sa_len(&addr) + ((ai->hints.ai_flags & AI_CANONNAME)? clen + 1 : 0))))
return dns_syerr();
memset(*ent, '\0', sizeof **ent);
- (*ent)->ai_family = saddr->sa_family;
+ (*ent)->ai_family = addr.ss.ss_family;
(*ent)->ai_socktype = ai->hints.ai_socktype;
(*ent)->ai_protocol = ai->hints.ai_protocol;
- (*ent)->ai_addr = memcpy((unsigned char *)*ent + sizeof **ent, saddr, dns_sa_len(saddr));
- (*ent)->ai_addrlen = dns_sa_len(saddr);
+ (*ent)->ai_addr = memcpy((unsigned char *)*ent + sizeof **ent, &addr, dns_sa_len(&addr));
+ (*ent)->ai_addrlen = dns_sa_len(&addr);
if (ai->hints.ai_flags & AI_CANONNAME)
- (*ent)->ai_canonname = memcpy((unsigned char *)*ent + sizeof **ent + dns_sa_len(saddr), cname, clen + 1);
+ (*ent)->ai_canonname = memcpy((unsigned char *)*ent + sizeof **ent + dns_sa_len(&addr), cname, clen + 1);
ai->found++;
diff -up gnupg-2.1.20/dirmngr/dns-stuff.c.libdns gnupg-2.1.20/dirmngr/dns-stuff.c
--- gnupg-2.1.20/dirmngr/dns-stuff.c.libdns 2017-04-03 20:58:25.000000000 +0200
+++ gnupg-2.1.20/dirmngr/dns-stuff.c 2017-04-25 09:31:51.503657541 +0200
@@ -845,7 +845,7 @@ resolve_name_libdns (const char *name, u
(*r_canonname)[strlen (*r_canonname)-1] = 0;
}
- dai = xtrymalloc (sizeof *dai + ent->ai_addrlen -1);
+ dai = xtrymalloc (sizeof *dai);
if (dai == NULL)
{
err = gpg_error_from_syserror ();
@@ -969,7 +969,7 @@ resolve_name_standard (const char *name,
if (opt_disable_ipv6 && ai->ai_family == AF_INET6)
continue;
- dai = xtrymalloc (sizeof *dai + ai->ai_addrlen - 1);
+ dai = xtrymalloc (sizeof *dai);
dai->family = ai->ai_family;
dai->socktype = ai->ai_socktype;
dai->protocol = ai->ai_protocol;
@@ -1037,7 +1037,7 @@ resolve_dns_name (const char *name, unsi
#ifdef USE_LIBDNS
/* Resolve an address using libdns. */
static gpg_error_t
-resolve_addr_libdns (const struct sockaddr *addr, int addrlen,
+resolve_addr_libdns (const struct sockaddr_storage *addr, int addrlen,
unsigned int flags, char **r_name)
{
gpg_error_t err;
@@ -1051,13 +1051,13 @@ resolve_addr_libdns (const struct sockad
/* First we turn ADDR into a DNS name (with ".arpa" suffix). */
err = 0;
- if (addr->sa_family == AF_INET6)
+ if (addr->ss_family == AF_INET6)
{
const struct sockaddr_in6 *a6 = (const struct sockaddr_in6 *)addr;
if (!dns_aaaa_arpa (host, sizeof host, (void*)&a6->sin6_addr))
err = gpg_error (GPG_ERR_INV_OBJ);
}
- else if (addr->sa_family == AF_INET)
+ else if (addr->ss_family == AF_INET)
{
const struct sockaddr_in *a4 = (const struct sockaddr_in *)addr;
if (!dns_a_arpa (host, sizeof host, (void*)&a4->sin_addr))
@@ -1145,18 +1145,19 @@ resolve_addr_libdns (const struct sockad
buflen = sizeof ptr.host;
p = buffer;
- if (addr->sa_family == AF_INET6 && (flags & DNS_WITHBRACKET))
+ if (addr->ss_family == AF_INET6 && (flags & DNS_WITHBRACKET))
{
*p++ = '[';
buflen -= 2;
}
- ec = getnameinfo (addr, addrlen, p, buflen, NULL, 0, NI_NUMERICHOST);
+ ec = getnameinfo ((const struct sockaddr *)addr,
+ addrlen, p, buflen, NULL, 0, NI_NUMERICHOST);
if (ec)
{
err = map_eai_to_gpg_error (ec);
goto leave;
}
- if (addr->sa_family == AF_INET6 && (flags & DNS_WITHBRACKET))
+ if (addr->ss_family == AF_INET6 && (flags & DNS_WITHBRACKET))
strcat (buffer, "]");
}
@@ -1170,7 +1171,7 @@ resolve_addr_libdns (const struct sockad
/* Resolve an address using the standard system function. */
static gpg_error_t
-resolve_addr_standard (const struct sockaddr *addr, int addrlen,
+resolve_addr_standard (const struct sockaddr_storage *addr, int addrlen,
unsigned int flags, char **r_name)
{
gpg_error_t err;
@@ -1188,20 +1189,22 @@ resolve_addr_standard (const struct sock
if ((flags & DNS_NUMERICHOST) || tor_mode)
ec = EAI_NONAME;
else
- ec = getnameinfo (addr, addrlen, buffer, buflen, NULL, 0, NI_NAMEREQD);
+ ec = getnameinfo ((const struct sockaddr *)addr,
+ addrlen, buffer, buflen, NULL, 0, NI_NAMEREQD);
if (!ec && *buffer == '[')
ec = EAI_FAIL; /* A name may never start with a bracket. */
else if (ec == EAI_NONAME)
{
p = buffer;
- if (addr->sa_family == AF_INET6 && (flags & DNS_WITHBRACKET))
+ if (addr->ss_family == AF_INET6 && (flags & DNS_WITHBRACKET))
{
*p++ = '[';
buflen -= 2;
}
- ec = getnameinfo (addr, addrlen, p, buflen, NULL, 0, NI_NUMERICHOST);
- if (!ec && addr->sa_family == AF_INET6 && (flags & DNS_WITHBRACKET))
+ ec = getnameinfo ((const struct sockaddr *)addr,
+ addrlen, p, buflen, NULL, 0, NI_NUMERICHOST);
+ if (!ec && addr->ss_family == AF_INET6 && (flags & DNS_WITHBRACKET))
strcat (buffer, "]");
}
@@ -1230,7 +1233,7 @@ resolve_addr_standard (const struct sock
/* A wrapper around getnameinfo. */
gpg_error_t
-resolve_dns_addr (const struct sockaddr *addr, int addrlen,
+resolve_dns_addr (const struct sockaddr_storage *addr, int addrlen,
unsigned int flags, char **r_name)
{
gpg_error_t err;
diff -up gnupg-2.1.20/dirmngr/dns-stuff.h.libdns gnupg-2.1.20/dirmngr/dns-stuff.h
--- gnupg-2.1.20/dirmngr/dns-stuff.h.libdns 2017-04-03 20:58:25.000000000 +0200
+++ gnupg-2.1.20/dirmngr/dns-stuff.h 2017-04-25 09:31:51.503657541 +0200
@@ -78,7 +78,7 @@ struct dns_addrinfo_s
int socktype;
int protocol;
int addrlen;
- struct sockaddr addr[1];
+ struct sockaddr_storage addr[1];
};
@@ -142,7 +142,7 @@ gpg_error_t resolve_dns_name (const char
dns_addrinfo_t *r_dai, char **r_canonname);
/* Function similar to getnameinfo. */
-gpg_error_t resolve_dns_addr (const struct sockaddr *addr, int addrlen,
+gpg_error_t resolve_dns_addr (const struct sockaddr_storage *addr, int addrlen,
unsigned int flags, char **r_name);
/* Return true if NAME is a numerical IP address. */
diff -up gnupg-2.1.20/dirmngr/http.c.libdns gnupg-2.1.20/dirmngr/http.c
--- gnupg-2.1.20/dirmngr/http.c.libdns 2017-04-03 17:13:56.000000000 +0200
+++ gnupg-2.1.20/dirmngr/http.c 2017-04-25 09:31:51.503657541 +0200
@@ -2470,13 +2470,13 @@ start_server ()
* This function is basically a copy of the same internal fucntion in
* Libassuan. */
static int
-use_socks (struct sockaddr *addr)
+use_socks (struct sockaddr_storage *addr)
{
int mode;
if (assuan_sock_get_flag (ASSUAN_INVALID_FD, "tor-mode", &mode) || !mode)
return 0; /* Not in Tor mode. */
- else if (addr->sa_family == AF_INET6)
+ else if (addr->ss_family == AF_INET6)
{
struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr;
const unsigned char *s;
@@ -2491,7 +2491,7 @@ use_socks (struct sockaddr *addr)
return 0; /* This is the loopback address. */
}
- else if (addr->sa_family == AF_INET)
+ else if (addr->ss_family == AF_INET)
{
struct sockaddr_in *addr_in = (struct sockaddr_in *)addr;
@@ -2508,7 +2508,7 @@ use_socks (struct sockaddr *addr)
/* Wrapper around assuan_sock_new which takes the domain from an
* address parameter. */
static assuan_fd_t
-my_sock_new_for_addr (struct sockaddr *addr, int type, int proto)
+my_sock_new_for_addr (struct sockaddr_storage *addr, int type, int proto)
{
int domain;
@@ -2519,7 +2519,7 @@ my_sock_new_for_addr (struct sockaddr *a
domain = AF_INET;
}
else
- domain = addr->sa_family;
+ domain = addr->ss_family;
return assuan_sock_new (domain, type, proto);
}
@@ -2644,7 +2644,8 @@ connect_server (const char *server, unsi
}
anyhostaddr = 1;
- if (assuan_sock_connect (sock, ai->addr, ai->addrlen))
+ if (assuan_sock_connect (sock, (struct sockaddr *)ai->addr,
+ ai->addrlen))
{
last_err = gpg_err_make (default_errsource,
gpg_err_code_from_syserror ());

View File

@ -1,7 +1,7 @@
Summary: Utility for secure communication and data storage
Name: gnupg2
Version: 2.1.20
Release: 2%{?dist}
Version: 2.1.21
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
@ -19,7 +19,6 @@ Patch4: gnupg-2.1.20-file-is-digest.patch
Patch5: gnupg-2.1.1-ocsp-keyusage.patch
Patch6: gnupg-2.1.1-fips-algo.patch
Patch7: gnupg-2.1.20-build.patch
Patch8: gnupg-2.1.20-libdns.patch
URL: http://www.gnupg.org/
@ -98,7 +97,6 @@ to the base GnuPG package
%patch5 -p1 -b .keyusage
%patch6 -p1 -b .fips
%patch7 -p1 -b .build
%patch8 -p1 -b .libdns
# pcsc-lite library major: 0 in 1.2.0, 1 in 1.2.9+ (dlopen()'d in pcsc-wrapper)
# Note: this is just the name of the default shared lib to load in scdaemon,
@ -212,6 +210,9 @@ fi
%changelog
* Tue May 16 2017 Tomáš Mráz <tmraz@redhat.com> - 2.1.21-1
- upgrade to 2.1.21
* Tue Apr 25 2017 Tomáš Mráz <tmraz@redhat.com> - 2.1.20-2
- libdns aliasing issues fixed

View File

@ -1,2 +1,2 @@
SHA512 (gnupg-2.1.20.tar.bz2) = 14a9890bc64e143f87cff121dd298d490d78dbd34e36883e0f25763ff9064e5706a7632893d7c5d0e8e9b8cf9cdb0d378b4ce1715348729f0fc080455b61eca9
SHA512 (gnupg-2.1.20.tar.bz2.sig) = d46007b34ca26be2eb9a4999c42c9163382c2b94fcea6f255f2f5158f382865747c6c7fa725524646844698f118740e8f60ae1dd8185348f15d0e5fe66d48ab0
SHA512 (gnupg-2.1.21.tar.bz2) = ddced44c37a220af8371ba36357fc0f23b22b57daec1cba6d4a1a015d345eac7f6060c88b22a5cd457ee364d0ec1f02175644aed1970a97abfa84a3d285bc512
SHA512 (gnupg-2.1.21.tar.bz2.sig) = 81175787730a191c4290ecec34f4b056082e6e76e959d4cf6f6f7f6b4c78bc2dd2a19ca86c329c0146ef8c451b457f12db4e1010d6bd17d205646b21964b4a5a