[git] GnuPG - branch, master, updated. gnupg-2.1.20-59-gf053f99
by NIIBE Yutaka
cvs at cvs.gnupg.org
Wed Apr 12 04:22:28 CEST 2017
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 f053f99ed0b0c6de7b7c4a07cbd7f7d213ddf0db (commit)
from bd0c94939faf8ccfc117fb595e9bc0105edcafa4 (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 f053f99ed0b0c6de7b7c4a07cbd7f7d213ddf0db
Author: NIIBE Yutaka <gniibe at fsij.org>
Date: Wed Apr 12 11:21:08 2017 +0900
scd: Handle unexpected suspend/resume by CCID driver.
* scd/ccid-driver.c (bulk_in): Handle unexpected failure.
--
GnuPG-bug-id: 3083
Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index c10787b..fbbd157 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1980,7 +1980,7 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
goto retry;
}
- if (buffer[0] != expected_type)
+ if (buffer[0] != expected_type && buffer[0] != RDR_to_PC_SlotStatus)
{
DEBUGOUT_1 ("unexpected bulk-in msg type (%02x)\n", buffer[0]);
abort_cmd (handle, seqno);
@@ -2020,11 +2020,23 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
switch ((buffer[7] & 0x03))
{
case 0: /* no error */ break;
- case 1: return CCID_DRIVER_ERR_CARD_INACTIVE;
- case 2: return CCID_DRIVER_ERR_NO_CARD;
+ case 1: rc = CCID_DRIVER_ERR_CARD_INACTIVE; break;
+ case 2: rc = CCID_DRIVER_ERR_NO_CARD; break;
case 3: /* RFU */ break;
}
- return 0;
+
+ if (rc)
+ {
+ /*
+ * Communication failure by device side.
+ * Possibly, it was forcibly suspended and resumed.
+ */
+ DEBUGOUT ("CCID: card inactive/removed\n");
+ handle->powered_off = 1;
+ scd_kick_the_loop ();
+ }
+
+ return rc;
}
-----------------------------------------------------------------------
Summary of changes:
scd/ccid-driver.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list