[git] GnuPG - branch, master, updated. gnupg-2.1.6-42-g8704c70

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Aug 10 12:15:06 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  8704c70108218a60f8fb2ee0e558ca8ed125600d (commit)
      from  c80643c5ecbee89f343ef087313870cee1334fe4 (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 8704c70108218a60f8fb2ee0e558ca8ed125600d
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Aug 10 19:13:13 2015 +0900

    agent: fix ECC key handling.
    
    * agent/cvt-openpgp.c (get_keygrip, convert_secret_key)
    (convert_transfer_key): CURVE is the name of curve.

diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c
index 39ccba2..8bf5873 100644
--- a/agent/cvt-openpgp.c
+++ b/agent/cvt-openpgp.c
@@ -87,16 +87,10 @@ get_keygrip (int pubkey_algo, const char *curve, gcry_mpi_t *pkey,
         {
           const char *format;
 
-          if (!strcmp (curve, openpgp_curve_to_oid ("Ed25519", NULL)))
-            {
-              format = "(public-key(ecc(curve %s)(flags eddsa)(q%m)))";
-              curve = "Ed25519";
-            }
-          else if (!strcmp (curve, openpgp_curve_to_oid ("Curve25519", NULL)))
-            {
-              format = "(public-key(ecc(curve %s)(flags djb-tweak)(q%m)))";
-              curve = "Curve25519";
-            }
+          if (!strcmp (curve, "Ed25519"))
+            format = "(public-key(ecc(curve %s)(flags eddsa)(q%m)))";
+          else if (!strcmp (curve, "Curve25519"))
+            format = "(public-key(ecc(curve %s)(flags djb-tweak)(q%m)))";
           else
             format = "(public-key(ecc(curve %s)(q%m)))";
 
@@ -161,18 +155,12 @@ convert_secret_key (gcry_sexp_t *r_key, int pubkey_algo, gcry_mpi_t *skey,
         {
           const char *format;
 
-          if (!strcmp (curve, openpgp_curve_to_oid ("Ed25519", NULL)))
-            {
-              /* Do not store the OID as name but the real name and the
-                 EdDSA flag.  */
-              format = "(private-key(ecc(curve %s)(flags eddsa)(q%m)(d%m)))";
-              curve = "Ed25519";
-            }
-          else if (!strcmp (curve, openpgp_curve_to_oid ("Curve25519", NULL)))
-            {
-              format = "(private-key(ecc(curve %s)(flags djb-tweak)(q%m)(d%m)))";
-              curve = "Curve25519";
-            }
+          if (!strcmp (curve, "Ed25519"))
+            /* Do not store the OID as name but the real name and the
+               EdDSA flag.  */
+            format = "(private-key(ecc(curve %s)(flags eddsa)(q%m)(d%m)))";
+          else if (!strcmp (curve, "Curve25519"))
+            format = "(private-key(ecc(curve %s)(flags djb-tweak)(q%m)(d%m)))";
           else
             format = "(private-key(ecc(curve %s)(q%m)(d%m)))";
 
@@ -239,23 +227,17 @@ convert_transfer_key (gcry_sexp_t *r_key, int pubkey_algo, gcry_mpi_t *skey,
         {
           const char *format;
 
-          if (!strcmp (curve, openpgp_curve_to_oid ("Ed25519", NULL)))
-            {
-              /* Do not store the OID as name but the real name and the
-                 EdDSA flag.  */
-              format = "(protected-private-key(ecc(curve %s)(flags eddsa)(q%m)"
-                "(protected openpgp-native%S)))";
-              curve = "Ed25519";
-            }
-          else if (!strcmp (curve, openpgp_curve_to_oid ("Curve25519", NULL)))
-            {
-              format = "(protected-private-key(ecc(curve %s)(flags djb-tweak)(q%m)"
-                "(protected openpgp-native%S)))";
-              curve = "Curve25519";
-            }
+          if (!strcmp (curve, "Ed25519"))
+            /* Do not store the OID as name but the real name and the
+               EdDSA flag.  */
+            format = "(protected-private-key(ecc(curve %s)(flags eddsa)(q%m)"
+              "(protected openpgp-native%S)))";
+          else if (!strcmp (curve, "Curve25519"))
+            format = "(protected-private-key(ecc(curve %s)(flags djb-tweak)(q%m)"
+              "(protected openpgp-native%S)))";
           else
-              format = "(protected-private-key(ecc(curve %s)(q%m)"
-                "(protected openpgp-native%S)))";
+            format = "(protected-private-key(ecc(curve %s)(q%m)"
+              "(protected openpgp-native%S)))";
 
           err = gcry_sexp_build (&s_skey, NULL, format, curve, skey[0], transfer_key);
         }

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

Summary of changes:
 agent/cvt-openpgp.c | 58 ++++++++++++++++++-----------------------------------
 1 file changed, 20 insertions(+), 38 deletions(-)


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




More information about the Gnupg-commits mailing list