Bug #4744
closed
excess bytes beyond end of response TPDU / SW if Lc=0 / Le=0
Added by laforge over 3 years ago.
Updated over 3 years ago.
Description
If P3 is 0 and there is no command nor response data (only a status word to be returned), we seem to be passing tons of extraneous zero-initialized bytes to the reader:
[003 CONN_CLIENT_MAPPED_CARD] bankd_main.c:761 Rx RSPRO tpduModemToCard
[003 CONN_CLIENT_MAPPED_CARD] bankd_main.c:701 tpduModemToCard(80f2000c00)
[003 CONN_CLIENT_MAPPED_CARD] bankd_pcsc.c:221 : OK
[003 CONN_CLIENT_MAPPED_CARD] bankd_main.c:727 tpduModemToCard response from card: 6b0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
- Priority changed from Normal to Urgent
This can also be reproduced when sending a related APDU manually:
(ISO 7816-4) > 80f2000c00
--------------------------------------------------------------------------------
Beginning transaction 0
>> 0000: 80 f2 00 0c 00 .....
<< 0000: 4f a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 O...............
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0090: 00 .
Ending transaction 0
--------------------------------------------------------------------------------
0000: 4f a4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 O...............
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...............
Unknown SW (SW 0000), 0.146s
When using teh same APDU on a different reader, we get:
(ISO 7816-4) > 80f2000c00
--------------------------------------------------------------------------------
Beginning transaction 0
>> 0000: 80 f2 00 0c 00 .....
<< 0000: 90 00 ..
Ending transaction 0
--------------------------------------------------------------------------------
Normal execution (SW 9000), 0.0414s
- Status changed from New to In Progress
- % Done changed from 0 to 80
with that fix applied:
(ISO 7816-4) > 80f2000c00
--------------------------------------------------------------------------------
Beginning transaction 0
>> 0000: 80 f2 00 0c 00 .....
<< 0000: 90 00 ..
Ending transaction 0
--------------------------------------------------------------------------------
Normal execution (SW 9000), 0.144s
- Status changed from In Progress to Resolved
- % Done changed from 80 to 100
Also available in: Atom
PDF