vsmartcard
vsmartcard copied to clipboard
[remote-reader] Fix ATR for 14443 Type B cards
Hi, thanks for the project! It has been very useful so far :)
For Type B cards, the Android app is currently calling IsoDep#getHiLayerResponse() to get the data to use as historical bytes in the generated wrapped ATR. According to the documentation, this method returns "a subset of the data in the ATTRIB response".
This is not compliant to the PC/SC spec; in the section defining what the wrapped ATR should be, it reads:

For 14443 Type B smartcards, the historical data should be constructed from two fields of the ATQB (the application data and the protocol info) and a nibble from ATTRIB. This pull request implements this correctly by grabbing the necessary info from NfcB.
Thank you. Could it be that the maximum frame size is miscalculated? ISO 14443-3:
It looks like a maximum frame size code of, e.g., 0 should be mapped to a maximum frame size of 16 bytes.
you are completely right, I forgot to to translate the maximum frame size code into actual size. done.
another thing I forgot to mention is that this code has the edge case where it can't differentiate between MBLI=0 and MBLI=1. right now it's returning the 2nd thing, maybe it would be better to be conservative and return MBLI=0...
I don't have experience on which value to choose as best guess, so I'd leave this up to you.
I also don't have much experience... I'll ask around
Hi! Any updates on this?