[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-156-g3c3648e

by NIIBE Yutaka cvs at cvs.gnupg.org
Fri Feb 22 06:23:04 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  3c3648e720b8014828573bd708c88ba4775014e3 (commit)
       via  7d376ffa321d4af6e62a2bc64ef2b8574b122b1a (commit)
      from  c36089daf76d53a1d1912f58f284b78bafe14508 (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 3c3648e720b8014828573bd708c88ba4775014e3
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Feb 22 12:55:11 2013 +0900

    agent: fix two bugs.
    
    * agent/command.c (cmd_keytocard): Decrement KEYDATALEN.
    * agent/findkey.c (agent_public_key_from_file): Increment for ELEMS.
    
    --
    For ECDSA and ECDH, there are 6 elements.

diff --git a/agent/command.c b/agent/command.c
index 2844398..823b233 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2197,6 +2197,7 @@ cmd_keytocard (assuan_context_t ctx, char *line)
 
   gcry_sexp_sprint (s_skey, GCRYSEXP_FMT_CANON, keydata, keydatalen);
   gcry_sexp_release (s_skey);
+  keydatalen--;			/* Decrement for last '\0'.  */
   /* Add timestamp "created-at" in the private key */
   timestamp = isotime2epoch (timestamp_str);
   snprintf (keydata+keydatalen-1, 30, "(10:created-at10:%010lu))", timestamp);
diff --git a/agent/findkey.c b/agent/findkey.c
index b17870e..ebdcc03 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -828,7 +828,7 @@ agent_public_key_from_file (ctrl_t ctrl,
   int i, idx;
   gcry_sexp_t s_skey;
   char algoname[6];
-  char elems[6];
+  char elems[7];
   gcry_sexp_t uri_sexp, comment_sexp;
   const char *uri, *comment;
   size_t uri_length, comment_length;

commit 7d376ffa321d4af6e62a2bc64ef2b8574b122b1a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Feb 22 11:00:27 2013 +0900

    gpg: fix keytocard and support ECC card for key attribute.
    
    * g10/call-agent.c (agent_keytocard): Supply PARM arg.
    * g10/card-util.c (card_status): Support ECC.
    (card_store_subkey): Don't assume RSA.

diff --git a/g10/call-agent.c b/g10/call-agent.c
index 85a3f28..e3250fe 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -606,6 +606,10 @@ agent_keytocard (const char *hexgrip, int keyno, int force,
 {
   int rc;
   char line[ASSUAN_LINELENGTH];
+  struct default_inq_parm_s parm;
+
+  memset (&parm, 0, sizeof parm);
+  parm.ctx = agent_ctx;
 
   snprintf (line, DIM(line)-1, "KEYTOCARD %s%s %s OPENPGP.%d %s",
             force?"--force ": "", hexgrip, serialno, keyno, timestamp);
@@ -615,8 +619,8 @@ agent_keytocard (const char *hexgrip, int keyno, int force,
   if (rc)
     return rc;
 
-  rc = assuan_transact (agent_ctx, line, NULL, NULL, default_inq_cb,
-                        NULL, NULL, NULL);
+  rc = assuan_transact (agent_ctx, line, NULL, NULL, default_inq_cb, &parm,
+                        NULL, NULL);
   if (rc)
     return rc;
 
diff --git a/g10/card-util.c b/g10/card-util.c
index 75208cc..add8eed 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -550,7 +550,9 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
             tty_fprintf (fp, " %u%c",
                          info.key_attr[i].nbits,
                          info.key_attr[i].algo == 1? 'R':
-                         info.key_attr[i].algo == 17? 'D': '?');
+                         info.key_attr[i].algo == 17? 'D':
+                         info.key_attr[i].algo == 18? 'e':
+                         info.key_attr[i].algo == 19? 'E': '?');
           tty_fprintf (fp, "\n");
         }
       tty_fprintf (fp,    "Max. PIN lengths .: %d %d %d\n",
@@ -1560,7 +1562,7 @@ card_store_subkey (KBNODE node, int use)
 
   nbits = nbits_from_pk (pk);
 
-  if (!is_RSA (pk->pubkey_algo) || (!info.is_v2 && nbits != 1024) )
+  if (!info.is_v2 && nbits != 1024)
     {
       tty_printf ("You may only store a 1024 bit RSA key on the card\n");
       tty_printf ("\n");

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

Summary of changes:
 agent/command.c  |    1 +
 agent/findkey.c  |    2 +-
 g10/call-agent.c |    8 ++++++--
 g10/card-util.c  |    6 ++++--
 4 files changed, 12 insertions(+), 5 deletions(-)


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




More information about the Gnupg-commits mailing list