don't force the max buffer size with Le=0

This happens, when we know the size will be smaller, but we still use
Le=0 in case of SM.
This commit is contained in:
Frank Morgner 2019-01-07 16:35:36 +01:00
parent 609e2d89cf
commit 7d36bab701
1 changed files with 0 additions and 8 deletions

View File

@ -291,10 +291,6 @@ sc_check_apdu(sc_card_t *card, const sc_apdu_t *apdu)
/* data is expected */
if (apdu->resplen == 0 || apdu->resp == NULL)
goto error;
/* return buffer to small */
if ((apdu->le == 0 && apdu->resplen < SC_MAX_APDU_BUFFER_SIZE-2)
|| (apdu->resplen < apdu->le))
goto error;
break;
case SC_APDU_CASE_3_SHORT:
/* data is sent */
@ -314,10 +310,6 @@ sc_check_apdu(sc_card_t *card, const sc_apdu_t *apdu)
/* data is expected */
if (apdu->resplen == 0 || apdu->resp == NULL)
goto error;
/* return buffer to small */
if ((apdu->le == 0 && apdu->resplen < SC_MAX_APDU_BUFFER_SIZE-2)
|| (apdu->resplen < apdu->le))
goto error;
/* inconsistent datalen */
if (apdu->datalen != apdu->lc)
goto error;