Code with Finding: |
class SecureMessagingWrapper {
/**
* Wraps the apdu buffer <code>capdu</code> of a command apdu.
* As a side effect, this method increments the internal send
* sequence counter maintained by this wrapper.
*
* @param capdu buffer containing the command apdu.
*
* @return length of the command apdu after wrapping.
*/
public byte[] wrap(byte[] capdu) {
try {
byte[] wrappedApdu = wrapCommandAPDU(capdu, capdu.length);
// System.arraycopy(wrappedApdu, 0, capdu, 0, wrappedApdu.length);
return wrappedApdu;
} catch (GeneralSecurityException gse) {
gse.printStackTrace();
throw new IllegalStateException(gse.toString());
} catch (IOException ioe) {
ioe.printStackTrace();
throw new IllegalStateException(ioe.toString());
}
}
}
|