scd: Fix Cherry ST-2000 support for pinpad input.

* scd/apdu.c (pcsc_vendor_specific_init): Set pinmax to 15.
* scd/ccid-driver.c (ccid_transceive_secure): Add zero for the
template of APDU.

--

GnuPG-bug-id: 2003, 2004
This commit is contained in:
NIIBE Yutaka 2015-06-22 14:31:25 +09:00
parent 0948c4f217
commit 444e9232aa
2 changed files with 16 additions and 6 deletions

View File

@ -1825,8 +1825,12 @@ pcsc_vendor_specific_init (int slot)
reader_table[slot].is_spr532 = 1; reader_table[slot].is_spr532 = 1;
reader_table[slot].pinpad_varlen_supported = 1; reader_table[slot].pinpad_varlen_supported = 1;
} }
else if (strstr (reader_table[slot].rdrname, "ST-2xxx") else if (strstr (reader_table[slot].rdrname, "ST-2xxx"))
|| strstr (reader_table[slot].rdrname, "cyberJack") {
reader_table[slot].pcsc.pinmax = 15;
reader_table[slot].pinpad_varlen_supported = 1;
}
else if (strstr (reader_table[slot].rdrname, "cyberJack")
|| strstr (reader_table[slot].rdrname, "DIGIPASS") || strstr (reader_table[slot].rdrname, "DIGIPASS")
|| strstr (reader_table[slot].rdrname, "Gnuk") || strstr (reader_table[slot].rdrname, "Gnuk")
|| strstr (reader_table[slot].rdrname, "KAAN")) || strstr (reader_table[slot].rdrname, "KAAN"))
@ -1891,8 +1895,12 @@ pcsc_vendor_specific_init (int slot)
reader_table[slot].is_spr532 = 1; reader_table[slot].is_spr532 = 1;
reader_table[slot].pinpad_varlen_supported = 1; reader_table[slot].pinpad_varlen_supported = 1;
} }
else if ((vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */ else if (vendor == 0x046a && product == 0x003e) /* Cherry ST-2xxx */
|| vendor == 0x0c4b /* Tested with Reiner cyberJack GO */ {
reader_table[slot].pcsc.pinmax = 15;
reader_table[slot].pinpad_varlen_supported = 1;
}
else if (vendor == 0x0c4b /* Tested with Reiner cyberJack GO */
|| vendor == 0x1a44 /* Tested with Vasco DIGIPASS 920 */ || vendor == 0x1a44 /* Tested with Vasco DIGIPASS 920 */
|| vendor == 0x234b /* Tested with FSIJ Gnuk Token */ || vendor == 0x234b /* Tested with FSIJ Gnuk Token */
|| vendor == 0x0d46 /* Tested with KAAN Advanced??? */) || vendor == 0x0d46 /* Tested with KAAN Advanced??? */)

View File

@ -3316,6 +3316,7 @@ ccid_transceive_secure (ccid_driver_t handle,
size_t dummy_nresp; size_t dummy_nresp;
int testmode; int testmode;
int cherry_mode = 0; int cherry_mode = 0;
int add_zero = 0;
int enable_varlen = 0; int enable_varlen = 0;
testmode = !resp && !nresp; testmode = !resp && !nresp;
@ -3357,7 +3358,7 @@ ccid_transceive_secure (ccid_driver_t handle,
enable_varlen = 1; enable_varlen = 1;
break; break;
case VENDOR_CHERRY: case VENDOR_CHERRY:
pininfo->maxlen = 25; pininfo->maxlen = 15;
enable_varlen = 1; enable_varlen = 1;
/* The CHERRY XX44 keyboard echos an asterisk for each entered /* The CHERRY XX44 keyboard echos an asterisk for each entered
character on the keyboard channel. We use a special variant character on the keyboard channel. We use a special variant
@ -3366,6 +3367,7 @@ ccid_transceive_secure (ccid_driver_t handle,
Lc byte to the APDU. It seems that it will be replaced with Lc byte to the APDU. It seems that it will be replaced with
the actual length instead of being appended before the APDU the actual length instead of being appended before the APDU
is send to the card. */ is send to the card. */
add_zero = 1;
if (handle->id_product != CHERRY_ST2000) if (handle->id_product != CHERRY_ST2000)
cherry_mode = 1; cherry_mode = 1;
break; break;
@ -3488,7 +3490,7 @@ ccid_transceive_secure (ccid_driver_t handle,
msg[msglen++] = apdu_buf[1]; /* INS */ msg[msglen++] = apdu_buf[1]; /* INS */
msg[msglen++] = apdu_buf[2]; /* P1 */ msg[msglen++] = apdu_buf[2]; /* P1 */
msg[msglen++] = apdu_buf[3]; /* P2 */ msg[msglen++] = apdu_buf[3]; /* P2 */
if (cherry_mode) if (add_zero)
msg[msglen++] = 0; msg[msglen++] = 0;
else if (pininfo->fixedlen != 0) else if (pininfo->fixedlen != 0)
{ {