Handle SELECT
verification properly
This commit is contained in:
parent
5b86053977
commit
6febd85ddc
1 changed files with 5 additions and 10 deletions
|
@ -53,15 +53,6 @@ public class MyApplet extends Applet {
|
||||||
register();
|
register();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean select() {
|
|
||||||
if (pin.getTriesRemaining() == 0) {
|
|
||||||
ISOException.throwIt(SW_VERIFICATION_FAILED);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return super.select();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deselect() {
|
public void deselect() {
|
||||||
super.deselect();
|
super.deselect();
|
||||||
pin.reset();
|
pin.reset();
|
||||||
|
@ -78,7 +69,11 @@ public class MyApplet extends Applet {
|
||||||
byte[] buffer = apdu.getBuffer();
|
byte[] buffer = apdu.getBuffer();
|
||||||
|
|
||||||
if (selectingApplet()) {
|
if (selectingApplet()) {
|
||||||
|
if (pin.getTriesRemaining() == 0) {
|
||||||
|
ISOException.throwIt(SW_VERIFICATION_FAILED);
|
||||||
|
} else {
|
||||||
ISOException.throwIt(ISO7816.SW_NO_ERROR);
|
ISOException.throwIt(ISO7816.SW_NO_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (buffer[ISO7816.OFFSET_CLA] != (byte)0x80) {
|
if (buffer[ISO7816.OFFSET_CLA] != (byte)0x80) {
|
||||||
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
|
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
|
||||||
|
|
Loading…
Reference in a new issue