[Pcsclite-cvs-commit] r5563 - /trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Jan 28 20:12:49 UTC 2011


Author: rousseau
Date: Fri Jan 28 20:12:43 2011
New Revision: 5563

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5563
Log:
Correctly display the 2 last bytes (status word) instead of potentially
garbage in the received buffer.

Modified:
    trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c

Modified: trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c?rev=5563&op=diff
==============================================================================
--- trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c (original)
+++ trunk/Drivers/ccid/contrib/RSA_SecurID/RSA_SecurID_getpasswd.c Fri Jan 28 20:12:43 2011
@@ -101,7 +101,8 @@
 	PCSC_ERROR_EXIT(rv, "SCardTransmit")
 	if ((length != 2) || (bRecvBuffer[0] != 0x90) || (bRecvBuffer[1] != 0x00))
 	{
-		printf("cmd1 failed: %02X%02X\n", bRecvBuffer[0], bRecvBuffer[1]);
+		printf("cmd1 failed (%ld): %02X%02X\n", length, bRecvBuffer[length-2],
+			bRecvBuffer[length-1]);
 		goto end;
 	}
 
@@ -112,8 +113,8 @@
 	PCSC_ERROR_EXIT(rv, "SCardTransmit")
 	if ((length != 6) || (bRecvBuffer[4] != 0x90) || (bRecvBuffer[5] != 0x00))
 	{
-		printf("cmd2 failed (%ld) : %02X%02X\n", length, bRecvBuffer[4],
-			bRecvBuffer[5]);
+		printf("cmd2 failed (%ld) : %02X%02X\n", length, bRecvBuffer[length-2],
+			bRecvBuffer[length-1]);
 		goto end;
 	}
 
@@ -127,8 +128,8 @@
 	PCSC_ERROR_EXIT(rv, "SCardTransmit")
 	if ((length != 2) || (bRecvBuffer[0] != 0x90) || (bRecvBuffer[1] != 0x00))
 	{
-		printf("cmd3 failed (%ld) : %02X%02X\n", length, bRecvBuffer[0],
-			bRecvBuffer[1]);
+		printf("cmd3 failed (%ld): %02X%02X\n", length, bRecvBuffer[length-2],
+			bRecvBuffer[length-1]);
 		goto end;
 	}
 
@@ -139,8 +140,8 @@
 	PCSC_ERROR_EXIT(rv, "SCardTransmit")
 	if ((length != 7) || (bRecvBuffer[5] != 0x90) || (bRecvBuffer[6] != 0x00))
 	{
-		printf("cmd4 failed (%ld): %02X%02X\n", length, bRecvBuffer[5],
-			bRecvBuffer[6]);
+		printf("cmd4 failed (%ld): %02X%02X\n", length, bRecvBuffer[length-2],
+			bRecvBuffer[length-1]);
 		goto end;
 	}
 




More information about the Pcsclite-cvs-commit mailing list