[git] GnuPG - branch, master, updated. gnupg-2.1.4-16-gcf508a1

by NIIBE Yutaka cvs at cvs.gnupg.org
Fri Jun 5 07:05:24 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  cf508a1f7f4c8926dc554be68a2d46f5ce272ac0 (commit)
      from  a4a15195c2a3729025a3ba3439ac8860083fceeb (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 cf508a1f7f4c8926dc554be68a2d46f5ce272ac0
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Jun 5 14:02:40 2015 +0900

    scd: do_decipher change for OpenPGPcard v3.0.
    
    * scd/app-openpgp.c (do_decipher): Add a header for ECDH.

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 8520231..0e751e0 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -4046,6 +4046,7 @@ do_decipher (app_t app, const char *keyidstr,
   int exmode, le_value;
   unsigned char *fixbuf = NULL;
   int padind = 0;
+  int fixuplen = 0;
 
   if (!keyidstr || !*keyidstr || !indatalen)
     return gpg_error (GPG_ERR_INV_VALUE);
@@ -4092,8 +4093,6 @@ do_decipher (app_t app, const char *keyidstr,
 
   if (app->app_local->keyattr[1].key_type == KEY_TYPE_RSA)
     {
-      int fixuplen;
-
       /* We might encounter a couple of leading zeroes in the
          cryptogram.  Due to internal use of MPIs these leading zeroes
          are stripped.  However the OpenPGP card expects exactly 128
@@ -4146,7 +4145,26 @@ do_decipher (app_t app, const char *keyidstr,
         }
     }
   else if (app->app_local->keyattr[1].key_type == KEY_TYPE_ECC)
-    padind = -1;
+    {
+      fixuplen = 7;
+      fixbuf = xtrymalloc (fixuplen + indatalen);
+      if (!fixbuf)
+        return gpg_error_from_syserror ();
+
+      /* Build 'Cipher DO' */
+      fixbuf[0] = '\xa6';
+      fixbuf[1] = (char)(indatalen+5);
+      fixbuf[2] = '\x7f';
+      fixbuf[3] = '\x49';
+      fixbuf[4] = (char)(indatalen+2);
+      fixbuf[5] = '\x86';
+      fixbuf[6] = (char)indatalen;
+      memcpy (fixbuf+fixuplen, indata, indatalen);
+      indata = fixbuf;
+      indatalen = fixuplen + indatalen;
+
+      padind = -1;
+    }
   else
     return gpg_error (GPG_ERR_INV_VALUE);
 

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

Summary of changes:
 scd/app-openpgp.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list