in case of T0 the Le value is omitted for case 4 APDUs; patch supplied by richard.musil@bigfoot.com

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2397 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2005-07-11 21:31:48 +00:00
parent eddd1e3ab6
commit b9cf818d56
1 changed files with 7 additions and 4 deletions

View File

@ -180,10 +180,13 @@ static int sc_transceive(sc_card_t *card, sc_apdu_t *apdu)
return SC_ERROR_INVALID_ARGUMENTS;
memcpy(data, apdu->data, data_bytes);
data += data_bytes;
if (apdu->le == 256)
*data++ = 0x00;
else
*data++ = (u8) apdu->le;
/* in case of T0 the Le value is omitted */
if (card->slot->active_protocol == SC_PROTO_T1) {
if (apdu->le == 256)
*data++ = 0x00;
else
*data++ = (u8) apdu->le;
}
break;
}
sendsize = data - sbuf;