[Pcsclite-cvs-commit] r6328 - /trunk/Drivers/ccid/src/openct/proto-t1.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Jun 6 12:37:13 UTC 2012


Author: rousseau
Date: Wed Jun  6 12:37:12 2012
New Revision: 6328

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6328
Log:
t1_transceive(): avoids a infinite retry loop                                   

Move the check for ISO 7816-3 Rule 7.4.2 (2 retried before resynch)
before the check for ISO 7816-3 Rule 7.2 (retransmission of R-block)

Thanks to Martin Vogt for the bug report and patch
http://archives.neohapsis.com/archives/dev/muscle/2012-q2/0077.html

Modified:
    trunk/Drivers/ccid/src/openct/proto-t1.c

Modified: trunk/Drivers/ccid/src/openct/proto-t1.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/openct/proto-t1.c?rev=6328&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/openct/proto-t1.c (original)
+++ trunk/Drivers/ccid/src/openct/proto-t1.c Wed Jun  6 12:37:12 2012
@@ -291,6 +291,10 @@
 				DEBUG_COMM4("received: %d, expected: %d, more: %d",
 					t1_seq(pcb), t1->ns, t1->more);
 
+				/* ISO 7816-3 Rule 7.4.2 */
+				if (retries == 0)
+					goto resync;
+
 				/* ISO 7816-3 Rule 7.2 */
 				if (T1_R_BLOCK == t1_block_type(t1->previous_block[PCB]))
 				{
@@ -300,9 +304,6 @@
 				}
 
 				DEBUG_COMM("R-Block required");
-				/* ISO 7816-3 Rule 7.4.2 */
-				if (retries == 0)
-					goto resync;
 				slen = t1_build(t1, sdata,
 						dad, T1_R_BLOCK | T1_OTHER_ERROR,
 						NULL, NULL);




More information about the Pcsclite-cvs-commit mailing list