Fix ACTIVATE FILE when APDU is received over a logical channel.

This commit is contained in:
Stelian Pop 2021-04-14 18:05:34 +02:00 committed by Arnaud Fontaine
parent 6952d4e03d
commit bdfe17606f
2 changed files with 2 additions and 1 deletions

View File

@ -112,6 +112,7 @@ public final class Constants {
protected static final byte CRT_TAG_DECRYPTION_KEY = (byte)0xb8; protected static final byte CRT_TAG_DECRYPTION_KEY = (byte)0xb8;
protected static final byte CLA_MASK_CHAINING = (byte)0x10; protected static final byte CLA_MASK_CHAINING = (byte)0x10;
protected static final byte CLA_MASK_CHANNEL = (byte)0xFC;
protected static final byte INS_SELECT_DATA = (byte)0xA5; protected static final byte INS_SELECT_DATA = (byte)0xA5;

View File

@ -1460,7 +1460,7 @@ public final class SmartPGPApplet extends Applet {
} }
if(data.isTerminated) { if(data.isTerminated) {
if(apdubuf[ISO7816.OFFSET_CLA] != 0) { if((apdubuf[ISO7816.OFFSET_CLA] & Constants.CLA_MASK_CHANNEL) != 0) {
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED); ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
return; return;
} }