[Pcsclite-git-commit] [CCID] 02/02: ccid_serial: reformat reader detection code

Ludovic Rousseau rousseau at moszumanska.debian.org
Wed May 17 11:34:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository CCID.

commit 647fe54d8b66cabcd8bc13b68ae46fbc4bd05be5
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Wed May 17 13:26:52 2017 +0200

    ccid_serial: reformat reader detection code
    
    The Microchip SEC 1210 does not support the command 0x02 (get firmware
    version):
    "03 06 6B 01 00 00 00 00 00 00 00 00 02 6D"
    returns
    frame: "83 00 00 00 00 00 00 41 00 00" - "Command not supported."
    
    The command 0x06 returns a result, even if I, and Fabio Araujo, don't
    know what this command does.
    "03 06 6B 01 00 00 00 00 00 00 00 00 06 69"
    we received
    frame: "83 01 00 00 00 00 00 01 00 00 22", "Everything OK."
---
 src/ccid_serial.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ccid_serial.c b/src/ccid_serial.c
index df92fed..eca543a 100644
--- a/src/ccid_serial.c
+++ b/src/ccid_serial.c
@@ -847,14 +847,14 @@ status_t OpenSerialByName(unsigned int reader_index, char *dev_name)
 	/* perform a command to be sure a Gemalto reader is connected
 	 * get the reader firmware */
 	{
-		unsigned char tx_buffer[] = { 0x02 };
+		unsigned char tx_buffer[1];
 		unsigned char rx_buffer[50];
 		unsigned int rx_length = sizeof(rx_buffer);
 
 		if (0 == strcasecmp(reader_name,"SEC1210"))
-		{
-			tx_buffer[0] = 0x06;
-		}
+			tx_buffer[0] = 0x06; // unknown but supported command
+		else
+			tx_buffer[0] = 0x02; // get reader firmware
 
 		/* 2 seconds timeout to not wait too long if no reader is connected */
 		if (IFD_SUCCESS != CmdEscape(reader_index, tx_buffer, sizeof(tx_buffer),

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/CCID.git



More information about the Pcsclite-cvs-commit mailing list