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

javacard.framework.Util.arrayCompare() compares unsigned byte values #124

Open
biafra23 opened this issue May 29, 2018 · 0 comments
Open

Comments

@biafra23
Copy link

Util.arrayCompare() (in Jcardsim) compares unsigned byte values which is nice but incompatible with real cards by NXP and Infineon which compare signed byte values. The Javadoc does not mention explicitly whether signed or unsigned values will be used for comparision, which makes it unlikely that any implementation on cards would use unsigned values. Unfortunately bytes are signed in Java.

As a fix you can probably just remove the conversion to a unsigned short value in https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/framework/UtilProxy.java#L196 and https://github.com/licel/jcardsim/blob/master/src/main/java/com/licel/jcardsim/framework/UtilProxy.java#L197

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

No branches or pull requests

1 participant