Skip to content
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

Fix length of filesize parameter in FCP template #116

Merged
merged 2 commits into from
Jan 10, 2018

Conversation

suttod
Copy link
Contributor

@suttod suttod commented Jan 5, 2018

'Number of data bytes in the file' parameters should be represented on
two bytes in FCP.

'Number of data bytes in the file' parameters should be represented on
two bytes in FCP.
@frankmorgner
Copy link
Owner

grafik
I am seeing a variable lenght... What version of the standard are you using?

@suttod
Copy link
Contributor Author

suttod commented Jan 8, 2018

You might be right. In the first ('95) version of the standard contained fix length of 2 bytes for both tags (http:https://cardwerk.com/smart-card-standard-iso7816-4-section-5-basic-organizations/).

I'm using the 2005 version of the standard which still sais 2 bytes for tag 0x81, but allows variable length for tag 0x80.

Unfortunately my host-application only supports older versions of the standard. I may override this function on a lower level if you do prefer so.

@frankmorgner
Copy link
Owner

Maybe you could refactor the patch so that the length takes at least 2 bytes and possibly more. That should be backward compatible.

Increase length of filesize parameter in FCP template if can't be
represented on two bytes.
@frankmorgner frankmorgner merged commit a9482d9 into frankmorgner:master Jan 10, 2018
@frankmorgner
Copy link
Owner

thanks

@suttod suttod deleted the fix_fcp_size_len branch March 26, 2020 19:45
suttod added a commit to suttod/vsmartcard that referenced this pull request Mar 26, 2020
* Fix length of filesize parameter in FCP template

'Number of data bytes in the file' parameters should be represented on
two bytes in FCP.

* Extendable length of filesize parameter in FCP

Increase length of filesize parameter in FCP template if can't be
represented on two bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants