Blame SOURCES/ccid-1.4.36-etoken.patch

4117d2
From b48e1e697010431b7f03d4ecfe917ceee95e2c64 Mon Sep 17 00:00:00 2001
4117d2
From: Ludovic Rousseau <ludovic.rousseau@free.fr>
4117d2
Date: Tue, 7 Sep 2021 14:06:46 +0200
4117d2
Subject: [PATCH] Fix SafeNet eToken 5110 SC issue
4117d2
4117d2
Some SafeNet eToken 5100 (but not all) have issues when IFSD is negotiated.
4117d2
For some APDU the communication stops and the token returns 0 bytes.
4117d2
4117d2
It is the case with the SafeNet eToken 5110 SC with
4117d2
ATR: 3B D5 18 00 81 31 3A 7D 80 73 C8 21 10 30
4117d2
and PC/SC name "SafeNet eToken 5100 [eToken 5110 SC]"
4117d2
4117d2
Another SafeNet eToken 5100 with
4117d2
ATR: 3B D5 18 00 81 31 FE 7D 80 73 C8 21 10 F4
4117d2
and PC/SC name "SafeNet eToken 5100 [Main Interface]"
4117d2
does NOT have problems with the the IFSD negotiation.
4117d2
4117d2
4117d2
This fixes Debian bug #993647
4117d2
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993647
4117d2
---
4117d2
 src/ccid.c | 7 +++++++
4117d2
 src/ccid.h | 1 +
4117d2
 2 files changed, 8 insertions(+)
4117d2
4117d2
diff --git a/src/ccid.c b/src/ccid.c
4117d2
index efef240..0d7ba54 100644
4117d2
--- a/src/ccid.c
4117d2
+++ b/src/ccid.c
4117d2
@@ -576,6 +576,13 @@ int ccid_open_hack_post(unsigned int reader_index)
4117d2
 			 * have one */
4117d2
 			ccid_descriptor->bPINSupport = 0;
4117d2
 			break;
4117d2
+
4117d2
+		case SAFENET_ETOKEN_5100:
4117d2
+			/* the old SafeNet eToken 5110 SC (firmware 0.12) does not
4117d2
+			 * like IFSD negotiation. So disable it. */
4117d2
+			if (0x0012 == ccid_descriptor->IFD_bcdDevice)
4117d2
+				ccid_descriptor->dwFeatures |= CCID_CLASS_AUTO_IFSD;
4117d2
+			break;
4117d2
 	}
4117d2
 
4117d2
 	/* Gemalto readers may report additional information */
4117d2
diff --git a/src/ccid.h b/src/ccid.h
4117d2
index b28f0c1..00ce07a 100644
4117d2
--- a/src/ccid.h
4117d2
+++ b/src/ccid.h
4117d2
@@ -239,6 +239,7 @@ typedef struct
4117d2
 #define IDENTIV_uTrust3701F		0x04E65791
4117d2
 #define IDENTIV_uTrust4701F		0x04E65724
4117d2
 #define BIT4ID_MINILECTOR		0x25DD3111
4117d2
+#define SAFENET_ETOKEN_5100		0x05290620
4117d2
 
4117d2
 #define VENDOR_GEMALTO 0x08E6
4117d2
 #define GET_VENDOR(readerID) ((readerID >> 16) & 0xFFFF)
4117d2
-- 
4117d2
GitLab
4117d2
4117d2
From 26ad96076523472e9d0d383d014e7b1ad241fd5b Mon Sep 17 00:00:00 2001
4117d2
From: Ludovic Rousseau <ludovic.rousseau@free.fr>
4117d2
Date: Wed, 8 Sep 2021 11:28:48 +0200
4117d2
Subject: [PATCH] Fix SafeNet eToken 5110 SC issue (firmware 0.13)
4117d2
4117d2
The SafeNet eToken 5110 SC with firmware 0.13 has the same problem as
4117d2
the token with firmware 0.12.
4117d2
We use the same oslution to fix the problem.
4117d2
4117d2
Thanks again to Vladimir K for the bug report.
4117d2
---
4117d2
 src/ccid.c | 7 ++++---
4117d2
 1 file changed, 4 insertions(+), 3 deletions(-)
4117d2
4117d2
diff --git a/src/ccid.c b/src/ccid.c
4117d2
index 0d7ba54..21a2fe8 100644
4117d2
--- a/src/ccid.c
4117d2
+++ b/src/ccid.c
4117d2
@@ -578,9 +578,10 @@ int ccid_open_hack_post(unsigned int reader_index)
4117d2
 			break;
4117d2
 
4117d2
 		case SAFENET_ETOKEN_5100:
4117d2
-			/* the old SafeNet eToken 5110 SC (firmware 0.12) does not
4117d2
-			 * like IFSD negotiation. So disable it. */
4117d2
-			if (0x0012 == ccid_descriptor->IFD_bcdDevice)
4117d2
+			/* the old SafeNet eToken 5110 SC (firmware 0.12 & 0.13)
4117d2
+			 * does not like IFSD negotiation. So disable it. */
4117d2
+			if ((0x0012 == ccid_descriptor->IFD_bcdDevice)
4117d2
+				|| (0x0013 == ccid_descriptor->IFD_bcdDevice))
4117d2
 				ccid_descriptor->dwFeatures |= CCID_CLASS_AUTO_IFSD;
4117d2
 			break;
4117d2
 	}
4117d2
-- 
4117d2
GitLab
4117d2
4117d2