[Pcsclite-cvs-commit] r4862 - /trunk/PCSC/src/winscard.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Thu Apr 8 15:09:12 UTC 2010


Author: rousseau
Date: Thu Apr  8 15:09:07 2010
New Revision: 4862

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=4862
Log:
SCardDisconnect(): Set the card event state to SCARD_RESET _before_ doing
the reset.

This will avoid an SCardTransmit from another application between the
card reset and the card event state change. In the problematic case the
SCardTransmit was sending an APDU in T=1 to a reseted card but not yet
configured (IFDHSetProtocolParameters was not yet called) and still in
T=0 (default)

Modified:
    trunk/PCSC/src/winscard.c

Modified: trunk/PCSC/src/winscard.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/winscard.c?rev=4862&op=diff
==============================================================================
--- trunk/PCSC/src/winscard.c (original)
+++ trunk/PCSC/src/winscard.c Thu Apr  8 15:09:07 2010
@@ -887,6 +887,11 @@
 		dwDisposition == SCARD_UNPOWER_CARD)
 	{
 		/*
+		 * Notify the card has been reset
+		 */
+		(void)RFSetReaderEventState(rContext, SCARD_RESET);
+
+		/*
 		 * Currently pcsc-lite keeps the card powered constantly
 		 */
 		dwAtrLen = rContext->readerState->cardAtrLength;
@@ -907,11 +912,6 @@
 
 		/* the protocol is unset after a power on */
 		rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
-
-		/*
-		 * Notify the card has been reset
-		 */
-		(void)RFSetReaderEventState(rContext, SCARD_RESET);
 
 		/*
 		 * Set up the status bit masks on dwStatus




More information about the Pcsclite-cvs-commit mailing list