79562185

Date: 2025-04-08 13:36:20
Score: 0.5
Natty:
Report link

Found my mistake. setIncomingAndReceive() returns the size of the transferred array (10 bytes in my case), i.e. instead of if ( ( numBytes != PayloadSize ) || (byteRead != 1) ) there should be if ( ( numBytes != PayloadSize ) || (byteRead != PayloadSize) ). And in addition, I also specified the offset inside the buffer incorrectly (should be Util.arrayCopy(buf, ISO7816.OFFSET_CDATA, data, (short) 0, PayloadSize)).

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Single line (0.5):
Posted by: Alan Kazbekov