fix extended apdu decode
This commit is contained in:
parent
315b6564ab
commit
24a006068d
@ -77,6 +77,7 @@ int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
|||||||
if (len == 7U + extlen)
|
if (len == 7U + extlen)
|
||||||
{
|
{
|
||||||
apdu->case_type = 0x13;
|
apdu->case_type = 0x13;
|
||||||
|
apdu->extended_apdu = true;
|
||||||
apdu->lc = extlen;
|
apdu->lc = extlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +85,7 @@ int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
|||||||
if (len == 7U + extlen + 2U)
|
if (len == 7U + extlen + 2U)
|
||||||
{
|
{
|
||||||
apdu->case_type = 0x14;
|
apdu->case_type = 0x14;
|
||||||
|
apdu->extended_apdu = true;
|
||||||
apdu->lc = extlen;
|
apdu->lc = extlen;
|
||||||
apdu->le = (data[len - 2] << 8) + data[len - 1];
|
apdu->le = (data[len - 2] << 8) + data[len - 1];
|
||||||
if (!apdu->le)
|
if (!apdu->le)
|
||||||
@ -94,6 +96,7 @@ int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
|||||||
if (len == 7U + extlen + 3U && data[len - 3] == 0)
|
if (len == 7U + extlen + 3U && data[len - 3] == 0)
|
||||||
{
|
{
|
||||||
apdu->case_type = 0x24;
|
apdu->case_type = 0x24;
|
||||||
|
apdu->extended_apdu = true;
|
||||||
apdu->lc = extlen;
|
apdu->lc = extlen;
|
||||||
apdu->le = (data[len - 2] << 8) + data[len - 1];
|
apdu->le = (data[len - 2] << 8) + data[len - 1];
|
||||||
if (!apdu->le)
|
if (!apdu->le)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user