[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-201-gb9aceaa

by NIIBE Yutaka cvs at cvs.gnupg.org
Tue Mar 26 01:26:40 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, master has been updated
       via  b9aceaa442914beb4f5359283053b43ba5a46b4c (commit)
       via  1062893832bb15eaac853f52e1cb673e5e03790a (commit)
      from  ee95c23fcdc6673db0fc7287ab2197915d9b55b3 (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 b9aceaa442914beb4f5359283053b43ba5a46b4c
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Mar 26 09:03:55 2013 +0900

    scd: PC/SC cleanup (more).
    
    * scd/apdu.c (control_pcsc_direct, control_pcsc_wrapped, control_pcsc)
    (check_pcsc_pinpad, pcsc_pinpad_verify, pcsc_pinpad_modify): Use
    pcsc_dword_t.

diff --git a/scd/apdu.c b/scd/apdu.c
index 0eb148e..87c0426 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -1211,7 +1211,7 @@ pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
 static int
 control_pcsc_direct (int slot, pcsc_dword_t ioctl_code,
                      const unsigned char *cntlbuf, size_t len,
-                     unsigned char *buffer, size_t *buflen)
+                     unsigned char *buffer, pcsc_dword_t *buflen)
 {
   long err;
 
@@ -1233,7 +1233,7 @@ control_pcsc_direct (int slot, pcsc_dword_t ioctl_code,
 static int
 control_pcsc_wrapped (int slot, pcsc_dword_t ioctl_code,
                       const unsigned char *cntlbuf, size_t len,
-                      unsigned char *buffer, size_t *buflen)
+                      unsigned char *buffer, pcsc_dword_t *buflen)
 {
   long err = PCSC_E_NOT_TRANSACTED;
   reader_table_t slotp;
@@ -1342,7 +1342,7 @@ control_pcsc_wrapped (int slot, pcsc_dword_t ioctl_code,
 static int
 control_pcsc (int slot, pcsc_dword_t ioctl_code,
               const unsigned char *cntlbuf, size_t len,
-              unsigned char *buffer, size_t *buflen)
+              unsigned char *buffer, pcsc_dword_t *buflen)
 {
 #ifdef NEED_PCSC_WRAPPER
   return control_pcsc_wrapped (slot, ioctl_code, cntlbuf, len, buffer, buflen);
@@ -1997,7 +1997,7 @@ static int
 check_pcsc_pinpad (int slot, int command, pininfo_t *pininfo)
 {
   unsigned char buf[256];
-  size_t len = 256;
+  pcsc_dword_t len = 256;
   int sw;
 
   (void)pininfo;      /* XXX: Identify reader and set pininfo->fixedlen.  */
@@ -2058,7 +2058,7 @@ pcsc_pinpad_verify (int slot, int class, int ins, int p0, int p1,
   unsigned char *pin_verify;
   int len = PIN_VERIFY_STRUCTURE_SIZE + pininfo->fixedlen;
   unsigned char result[2];
-  size_t resultlen = 2;
+  pcsc_dword_t resultlen = 2;
 
   if (!reader_table[slot].atrlen
       && (sw = reset_pcsc_reader (slot)))
@@ -2141,7 +2141,7 @@ pcsc_pinpad_modify (int slot, int class, int ins, int p0, int p1,
   unsigned char *pin_modify;
   int len = PIN_MODIFY_STRUCTURE_SIZE + 2 * pininfo->fixedlen;
   unsigned char result[2];
-  size_t resultlen = 2;
+  pcsc_dword_t resultlen = 2;
 
   if (!reader_table[slot].atrlen
       && (sw = reset_pcsc_reader (slot)))

commit 1062893832bb15eaac853f52e1cb673e5e03790a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue Mar 26 08:43:15 2013 +0900

    scd: call update_card_removed only when detecting removal.
    
    * scd/command.c (update_reader_status_file): Add condition
    vr->status == 0.
    
    --
    
    To reproduce the bug: (1) insert card,
      (2) run "gpg2 --card-status",
      (3) remove card, (4) invoke "gpg2 --card-edit",
      (5) invoke some command like "verify"
    The last step fails (but with no error message to user).

diff --git a/scd/command.c b/scd/command.c
index 6267bb0..d5cc32c 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -2365,10 +2365,8 @@ update_reader_status_file (int set_card_removed_flag)
             xfree (homestr);
           }
 
-          /* Set the card removed flag for all current sessions.  We
-             will set this on any card change because a reset or
-             SERIALNO request must be done in any case.  */
-          if (vr->any && set_card_removed_flag)
+          /* Set the card removed flag for all current sessions.  */
+          if (vr->any && vr->status == 0 && set_card_removed_flag)
             update_card_removed (idx, 1);
 
           vr->any = 1;

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

Summary of changes:
 scd/apdu.c    |   12 ++++++------
 scd/command.c |    6 ++----
 2 files changed, 8 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list