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