[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-376-g5ff6d0c

by NIIBE Yutaka cvs at cvs.gnupg.org
Tue Apr 8 05:15:21 CEST 2014


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  5ff6d0c25e6d0f422b17809b954e9e87cb137347 (commit)
       via  40c3b0741e593d0658dda0c707c4f32e80648dd1 (commit)
      from  513c67b7461a2451247ef2b2fc64e0470a16edf1 (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 5ff6d0c25e6d0f422b17809b954e9e87cb137347
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Apr 8 12:15:20 2014 +0900

    agent: Support EdDSA.
    
    * agent/pksign.c (agent_pksign_do): Handle EdDSA signature.

diff --git a/agent/pksign.c b/agent/pksign.c
index fb593a6..713c8ba 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -324,12 +324,18 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce,
       int key_type;
       int is_RSA = 0;
       int is_ECDSA = 0;
+      int is_EdDSA = 0;
 
-      key_type = agent_is_dsa_key (s_skey);
-      if (key_type == 0)
-        is_RSA = 1;
-      else if (key_type == GCRY_PK_ECDSA)
-        is_ECDSA = 1;
+      if (agent_is_eddsa_key (s_skey))
+        is_EdDSA = 1;
+      else
+        {
+          key_type = agent_is_dsa_key (s_skey);
+          if (key_type == 0)
+            is_RSA = 1;
+          else if (key_type == GCRY_PK_ECDSA)
+            is_ECDSA = 1;
+        }
 
       rc = divert_pksign (ctrl,
                           data, datalen,
@@ -356,6 +362,11 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce,
 
           rc = gcry_sexp_build (&s_sig, NULL, "(sig-val(rsa(s%b)))", len, buf);
         }
+      else if (is_EdDSA)
+        {
+          rc = gcry_sexp_build (&s_sig, NULL, "(sig-val(eddsa(r%b)(s%b)))",
+                                len/2, buf, len/2, buf + len/2);
+        }
       else if (is_ECDSA)
         {
           unsigned char *r_buf_allocated = NULL;

commit 40c3b0741e593d0658dda0c707c4f32e80648dd1
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Apr 8 11:59:39 2014 +0900

    g10: EdDSA support.
    
    * g10/keyid.c (keygrip_from_pk): Compute keygrip of EdDSA key.
    * g10/keygen.c (generate_subkeypair): Ed25519 is for EdDSA.
    * common/openpgp-oid.c (oid_ed25519): Update.

diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c
index a2a3617..94a2296 100644
--- a/common/openpgp-oid.c
+++ b/common/openpgp-oid.c
@@ -39,7 +39,7 @@
 
 /* The OID for Curve Ed25519 in OpenPGP format.  */
 static const char oid_ed25519[] =
-  { 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01 };
+  { 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0xda, 0x47, 0x0f, 0x01 };
 
 
 /* Helper for openpgp_oid_from_str.  */
diff --git a/g10/keygen.c b/g10/keygen.c
index 135699d..f3052e4 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -4031,7 +4031,11 @@ generate_subkeypair (ctrl_t ctrl, kbnode_t keyblock)
   else if (algo == PUBKEY_ALGO_ECDSA
            || algo == PUBKEY_ALGO_EDDSA
            || algo == PUBKEY_ALGO_ECDH)
-    curve = ask_curve ();
+    {
+      curve = ask_curve ();
+      if (curve && !strcmp (curve, "Ed25519"))
+        algo = PUBKEY_ALGO_EDDSA;
+    }
   else
     nbits = ask_keysize (algo, 0);
 
diff --git a/g10/keyid.c b/g10/keyid.c
index 9ed64a4..2883af1 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -813,7 +813,9 @@ keygrip_from_pk (PKT_public_key *pk, unsigned char *array)
         else
           {
             err = gcry_sexp_build (&s_pkey, NULL,
-                                   "(public-key(ecc(curve%s)(q%m)))",
+                                   pk->pubkey_algo == PUBKEY_ALGO_EDDSA ?
+                                   "(public-key(ecc(curve%s)(flags eddsa)(q%m)))"
+                                   : "(public-key(ecc(curve%s)(q%m)))",
                                    curve, pk->pkey[1]);
             xfree (curve);
           }

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

Summary of changes:
 agent/pksign.c       |   21 ++++++++++++++++-----
 common/openpgp-oid.c |    2 +-
 g10/keygen.c         |    6 +++++-
 g10/keyid.c          |    4 +++-
 4 files changed, 25 insertions(+), 8 deletions(-)


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




More information about the Gnupg-commits mailing list