licel / jcardsim

https://jcardsim.org
224 stars 123 forks source link

Lc = 0x00 is not allowed according to ISO7816-4 and should not work on any card or simulation. Your command is malformed. #189

Closed marshaltang closed 2 years ago

marshaltang commented 2 years ago

Lc = 0x00 is not allowed according to ISO7816-4 and should not work on any card or simulation. Your command is malformed.

Originally posted by @paulbastian in https://github.com/licel/jcardsim/issues/119#issuecomment-358716285

is it possible to support case2-ext mode APDU ? where Lc = 00, Le has 2 bytes

marshaltang commented 2 years ago

https://docs.oracle.com/en/java/javacard/3.1/guide/extended-apdu-nominal-cases.html#GUID-C8CA5A47-D279-4050-8C4A-E964F3869C41

plus CASE 3E, CASE 4E ,mode

paulbastian commented 2 years ago

You should check the meanings of NC und LC,respectively NE und LE. If LC is present, it is never 0x00. Read here: https://docs.oracle.com/en/java/javacard/3.1/guide/extended-apdu-format.html#GUID-0F452782-9402-43E9-B39C-337772C200DF