ash2005 / jcardsim

Automatically exported from code.google.com/p/jcardsim
0 stars 1 forks source link

short javacard.framework.APDU.setIncomingAndReceive() returns negative values if more than 128 Bytes are received. #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The method 
short javacard.framework.APDU.setIncomingAndReceive() 
returns negative values if more than 128 Bytes are received.
Seems like a problem with casting a byte to a short variable.

As a workaround I use a method like this:
    private short apduSetIncomingAndReceive(APDU apdu){
        short len = apdu.setIncomingAndReceive();
        if (len < 0){
            len = (short) (len & 0xff);
        }
        return len;
    }

Original issue reported on code.google.com by petermah...@gmail.com on 2 Oct 2013 at 5:30

GoogleCodeExporter commented 9 years ago
We moved to GitHub, in this connection we are closing issue tracker here. Your 
issue available here now - https://github.com/licel/jcardsim/issues/24. Become 
a watcher and you will be able to receive all updates on the project. To check 
progress on your issue click the link above.

Original comment by jcard...@licel.ru on 25 Oct 2013 at 2:10