[git] GnuPG - branch, master, updated. gnupg-2.1.1-49-gf6d3c6e

by NIIBE Yutaka cvs at cvs.gnupg.org
Wed Jan 28 03:25:23 CET 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  f6d3c6e5263d84b94ebe13df9ff39b02109a2acb (commit)
      from  6eebc56687935f3e993eac374b9f4cc5ad3bcf2b (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 f6d3c6e5263d84b94ebe13df9ff39b02109a2acb
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Wed Jan 28 11:24:29 2015 +0900

    scd: Fix varargs call for 64-bit arch on ECC keys.
    
    * scd/app-openpgp.c (store_fpr): Remove CARD_VERSION from the
    arguments.
    (rsa_writekey): Follow the change.
    (do_genkey): Likewise.
    (ecc_writekey): Likewise.  Cast to size_t.
    
    --
    
    KEYTOCARD caused SEGV of scdaemon on 64-bit arch.  That's because
    int is 32-bit, but size_t is 64-bit.

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 7f1ec43..f68813b 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -755,10 +755,8 @@ get_algo_byte (int keynumber, key_type_t key_type)
 
 /* Note, that FPR must be at least 20 bytes. */
 static gpg_error_t
-store_fpr (app_t app, int keynumber, u32 timestamp,
-           unsigned char *fpr, unsigned int card_version,
-           key_type_t key_type,
-           ...)
+store_fpr (app_t app, int keynumber, u32 timestamp, unsigned char *fpr,
+           key_type_t key_type, ...)
 {
   unsigned int n, nbits;
   unsigned char *buffer, *p;
@@ -821,7 +819,7 @@ store_fpr (app_t app, int keynumber, u32 timestamp,
 
   xfree (buffer);
 
-  tag = (card_version > 0x0007? 0xC7 : 0xC6) + keynumber;
+  tag = (app->card_version > 0x0007? 0xC7 : 0xC6) + keynumber;
   flush_cache_item (app, 0xC5);
   tag2 = 0xCE + keynumber;
   flush_cache_item (app, 0xCD);
@@ -830,7 +828,7 @@ store_fpr (app_t app, int keynumber, u32 timestamp,
   if (rc)
     log_error (_("failed to store the fingerprint: %s\n"),gpg_strerror (rc));
 
-  if (!rc && card_version > 0x0100)
+  if (!rc && app->card_version > 0x0100)
     {
       unsigned char buf[4];
 
@@ -3196,8 +3194,8 @@ rsa_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
       goto leave;
     }
 
-  err = store_fpr (app, keyno, created_at, fprbuf, app->card_version,
-                   KEY_TYPE_RSA, rsa_n, rsa_n_len, rsa_e, rsa_e_len);
+  err = store_fpr (app, keyno, created_at, fprbuf, KEY_TYPE_RSA,
+                   rsa_n, rsa_n_len, rsa_e, rsa_e_len);
   if (err)
     goto leave;
 
@@ -3383,16 +3381,16 @@ ecc_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
       goto leave;
     }
 
-  err = store_fpr (app, keyno, created_at, fprbuf, app->card_version,
+  err = store_fpr (app, keyno, created_at, fprbuf,
                    curve == CURVE_ED25519 ? KEY_TYPE_EDDSA : KEY_TYPE_ECC,
                    curve == CURVE_ED25519 ?
                    "\x09\x2b\x06\x01\x04\x01\xda\x47\x0f\x01"
                    : curve == CURVE_NIST_P256 ?
                    "\x08\x2a\x86\x48\xce\x3d\x03\x01\x07"
                    : "\x05\x2b\x81\x04\x00\x0a",
-                   curve == CURVE_ED25519 ? 10
-                   : curve == CURVE_NIST_P256? 9 : 6,
-                   ecc_q, ecc_q_len, "\x03\x01\x08\x07", 4);
+                   (size_t)(curve == CURVE_ED25519 ? 10
+                            : curve == CURVE_NIST_P256? 9 : 6),
+                   ecc_q, ecc_q_len, "\x03\x01\x08\x07", (size_t)4);
   if (err)
     goto leave;
 
@@ -3604,8 +3602,8 @@ do_genkey (app_t app, ctrl_t ctrl,  const char *keynostr, unsigned int flags,
   send_status_info (ctrl, "KEY-CREATED-AT",
                     numbuf, (size_t)strlen(numbuf), NULL, 0);
 
-  rc = store_fpr (app, keyno, (u32)created_at, fprbuf, app->card_version,
-                  KEY_TYPE_RSA, m, mlen, e, elen);
+  rc = store_fpr (app, keyno, (u32)created_at, fprbuf, KEY_TYPE_RSA,
+                  m, mlen, e, elen);
   if (rc)
     goto leave;
   send_fpr_if_not_null (ctrl, "KEY-FPR", -1, fprbuf);

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

Summary of changes:
 scd/app-openpgp.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)


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




More information about the Gnupg-commits mailing list