-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid reading Elementary File beyond the EOF #57
Comments
Actually the end-of-file behavior on IAS application is fixed. See IAS_ECC_v1.0.1 spec, pag 147, Table 34: Anyway, that's a good point. On ICAO all DGs are ASN.1 structures, so the lenght is encoded at the beginning of the file (the file could be bigger than the data structure inside, so reading ASN.1 lenght is be better that reading FCI). On IAS file system it's not always true, so we could have 2 different functions to read a file, one for ASN.1 structure and one for flat binary. |
Currently the read_file() reads in chunk of 128 bytes till it obtains a 'wrong length' error from the card. The behaviour on the EOF could be vendor-specific and could not work with future manufacturer, so it would be best to read the File Control Block (containing the file size) and then read the exact length, thus avoiding the EOF.
Same as: italia/cie-nis-cpp-sdk#39 (comment)
The text was updated successfully, but these errors were encountered: