[git] GnuPG - branch, master, updated. gnupg-2.1.15-250-g9a34e21

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Oct 20 13:02:08 CEST 2016


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  9a34e2142b426b98c73fd888102ea1596bbce62a (commit)
      from  b680f79cc112c4831293e259d7db2921bcd783a4 (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 9a34e2142b426b98c73fd888102ea1596bbce62a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Oct 20 20:01:46 2016 +0900

    agent, g10: Fix keygen.
    
    * agent/command.c (cmd_readkey): Get length after card_readkey.
    * g10/keygen.c (gen_card_key): Fix off-by-one error.
    
    --
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/agent/command.c b/agent/command.c
index a291d5b..7d8b4c46 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1020,10 +1020,10 @@ cmd_readkey (assuan_context_t ctx, char *line)
           goto leave;
         }
 
-      pkbuflen = gcry_sexp_canon_len (pkbuf, 0, NULL, NULL);
       rc = agent_card_readkey (ctrl, keyid, &pkbuf);
       if (rc)
         goto leave;
+      pkbuflen = gcry_sexp_canon_len (pkbuf, 0, NULL, NULL);
       rc = gcry_sexp_sscan (&s_pkey, NULL, (char*)pkbuf, pkbuflen);
       if (rc)
         goto leave;
diff --git a/g10/keygen.c b/g10/keygen.c
index 90f8544..2115b5a 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -4876,7 +4876,7 @@ gen_card_key (int algo, int keyno, int is_primary, kbnode_t pub_root,
   unsigned char *public;
   gcry_sexp_t s_key;
 
-  snprintf (keyid, DIM(keyid)-1, "OPENPGP.%d", keyno);
+  snprintf (keyid, DIM(keyid), "OPENPGP.%d", keyno);
   keyid[DIM(keyid)-1] = 0;
 
   if (algo != PUBKEY_ALGO_RSA)

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

Summary of changes:
 agent/command.c | 2 +-
 g10/keygen.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list