[Pcsclite-cvs-commit] r2248 - trunk/PCSC/src

Ludovic Rousseau rousseau at alioth.debian.org
Thu Nov 30 21:53:18 CET 2006


Author: rousseau
Date: 2006-11-30 21:53:18 +0100 (Thu, 30 Nov 2006)
New Revision: 2248

Modified:
   trunk/PCSC/src/winscard_svc.c
Log:
ContextThread(): check that the client protocol version is not newer
than the protocol version of the server or returns SCARD_E_NO_SERVICE
otherwise.


Modified: trunk/PCSC/src/winscard_svc.c
===================================================================
--- trunk/PCSC/src/winscard_svc.c	2006-11-30 20:48:08 UTC (rev 2247)
+++ trunk/PCSC/src/winscard_svc.c	2006-11-30 20:53:18 UTC (rev 2248)
@@ -179,10 +179,25 @@
 						"Client is protocol version %d:%d",
 						veStr->major, veStr->minor);
 
+					veStr->rv = SCARD_S_SUCCESS;
+
+					/* client is newer than server */
+					if ((veStr->major > PROTOCOL_VERSION_MAJOR)
+						|| (veStr->major == PROTOCOL_VERSION_MAJOR
+							&& veStr->minor > PROTOCOL_VERSION_MINOR))
+					{
+						Log3(PCSC_LOG_CRITICAL,
+							"Client protocol is too new %d:%d",
+							veStr->major, veStr->minor);
+						Log3(PCSC_LOG_CRITICAL,
+							"Server protocol is %d:%d",
+							PROTOCOL_VERSION_MAJOR, PROTOCOL_VERSION_MINOR);
+						veStr->rv = SCARD_E_NO_SERVICE;
+					}
+
 					/* set the server protocol version */
 					veStr->major = PROTOCOL_VERSION_MAJOR;
 					veStr->minor = PROTOCOL_VERSION_MINOR;
-					veStr->rv = SCARD_S_SUCCESS;
 
 					/* send back the response */
 					rv = SHMMessageSend(&msgStruct, sizeof(msgStruct),




More information about the Pcsclite-cvs-commit mailing list