Index: b/scd/ccid-driver.c =================================================================== --- b/scd/ccid-driver.c +++ b/scd/ccid-driver.c @@ -3316,6 +3316,7 @@ size_t dummy_nresp; int testmode; int cherry_mode = 0; + int add_zero = 0; int enable_varlen = 0; testmode = !resp && !nresp; @@ -3366,6 +3367,7 @@ Lc byte to the APDU. It seems that it will be replaced with the actual length instead of being appended before the APDU is send to the card. */ + add_zero = 1; if (handle->id_product != CHERRY_ST2000) cherry_mode = 1; break; @@ -3488,7 +3490,7 @@ msg[msglen++] = apdu_buf[1]; /* INS */ msg[msglen++] = apdu_buf[2]; /* P1 */ msg[msglen++] = apdu_buf[3]; /* P2 */ - if (cherry_mode) + if (add_zero) msg[msglen++] = 0; else if (pininfo->fixedlen != 0) {