diff --git a/src/main/java/im/status/keycard/KeycardApplet.java b/src/main/java/im/status/keycard/KeycardApplet.java index 23c78cf..8239995 100644 --- a/src/main/java/im/status/keycard/KeycardApplet.java +++ b/src/main/java/im/status/keycard/KeycardApplet.java @@ -468,6 +468,7 @@ public class KeycardApplet extends Applet { if (Util.makeShort(apduBuffer[ISO7816.OFFSET_CDATA], apduBuffer[(short)(ISO7816.OFFSET_CDATA + 1)]) != (short)(dataLen - 2)) { offset = ISO7816.OFFSET_P2; apduBuffer[ISO7816.OFFSET_P2] = 0; + dataLen += 2; } else { offset = ISO7816.OFFSET_CDATA; }