Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

OwnerPIN check and update issue when using an offset #2

Open
vletoux opened this issue Nov 7, 2015 · 2 comments
Open

OwnerPIN check and update issue when using an offset #2

vletoux opened this issue Nov 7, 2015 · 2 comments

Comments

@vletoux
Copy link

vletoux commented Nov 7, 2015

in /src/javacard/framework/OwnerPIN.java
(https://github.com/martinpaljak/vJCRE/blob/85c7828089fcde0fa8cde89a622b5ec582804947/src/javacard/framework/OwnerPIN.java)

The offset parameter of the functions check and update is not used.
My opinion is that:
Util.arrayCopy(pin, (short)0, value, (short)1, length);
should be changed to
Util.arrayCopy(pin, offset, value, (short)1, length);

and
if (Util.arrayCompare(pin, (short) 0, value, (short) 1, length) == 0) {
should be changed to
if (Util.arrayCompare(pin, offset, value, (short) 1, length) == 0) {

@vletoux
Copy link
Author

vletoux commented Nov 7, 2015

Moreover limit is set to 0 at the initialisation and its value is never changed

@vletoux
Copy link
Author

vletoux commented Nov 7, 2015

see PR #4 for a fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant