[git] GnuPG - branch, master, updated. gnupg-2.1.20-56-g1538523

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Apr 12 02:50:55 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  1538523156be568046f632d1775eae30ea8bd556 (commit)
       via  c64763c3a74ecc61c2f6c5edb679a2a3879d79e7 (commit)
       via  64904ce627b6b0661acf15b5b70103c4842bb0f3 (commit)
       via  05218829589f6d4b09933fa19f568c2019367d5c (commit)
      from  c3cc9551dcc89cc25c0a0ec16d8eb12c1c221638 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1538523156be568046f632d1775eae30ea8bd556
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Apr 12 09:48:27 2017 +0900

    dirmngr: Fix dns-stuff.c.
    
    * dirmngr/dns-stuff.c: Don't include arpa/nameser.h.
    
    --
    
    It is not needed at all.  T_CERT may be defined by different type of
    ns_type.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 728f662..8b25e02 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -40,7 +40,6 @@
 #else
 # if HAVE_SYSTEM_RESOLVER
 #  include <netinet/in.h>
-#  include <arpa/nameser.h>
 #  include <resolv.h>
 # endif
 # include <netdb.h>

commit c64763c3a74ecc61c2f6c5edb679a2a3879d79e7
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Apr 12 09:24:48 2017 +0900

    agent: Simplify stream_read_cstring.
    
    * agent/command-ssh.c (stream_read_cstring): Just call
    stream_read_string.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index b15d8b2..eeb1498 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -674,13 +674,7 @@ stream_read_blob (estream_t stream, unsigned int secure, gcry_mpi_t *r_mpi)
 static gpg_error_t
 stream_read_cstring (estream_t stream, char **string)
 {
-  gpg_error_t err;
-  unsigned char *buffer;
-
-  err = stream_read_string (stream, 0, &buffer, NULL);
-  if (!err)
-    *string = (char *)buffer;
-  return err;
+  return stream_read_string (stream, 0, (unsigned char **)string, NULL);
 }
 
 

commit 64904ce627b6b0661acf15b5b70103c4842bb0f3
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Apr 12 09:11:20 2017 +0900

    dirmngr: Use a function to increment network short.
    
    * dirmngr/dns.c (plus1_ns): New.
    (dns_p_push): Use it.
    
    --
    
    On OpenBSD, htons and ntohs are expanded to GCC's statement
    expressions where local variable is allowed.  Consecutive use
    of htons and ntohs causes problem of variable name.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index 869e7ed..ae3c3b0 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -1968,6 +1968,15 @@ void dns_p_dictadd(struct dns_packet *P, unsigned short dn) {
 } /* dns_p_dictadd() */
 
 
+static inline uint16_t
+plus1_ns (uint16_t count_net)
+{
+  uint16_t count = ntohs (count);
+
+  count++;
+  return htons (count);
+}
+
 int dns_p_push(struct dns_packet *P, enum dns_section section, const void *dn, size_t dnlen, enum dns_type type, enum dns_class class, unsigned ttl, const void *any) {
 	size_t end = P->end;
 	int error;
@@ -2009,7 +2018,7 @@ update:
 		if (!P->memo.qd.base && (error = dns_p_study(P)))
 			goto error;
 
-		dns_header(P)->qdcount = htons(ntohs(dns_header(P)->qdcount) + 1);
+		dns_header(P)->qdcount = plus1_ns (dns_header(P)->qdcount);
 
 		P->memo.qd.end  = P->end;
 		P->memo.an.base = P->end;
@@ -2027,7 +2036,7 @@ update:
 		if (!P->memo.an.base && (error = dns_p_study(P)))
 			goto error;
 
-		dns_header(P)->ancount = htons(ntohs(dns_header(P)->ancount) + 1);
+		dns_header(P)->ancount = plus1_ns (dns_header(P)->ancount);
 
 		P->memo.an.end  = P->end;
 		P->memo.ns.base = P->end;
@@ -2043,7 +2052,7 @@ update:
 		if (!P->memo.ns.base && (error = dns_p_study(P)))
 			goto error;
 
-		dns_header(P)->nscount = htons(ntohs(dns_header(P)->nscount) + 1);
+		dns_header(P)->nscount = plus1_ns (dns_header(P)->nscount);
 
 		P->memo.ns.end  = P->end;
 		P->memo.ar.base = P->end;
@@ -2054,7 +2063,7 @@ update:
 		if (!P->memo.ar.base && (error = dns_p_study(P)))
 			goto error;
 
-		dns_header(P)->arcount = htons(ntohs(dns_header(P)->arcount) + 1);
+		dns_header(P)->arcount = plus1_ns (dns_header(P)->arcount);
 
 		P->memo.ar.end = P->end;
 

commit 05218829589f6d4b09933fa19f568c2019367d5c
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Apr 12 08:47:23 2017 +0900

    g10: Minor clean up for export.c.
    
    * g10/export.c (export_ssh_key): Check IDENTIFIER for error.
    Release base64 thing on error of get_membuf.
    
    --
    
    Compiler (older) may misunderstand the variable IDENTIFIER is not
    initialized, while good one can do better analysys on the value for
    ERR (and thus, IDENTIFIER).
    
    On the error of get_membuf, still, b64enc_finish should be called,
    even if it lost the ERR value.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/export.c b/g10/export.c
index 31caa55..9b203e3 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -2125,7 +2125,7 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
   u32 curtime = make_timestamp ();
   kbnode_t latest_key, node;
   PKT_public_key *pk;
-  const char *identifier;
+  const char *identifier = NULL;
   membuf_t mb;
   estream_t fp = NULL;
   struct b64state b64_state;
@@ -2321,8 +2321,6 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
               identifier = "ecdsa-sha2-nistp384";
             else if (!strcmp (curve, "nistp521"))
               identifier = "ecdsa-sha2-nistp521";
-            else
-              identifier = NULL;
 
             if (!identifier)
               err = gpg_error (GPG_ERR_UNKNOWN_CURVE);
@@ -2353,7 +2351,7 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
       break;
     }
 
-  if (err)
+  if (!identifier)
     goto leave;
 
   if (opt.outfile && *opt.outfile && strcmp (opt.outfile, "-"))
@@ -2369,22 +2367,21 @@ export_ssh_key (ctrl_t ctrl, const char *userid)
 
   es_fprintf (fp, "%s ", identifier);
   err = b64enc_start_es (&b64_state, fp, "");
-  if (err)
-    goto leave;
-  {
-    void *blob;
-    size_t bloblen;
+  if (!err)
+    {
+      void *blob;
+      size_t bloblen;
 
-    blob = get_membuf (&mb, &bloblen);
-    if (!blob)
-      err = gpg_error_from_syserror ();
-    else
-      err = b64enc_write (&b64_state, blob, bloblen);
-    xfree (blob);
-    if (err)
-      goto leave;
-  }
-  err = b64enc_finish (&b64_state);
+      blob = get_membuf (&mb, &bloblen);
+      if (blob)
+        {
+          err = b64enc_write (&b64_state, blob, bloblen);
+          xfree (blob);
+          if (err)
+            goto leave;
+        }
+      err = b64enc_finish (&b64_state);
+    }
   if (err)
     goto leave;
   es_fprintf (fp, " openpgp:0x%08lX\n", (ulong)keyid_from_pk (pk, NULL));

-----------------------------------------------------------------------

Summary of changes:
 agent/command-ssh.c |  8 +-------
 dirmngr/dns-stuff.c |  1 -
 dirmngr/dns.c       | 17 +++++++++++++----
 g10/export.c        | 35 ++++++++++++++++-------------------
 4 files changed, 30 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list