[git] GnuPG - branch, master, updated. gnupg-2.1.6-5-g5b46726

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Jul 8 09:15:59 CEST 2015


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  5b46726931049e060d8fbfa879db7907078a9aed (commit)
      from  1be2cebf7ff5837c8b548b4f4afbf1b8b28211bc (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 5b46726931049e060d8fbfa879db7907078a9aed
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Jul 8 15:05:06 2015 +0900

    g10: Use canonical name for curve.
    
    * g10/import.c (transfer_secret_keys): Use canonical name.
    * common/openpgp-oid.c (openpgp_curve_to_oid): Return NULL on error.
    * g10/keyid.c (pubkey_string): Follow change of openpgp_curve_to_oid.
    * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto.
    * g10/parse-packet.c (parse_key): Ditto.

diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index 7a75801..676079c 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -332,7 +332,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits)
 }
 
 
-/* Map an OpenPGP OID to the Libgcrypt curve NAME.  Returns "?" for
+/* Map an OpenPGP OID to the Libgcrypt curve NAME.  Returns NULL for
    unknown curve names.  We prefer an alias name here which is more
    suitable for printing.  */
 const char *
@@ -341,13 +341,13 @@ openpgp_oid_to_curve (const char *oidstr)
   int i;
 
   if (!oidstr)
-    return "";
+    return NULL;
 
   for (i=0; oidtable[i].name; i++)
     if (!strcmp (oidtable[i].oidstr, oidstr))
       return oidtable[i].alias? oidtable[i].alias : oidtable[i].name;
 
-  return "?";
+  return NULL;
 }
 
 
diff --git a/g10/import.c b/g10/import.c
index de22520..0a2ebcd 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1414,7 +1414,9 @@ transfer_secret_keys (ctrl_t ctrl, struct stats_s *stats, kbnode_t sec_keyblock,
             err = gpg_error_from_syserror ();
           else
             {
-              err = gcry_sexp_build (&curve, NULL, "(curve %s)", curvestr);
+              const char *curvename = openpgp_oid_to_curve (curvestr);
+              err = gcry_sexp_build (&curve, NULL, "(curve %s)",
+                                     curvename?curvename:curvestr);
               xfree (curvestr);
               if (!err)
                 {
diff --git a/g10/keyid.c b/g10/keyid.c
index 90d982e..6b6f670 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -121,7 +121,7 @@ pubkey_string (PKT_public_key *pk, char *buffer, size_t bufsize)
       char *curve = openpgp_oid_to_str (pk->pkey[0]);
       const char *name = openpgp_oid_to_curve (curve);
 
-      if (*name && *name != '?')
+      if (name)
         snprintf (buffer, bufsize, "%s", name);
       else if (curve)
         snprintf (buffer, bufsize, "E_%s", curve);
diff --git a/g10/keylist.c b/g10/keylist.c
index d4e572e..d81e7dd 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -1092,7 +1092,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr,
             {
               char *curve = openpgp_oid_to_str (pk2->pkey[0]);
               const char *name = openpgp_oid_to_curve (curve);
-              if (!*name || *name == '?')
+              if (!name)
                 name = curve;
               es_fprintf (es_stdout, " %s", name);
               xfree (curve);
@@ -1359,7 +1359,7 @@ list_keyblock_colon (KBNODE keyblock, int secret, int has_secret, int fpr)
     {
       char *curve = openpgp_oid_to_str (pk->pkey[0]);
       const char *name = openpgp_oid_to_curve (curve);
-      if (!*name || *name == '?')
+      if (!name)
         name = curve;
       es_fputs (name, es_stdout);
       xfree (curve);
@@ -1488,7 +1488,7 @@ list_keyblock_colon (KBNODE keyblock, int secret, int has_secret, int fpr)
             {
               char *curve = openpgp_oid_to_str (pk->pkey[0]);
               const char *name = openpgp_oid_to_curve (curve);
-              if (!*name || *name == '?')
+              if (!name)
                 name = curve;
               es_fputs (name, es_stdout);
               xfree (curve);
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 5116404..6131d32 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -2086,8 +2086,8 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
                    || algorithm == PUBKEY_ALGO_ECDH) && i==0)
                 {
                   char *curve = openpgp_oid_to_str (pk->pkey[0]);
-                  es_fprintf (listfp, " %s (%s)",
-                              openpgp_oid_to_curve (curve), curve);
+                  const char *name = openpgp_oid_to_curve (curve);
+                  es_fprintf (listfp, " %s (%s)", name?name:"", curve);
                   xfree (curve);
                 }
               es_putc ('\n', listfp);

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

Summary of changes:
 common/openpgp-oid.c | 6 +++---
 g10/import.c         | 4 +++-
 g10/keyid.c          | 2 +-
 g10/keylist.c        | 6 +++---
 g10/parse-packet.c   | 4 ++--
 5 files changed, 12 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list