Fix AES ENC/DEC commands

This commit is contained in:
Arnaud Fontaine 2017-07-11 16:57:35 +02:00
parent 60b6b09192
commit 55d2b7cddc

View File

@ -1166,7 +1166,7 @@ public final class SmartPGPApplet extends Applet {
assertUserMode82(); assertUserMode82();
if(lc <= 0) { if(lc <= 1) {
ISOException.throwIt(ISO7816.SW_WRONG_LENGTH); ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
return 0; return 0;
} }
@ -1227,7 +1227,7 @@ public final class SmartPGPApplet extends Applet {
Util.arrayFillNonAtomic(transients.buffer, (short)(lc + 1), res, (byte)0); Util.arrayFillNonAtomic(transients.buffer, (short)(lc + 1), res, (byte)0);
return res; return (short)(res + 1);
} }
ISOException.throwIt(ISO7816.SW_WRONG_P1P2); ISOException.throwIt(ISO7816.SW_WRONG_P1P2);