aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2020-10-26 02:38:47 +0000
committerWerner Koch <[email protected]>2020-10-26 12:31:08 +0000
commit38040ffee81e3c7a6972c9eae42af44eaaeb6ce6 (patch)
tree7a184b50461a1f15d1222cde0b1402dd7fde5cb4
parentscd: Internal CCID driver limiting only for SPR532. (diff)
downloadgnupg-38040ffee81e3c7a6972c9eae42af44eaaeb6ce6.tar.gz
gnupg-38040ffee81e3c7a6972c9eae42af44eaaeb6ce6.zip
scd: Internal CCID driver thing only for SPR532.
* scd/ccid-driver.c (ccid_vendor_specific_setup): New. Limit only for SPR532, excluding other readers by SCM. (ccid_slot_status): Use ccid_vendor_specific_setup. -- We follow the setup procedure of libccid implementation, which sends the escape command for SPR532 only. Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/ccid-driver.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 00b81ea0a..de2f4ae95 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1299,6 +1299,19 @@ ccid_vendor_specific_init (ccid_driver_t handle)
}
+static int
+ccid_vendor_specific_setup (ccid_driver_t handle)
+{
+ if (handle->id_vendor == VENDOR_SCM && handle->id_product == SCM_SPR532)
+ {
+ DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n");
+ send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3,
+ NULL, 0, NULL);
+ }
+ return 0;
+}
+
+
#define MAX_DEVICE 4 /* See MAX_READER in apdu.c. */
struct ccid_dev_table {
@@ -2428,12 +2441,7 @@ ccid_slot_status (ccid_driver_t handle, int *statusbits, int on_wire)
if (handle->transfer == NULL)
{
ccid_setup_intr (handle);
- if (handle->id_vendor == VENDOR_SCM)
- {
- DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n");
- send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3,
- NULL, 0, NULL);
- }
+ ccid_vendor_specific_setup (handle);
}
*statusbits = 0;