2009/5/27 Joao Pedro <[email protected]>: > Hello Sylvain, > >>> >>> private void ComputeCrypt(APDU apdu, byte[] apduBuffer) { >>> byte[] buffer = apduBuffer; >>> +#ifdef WITH_EXT_APDU >>> short dataOffset = apdu.getOffsetCdata(); >>> -#ifdef WITH_EXT_APDU >>> short LC = apdu.getIncomingLength(); >>> short bytesLeft = apdu.setIncomingAndReceive(); >> >> this is INVALID. according SUN specification, getIncomingLength >> & getOffsetCdata can be used only AFTER a call to setIncomingAndReceive. >> > > Ouch, my bad. I've just re-read the JC API and, indeed, the JVM should throw > an APDUException.ILLEGAL_USE exception - the weird part is that I've been > using the Muscle applet with the extended APDU patch for a couple of months > now, with absolutely no issues. I use it to login on OS X, sign emails, use > ssh, etc., on a daily basis... > > Nevertheless, I've attached a small patch that should fix this. I've > re-compiled the applet with and without extended APDU support and used > pkcs11-tool from the OpenSC project to test both versions. According to my > tests both versions are working OK (see debug.ext_apdu.txt and debug.txt).
Patch applied in revision 287. Thanks Joao -- Dr. Ludovic Rousseau _______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
