[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-271-g59207a8

by Werner Koch cvs at cvs.gnupg.org
Thu Dec 5 13:55:03 CET 2013


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  59207a86e5f40c77fed296b642bf76692e8eef65 (commit)
       via  159d42ee6ab21d97f40ee129445f37209b875739 (commit)
      from  2c9613f3260de96a4af0392adb50d7f9e06cdd70 (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 59207a86e5f40c77fed296b642bf76692e8eef65
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 22 14:26:53 2013 +0200

    gpg: Change OID of Ed25519 and add Brainpool oids.
    
    * common/openpgp-oid.c (openpgp_curve_to_oid): Change OID for
    Ed25519.  Add brainpool OIDs.
    (openpgp_oid_to_curve): Ditto.
    --
    
    This change is required to the change in Libgcrypt.  Note that we will
    likely use a different OpenPGP algorithm ID for EdDSA and thus the
    current Ed25519 implementation will not stay with us.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index a1ceba4..05b1a40 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -277,7 +277,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
     oidstr = NULL;
   else if (!strcmp (name, "Ed25519"))
     {
-      oidstr = "1.3.6.1.4.1.3029.1.5.1";
+      oidstr = "1.3.6.1.4.1.11591.15.1";
       nbits = 255;
     }
   else if (!strcmp (name, "nistp256"))
@@ -295,6 +295,21 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
       oidstr = "1.3.132.0.35";
       nbits = 521;
     }
+  else if (!strcmp (name,"brainpoolP256r1"))
+    {
+      oidstr = "1.3.36.3.3.2.8.1.1.7";
+      nbits = 256;
+    }
+  else if (!strcmp (name, "brainpoolP384r1"))
+    {
+      oidstr = "1.3.36.3.3.2.8.1.1.11";
+      nbits = 384;
+    }
+  else if (!strcmp (name, "brainpoolP512r1"))
+    {
+      oidstr =  "1.3.36.3.3.2.8.1.1.13";
+      nbits = 512;
+    }
   else
     oidstr = NULL;
 
@@ -314,15 +329,21 @@ openpgp_oid_to_curve (const char *oid)
 
   if (!oid)
     name = "";
-  else if (!strcmp (oid, "1.3.6.1.4.1.3029.1.5.1"))
+  else if (!strcmp (oid, "1.3.6.1.4.1.11591.15.1"))
     name = "Ed25519";
   else if (!strcmp (oid, "1.2.840.10045.3.1.7"))
-    name = "NIST P-256";
+    name = "nistp256";
   else if (!strcmp (oid, "1.3.132.0.34"))
-    name = "NIST P-384";
+    name = "nistp384";
   else if (!strcmp (oid, "1.3.132.0.35"))
-    name = "NIST P-521";
-  else /* FIXME: Lookup via Libgcrypt.  */
+    name = "nistp521";
+  else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.7"))
+    name = "brainpoolP256r1";
+  else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.11"))
+    name = "brainpoolP384r1";
+  else if (!strcmp (oid, "1.3.36.3.3.2.8.1.1.13"))
+    name = "brainpoolP512r1";
+  else
     name = "?";
 
   return name;

commit 159d42ee6ab21d97f40ee129445f37209b875739
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 29 15:37:23 2013 +0100

    common: Add put_membuf_printf.
    
    * common/membuf.c (put_membuf_printf): New.
    --
    
    This is just a convenience function for easier code readability.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/membuf.c b/common/membuf.c
index c3480df..02f1b27 100644
--- a/common/membuf.c
+++ b/common/membuf.c
@@ -1,5 +1,6 @@
 /* membuf.c - A simple implementation of a dynamic buffer.
  * Copyright (C) 2001, 2003, 2009, 2011 Free Software Foundation, Inc.
+ * Copyright (C) 2013 Werner Koch
  *
  * This file is part of GnuPG.
  *
@@ -30,6 +31,7 @@
 #include <config.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <stdarg.h>
 
 #include "membuf.h"
 
@@ -122,6 +124,26 @@ put_membuf_str (membuf_t *mb, const char *string)
 }
 
 
+void
+put_membuf_printf (membuf_t *mb, const char *format, ...)
+{
+  int rc;
+  va_list arg_ptr;
+  char *buf;
+
+  va_start (arg_ptr, format);
+  rc = estream_vasprintf (&buf, format, arg_ptr);
+  if (rc < 0)
+    mb->out_of_core = errno ? errno : ENOMEM;
+  va_end (arg_ptr);
+  if (rc >= 0)
+    {
+      put_membuf (mb, buf, strlen (buf));
+      xfree (buf);
+    }
+}
+
+
 void *
 get_membuf (membuf_t *mb, size_t *len)
 {
diff --git a/common/membuf.h b/common/membuf.h
index a76c1be..bf4cf36 100644
--- a/common/membuf.h
+++ b/common/membuf.h
@@ -30,6 +30,8 @@
 #ifndef GNUPG_COMMON_MEMBUF_H
 #define GNUPG_COMMON_MEMBUF_H
 
+#include "mischelp.h"
+
 /* The definition of the structure is private, we only need it here,
    so it can be allocated on the stack. */
 struct private_membuf_s
@@ -52,6 +54,8 @@ void init_membuf_secure (membuf_t *mb, int initiallen);
 void clear_membuf (membuf_t *mb, size_t amount);
 void put_membuf  (membuf_t *mb, const void *buf, size_t len);
 void put_membuf_str (membuf_t *mb, const char *string);
+void put_membuf_printf (membuf_t *mb, const char *format,
+                        ...) JNLIB_GCC_A_PRINTF(2,3);
 void *get_membuf (membuf_t *mb, size_t *len);
 const void *peek_membuf (membuf_t *mb, size_t *len);
 

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

Summary of changes:
 common/membuf.c      |   22 ++++++++++++++++++++++
 common/membuf.h      |    4 ++++
 common/openpgp-oid.c |   33 +++++++++++++++++++++++++++------
 3 files changed, 53 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list