diff --git a/src/main/java/com/ledger/u2f/U2FApplet.java b/src/main/java/com/ledger/u2f/U2FApplet.java index cadc93c..f23e212 100644 --- a/src/main/java/com/ledger/u2f/U2FApplet.java +++ b/src/main/java/com/ledger/u2f/U2FApplet.java @@ -339,6 +339,14 @@ private void handleGetData(APDU apdu) throws ISOException { } short requestedSize = apdu.setOutgoing(); short outOffset = (short)0; + + if (requestedSize == 0) { + requestedSize = (short)buffer.length; + if (requestedSize > 0xFF) { + requestedSize = 256; + } + } + if (scratch[SCRATCH_TRANSPORT_STATE] == TRANSPORT_NOT_EXTENDED) { short dataSize = Util.getShort(scratch, SCRATCH_NONCERT_LENGTH); short blockSize = ((short)(dataSize - currentOffset) > requestedSize ? requestedSize : (short)(dataSize - currentOffset));