[git] GnuPG - branch, scd-work, updated. gnupg-2.1.0beta3-139-gc5f73c3

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Jan 28 04:40:48 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, scd-work has been updated
       via  c5f73c39b509e12dd6d481b471d422ad10de7d58 (commit)
      from  675ddb4e53057d4d5cd94ebe4521dce6fcdb52be (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 c5f73c39b509e12dd6d481b471d422ad10de7d58
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Jan 28 11:46:40 2013 +0900

    SCD: Add vendor specific initalization.
    
    * scd/ccid-driver.c (ccid_vendor_specific_init): New.
    (ccid_open_reader): Call ccid_vendor_specific_init.

diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index e9f39f4..6d6c3db 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -303,6 +303,9 @@ static int bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
                     size_t *nread, int expected_type, int seqno, int timeout,
                     int no_debug);
 static int abort_cmd (ccid_driver_t handle, int seqno);
+static int send_escape_cmd (ccid_driver_t handle, const unsigned char *data,
+                            size_t datalen, unsigned char *result,
+                            size_t resultmax, size_t *resultlen);
 
 /* Convert a little endian stored 4 byte value into an unsigned
    integer. */
@@ -1525,6 +1528,29 @@ ccid_get_reader_list (void)
 }
 
 
+/* Vendor specific custom initialization.  */
+static int
+ccid_vendor_specific_init (ccid_driver_t handle)
+{
+  if (handle->id_vendor == VENDOR_VEGA && handle->id_product == VEGA_ALPHA)
+    {
+      /*
+       * Vega alpha has a feature to show retry counter on the pinpad
+       * display.  But it assumes that the card returns the value of
+       * retry counter by VERIFY with empty data (return code of
+       * 63Cx).  Unfortunately, existing OpenPGP cards don't support
+       * VERIFY command with empty data.  This vendor specific command
+       * sequence is to disable the feature.
+       */
+      const unsigned char cmd[] = "\xb5\x01\x00\x03\x00";
+
+      return send_escape_cmd (handle, cmd, sizeof (cmd), NULL, 0, NULL);
+    }
+
+  return 0;
+}
+
+
 /* Open the reader with the internal number READERNO and return a
    pointer to be used as handle in HANDLE.  Returns 0 on success. */
 int
@@ -1633,6 +1659,8 @@ ccid_open_reader (ccid_driver_t *handle, const char *readerid)
         }
     }
 
+  rc = ccid_vendor_specific_init (*handle);
+
  leave:
   free (ifcdesc_extra);
   if (rc)

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

Summary of changes:
 scd/ccid-driver.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)


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




More information about the Gnupg-commits mailing list