| 
      
      
      From: Frank M. <mo...@in...> - 2015-05-10 19:22:30
      
     | 
| On Sunday, May 10 at 09:18PM, Frank Morgner wrote: > On Sunday, May 10 at 08:48PM, Vincent Le Toux wrote: > > Hi, > > > > I've a question about how the file size is retrieved. > > It is implemented in iso7816.c: > > https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/iso7816.c#L362-373 > > > > I'm not a DER expert that's why I'm asking. > > > > Is a size encoded with the attribute 0x80 with 4 bytes valid ? > > How can I find the difference between 0x81 & 0x80 ? > > > > I get a card with both 0x80 (4 bytes) and 0x81 (2 bytes) tags. > > If a 4 bytes is valid, I'd like to propose a patch to the iso7816.c file to > > handle it. > > You most likely are interested in the 0x80 size only. See > http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_5_basic_organizations.aspx#table2 > > Newer versions of ISO 7816-4 define the length of 0x80 to be variable > and the length of 0x81 to be 2. So your card is conforming to the > standard though there are cases where the ISO's restriction does not > make sense. Update: The newest version of the standard should have both length variable. -- Frank Morgner Virtual Smart Card Architecture http://vsmartcard.sourceforge.net OpenPACE http://openpace.sourceforge.net IFD Handler for libnfc Devices http://sourceforge.net/projects/ifdnfc |