slightly nicer error reporting for security token cla chaining

This commit is contained in:
Vincent Breitmoser
2017-10-06 19:06:43 +02:00
parent 618c3a506c
commit 2debc23ce0

View File

@@ -796,10 +796,10 @@ public class SecurityTokenHelper {
int cla = apdu.getCLA() + (last ? 0 : MASK_CLA_CHAINING);
lastResponse = mTransport.transceive(new CommandAPDU(cla, apdu.getINS(), apdu.getP1(),
apdu.getP2(), Arrays.copyOfRange(data, offset, offset + curLen), ne));
apdu.getP2(), data, offset, curLen, ne));
if (!last && lastResponse.getSW() != APDU_SW_SUCCESS) {
throw new UsbTransportException("Failed to chain apdu");
throw new UsbTransportException("Failed to chain apdu (last SW: " + lastResponse.getSW() + ")");
}
offset += curLen;