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:
parent
609e2d89cf
commit
7d36bab701
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue