[Pcsclite-git-commit] [CCID] 01/01: Patch for Cherry KC 1000 SC

Ludovic Rousseau rousseau at moszumanska.debian.org
Mon Jan 4 19:41:33 UTC 2016


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

rousseau pushed a commit to branch master
in repository CCID.

commit 0b0b6e00f6e3e50ec3d015b60c6551ec27fb9ada
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Mon Jan 4 20:36:30 2016 +0100

    Patch for Cherry KC 1000 SC
    
    The Cherry KC 1000 SC is (by default) a "Short APDU level exchange" CCID
    reader. But firmware 1.00 is bogus.
    With a T=1 card and case 2 APDU (data from card to host) the maximum
    size returned by the reader is 128 byes. The reader is then using
    chaining as with extended APDU.
    
    In order to limit the impacts on the driver I just change the dwFeatures
    to declare the reader as a "Short and Extended APDU level exchange" CCID
    reader to use the chaining even for short APDU.
    
    Thanks to ZF Friedrichshafen AG for the patch.
---
 src/ccid.c | 14 ++++++++++++++
 src/ccid.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/src/ccid.c b/src/ccid.c
index f48a5fb..cd0e072 100644
--- a/src/ccid.c
+++ b/src/ccid.c
@@ -494,6 +494,20 @@ int ccid_open_hack_post(unsigned int reader_index)
 			}
 			break;
 #endif
+		case CHERRY_KC1000SC:
+			if ((0x0100 == ccid_descriptor->IFD_bcdDevice)
+				&& (ccid_descriptor->dwFeatures & CCID_CLASS_EXCHANGE_MASK) == CCID_CLASS_SHORT_APDU)
+			{
+				/* firmware 1.00 is bogus
+				 * With a T=1 card and case 2 APDU (data from card to
+				 * host) the maximum size returned by the reader is 128
+				 * byes. The reader is then using chaining as with
+				 * extended APDU.
+				 */
+				ccid_descriptor->dwFeatures &= ~CCID_CLASS_EXCHANGE_MASK;
+				ccid_descriptor->dwFeatures |= CCID_CLASS_EXTENDED_APDU;
+			}
+			break;
 	}
 
 	/* Gemalto readers may report additional information */
diff --git a/src/ccid.h b/src/ccid.h
index 0ce2e9e..b9d2c6a 100644
--- a/src/ccid.h
+++ b/src/ccid.h
@@ -208,6 +208,7 @@ typedef struct
 #define FUJITSUSMARTKEYB 0x0BF81017
 #define FEITIANR502DUAL 0x096E060D
 #define MICROCHIP_SEC1100 0x04241104
+#define CHERRY_KC1000SC 0x046A00A1
 
 #define VENDOR_GEMALTO 0x08E6
 #define GET_VENDOR(readerID) ((readerID >> 16) & 0xFFFF)

-- 
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