[PATCH] Support Cherry SmartTerminal ST-2000

Matthias-Christian Ott ott at mirix.org
Fri Oct 7 22:58:35 CEST 2011


---
 scd/ccid-driver.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 8c362d7..b0c403b 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1135,17 +1135,20 @@ scan_or_find_usb_device (int scan_mode,
           for (set_no=0; set_no < interface->num_altsetting; set_no++)
             {
               ifcdesc = (interface->altsetting + set_no);
-              /* The second condition is for older SCM SPR 532 who did
-                 not know about the assigned CCID class.  Instead of
-                 trying to interpret the strings we simply check the
-                 product ID. */
+              /* The second condition is for older SCM SPR 532 and Cherry
+                 SmartTerminal ST-2000 who did not know about the assigned
+                 CCID class.  Instead of trying to interpret the strings
+                 we simply check the product ID. */
               if (ifcdesc && ifcdesc->extra
                   && ((ifcdesc->bInterfaceClass == 11
                        && ifcdesc->bInterfaceSubClass == 0
                        && ifcdesc->bInterfaceProtocol == 0)
                       || (ifcdesc->bInterfaceClass == 255
                           && dev->descriptor.idVendor == VENDOR_SCM
-                          && dev->descriptor.idProduct == 0xe003)))
+                          && dev->descriptor.idProduct == 0xe003)
+                      || (ifcdesc->bInterfaceClass == 255
+                          && dev->descriptor.idVendor == VENDOR_CHERRY
+                          && dev->descriptor.idProduct == 0x003e)))
                 {
                   idev = usb_open (dev);
                   if (!idev)
@@ -3080,7 +3083,8 @@ ccid_transceive_secure (ccid_driver_t handle,
          Lc byte to the APDU.  It seems that it will be replaced with
          the actual length instead of being appended before the APDU
          is send to the card. */
-      cherry_mode = 1;
+      if (handle->id_product != 0x003e)
+        cherry_mode = 1;
       break;
     default:
      return CCID_DRIVER_ERR_NOT_SUPPORTED;
-- 
1.7.6.3




More information about the Gnupg-devel mailing list