From 55d2b7cddc2280a1327802b548be425baa3f2d6a Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Tue, 11 Jul 2017 16:57:35 +0200 Subject: [PATCH] Fix AES ENC/DEC commands --- src/fr/anssi/smartpgp/SmartPGPApplet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fr/anssi/smartpgp/SmartPGPApplet.java b/src/fr/anssi/smartpgp/SmartPGPApplet.java index cea59da..b65afac 100644 --- a/src/fr/anssi/smartpgp/SmartPGPApplet.java +++ b/src/fr/anssi/smartpgp/SmartPGPApplet.java @@ -1166,7 +1166,7 @@ public final class SmartPGPApplet extends Applet { assertUserMode82(); - if(lc <= 0) { + if(lc <= 1) { ISOException.throwIt(ISO7816.SW_WRONG_LENGTH); return 0; } @@ -1227,7 +1227,7 @@ public final class SmartPGPApplet extends Applet { Util.arrayFillNonAtomic(transients.buffer, (short)(lc + 1), res, (byte)0); - return res; + return (short)(res + 1); } ISOException.throwIt(ISO7816.SW_WRONG_P1P2);