[Pcsclite-cvs-commit] r287 - /trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu May 28 07:42:42 UTC 2009


Author: rousseau
Date: Thu May 28 07:42:42 2009
New Revision: 287

URL: http://svn.debian.org/wsvn/muscleplugins/?sc=1&rev=287
Log:
fix extended APDU problem
http://archives.neohapsis.com/archives/dev/muscle/2009-q2/0096.html

Thanks to Joao Pedro for the patch

Modified:
    trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src

Modified: trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src
URL: http://svn.debian.org/wsvn/muscleplugins/trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src?rev=287&op=diff
==============================================================================
--- trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src (original)
+++ trunk/MCardApplet/src/com/musclecard/CardEdge/CardEdge.src Thu May 28 07:42:42 2009
@@ -910,11 +910,12 @@
     private void ComputeCrypt(APDU apdu, byte[] apduBuffer) {
 	/* Buffer pointer */
 	byte[] buffer = apduBuffer;
+	
+#ifdef WITH_EXT_APDU	
+	short bytesLeft = apdu.setIncomingAndReceive(); 
+	short LC = apdu.getIncomingLength();
 	short dataOffset = apdu.getOffsetCdata();
-#ifdef WITH_EXT_APDU	
-	short LC = apdu.getIncomingLength();
-	short bytesLeft = apdu.setIncomingAndReceive(); 
-
+	
 	if((short) (LC + dataOffset) > EXT_APDU_BUFFER_SIZE)
 		ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
 	
@@ -927,6 +928,8 @@
 #else
 	short bytesLeft = Util.makeShort((byte) 0x00,
 			    buffer[ISO7816.OFFSET_LC]);
+	short dataOffset = ISO7816.OFFSET_CDATA;
+
 	if (bytesLeft != apdu.setIncomingAndReceive())
 	    ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
 #endif	




More information about the Pcsclite-cvs-commit mailing list