aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-08-27 01:15:46 +0000
committerNIIBE Yutaka <[email protected]>2013-08-27 01:19:49 +0000
commit6d8f36a0458a50685e130c55018e0d941101d952 (patch)
treefec2433e3e7402739a6417a924c8fbca66f14120
parentscd: Make SPRx32 pinpad work with PC/SC on Windows. (diff)
downloadgnupg-6d8f36a0458a50685e130c55018e0d941101d952.tar.gz
gnupg-6d8f36a0458a50685e130c55018e0d941101d952.zip
scd: fix Vega for Alpha reader.
* scd/ccid-driver.c (ccid_vendor_specific_init): Fix error handling and size of command. -- Signed-off-by: NIIBE Yutaka
-rw-r--r--scd/ccid-driver.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 42a219f27..b812cb0ef 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1537,6 +1537,7 @@ ccid_vendor_specific_init (ccid_driver_t handle)
{
if (handle->id_vendor == VENDOR_VEGA && handle->id_product == VEGA_ALPHA)
{
+ int r;
/*
* Vega alpha has a feature to show retry counter on the pinpad
* display. But it assumes that the card returns the value of
@@ -1545,9 +1546,12 @@ ccid_vendor_specific_init (ccid_driver_t handle)
* VERIFY command with empty data. This vendor specific command
* sequence is to disable the feature.
*/
- const unsigned char cmd[] = "\xb5\x01\x00\x03\x00";
+ const unsigned char cmd[] = { '\xb5', '\x01', '\x00', '\x03', '\x00' };
- return send_escape_cmd (handle, cmd, sizeof (cmd), NULL, 0, NULL);
+ r = send_escape_cmd (handle, cmd, sizeof (cmd), NULL, 0, NULL);
+ if (r != 0 && r != CCID_DRIVER_ERR_CARD_INACTIVE
+ && r != CCID_DRIVER_ERR_NO_CARD)
+ return r;
}
return 0;