Fix problem with null length PIN verification on J3D081

This commit is contained in:
Arnaud Fontaine 2018-09-11 12:56:38 +02:00
parent 7e1e257e9d
commit 9637be6035

View File

@ -244,9 +244,11 @@ public final class Persistent {
Common.beginTransaction(isRegistering);
user_puk_length = (short)0;
/* Ensures any previously defined PUK code is blocked at factory reset */
byte[] emptyPin = new byte[0];
byte[] emptyPin = new byte[1];
while(user_puk.getTriesRemaining() > 0) {
user_puk.check(emptyPin, (short)0, (byte)0);
if(user_puk.check(emptyPin, (short)0, (byte)emptyPin.length)) {
ISOException.throwIt((short)0x9999);
}
}
Common.commitTransaction(isRegistering);