[git] GnuPG - branch, master, updated. post-nuke-of-trailing-ws-168-g07f20f3

by NIIBE Yutaka cvs at cvs.gnupg.org
Tue Dec 20 06:32:22 CET 2011


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  07f20f313a0b13e5c93168a8a62ff1cbb94a4514 (commit)
      from  f4b7f7146349c388a2f3ce224ff2006606c66232 (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 07f20f313a0b13e5c93168a8a62ff1cbb94a4514
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Dec 20 13:34:27 2011 +0900

    Add error log and debug log for pcsc_keypad_verify and pcsc_keypad_modify.
    
    * scd/apdu.c (pcsc_keypad_verify): Add debug log and error log.
    (pcsc_keypad_modify): Likewise.

diff --git a/scd/apdu.c b/scd/apdu.c
index f470075..7bb122d 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -2053,7 +2053,7 @@ pcsc_keypad_verify (int slot, int class, int ins, int p0, int p1,
 {
   int sw;
   unsigned char *pin_verify;
-  unsigned long len = PIN_VERIFY_STRUCTURE_SIZE;
+  int len = PIN_VERIFY_STRUCTURE_SIZE;
   unsigned char result[2];
   size_t resultlen = 2;
 
@@ -2109,12 +2109,21 @@ pcsc_keypad_verify (int slot, int class, int ins, int p0, int p1,
   pin_verify[22] = p1; /* abData[3] */
   pin_verify[23] = 0x00; /* abData[4] */
 
+  if (DBG_CARD_IO)
+    log_debug ("send secure: c=%02X i=%02X p1=%02X p2=%02X len=%d pinmax=%d\n",
+	       class, ins, p0, p1, len, pininfo->maxlen);
+
   sw = control_pcsc (slot, reader_table[slot].pcsc.verify_ioctl,
                      pin_verify, len, result, &resultlen);
   xfree (pin_verify);
   if (sw || resultlen < 2)
-    return sw? sw : SW_HOST_INCOMPLETE_CARD_RESPONSE;
+    {
+      log_error ("control_pcsc failed: %d\n", sw);
+      return sw? sw: SW_HOST_INCOMPLETE_CARD_RESPONSE;
+    }
   sw = (result[resultlen-2] << 8) | result[resultlen-1];
+  if (DBG_CARD_IO)
+    log_debug (" response: sw=%04X  datalen=%d\n", sw, (unsigned int)resultlen);
   return sw;
 }
 
@@ -2126,7 +2135,7 @@ pcsc_keypad_modify (int slot, int class, int ins, int p0, int p1,
 {
   int sw;
   unsigned char *pin_modify;
-  unsigned long len = PIN_MODIFY_STRUCTURE_SIZE;
+  int len = PIN_MODIFY_STRUCTURE_SIZE;
   unsigned char result[2];
   size_t resultlen = 2;
 
@@ -2193,12 +2202,21 @@ pcsc_keypad_modify (int slot, int class, int ins, int p0, int p1,
   pin_modify[27] = p1; /* abData[3] */
   pin_modify[28] = 0x00; /* abData[4] */
 
+  if (DBG_CARD_IO)
+    log_debug ("send secure: c=%02X i=%02X p1=%02X p2=%02X len=%d pinmax=%d\n",
+	       class, ins, p0, p1, len, (int)pininfo->maxlen);
+
   sw = control_pcsc (slot, reader_table[slot].pcsc.modify_ioctl,
                      pin_modify, len, result, &resultlen);
   xfree (pin_modify);
   if (sw || resultlen < 2)
-    return sw? sw : SW_HOST_INCOMPLETE_CARD_RESPONSE;
+    {
+      log_error ("control_pcsc failed: %d\n", sw);
+      return sw? sw : SW_HOST_INCOMPLETE_CARD_RESPONSE;
+    }
   sw = (result[resultlen-2] << 8) | result[resultlen-1];
+  if (DBG_CARD_IO)
+    log_debug (" response: sw=%04X  datalen=%d\n", sw, (unsigned int)resultlen);
   return sw;
 }
 

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

Summary of changes:
 scd/apdu.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list