openct ccid driver not working for spr 532

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

openct ccid driver not working for spr 532

Simon Eisenmann
Hello,

today i noticed that openct now supports ccid readers. I tested with my
spr 532 reader which works just fine with pcsc-lite. Though if i
initialize openct i get the following error:

-- snip --
Sep 19 14:39:55 redemption ifdhandler[14074]: /proc/bus/usb/003/006:
initialization failed (driver ccid)
Sep 19 14:39:55 redemption ifdhandler[14074]: unable to open reader
ccid@/proc/bus/usb/003/006
-- snap --

When trying to spawn the ifdhandler manually:

-- snip --
[root@redemption opensc]# ifdhandler -F -H -d -d -d -d -d
ccid /proc/bus/usb/003/006
Debug: ifd_open: trying to open ccid@/proc/bus/usb/003/006
Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0100 ind=x0000
len=18
Debug: ifd_usb_control: recv  12 01 10 01 00 00 00 10 e6 04 03 e0 15 04
01 02 05 01
Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0201 ind=x0000
len=8
Debug: ifd_usb_control: recv  09 02 5d 00 01 01 03 80
Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0201 ind=x0000
len=93
Debug: ifd_usb_control: recv  09 02 5d 00 01 01 03 80 32 09 04 00 00 03
ff 01 01 04 36 21 00 01 00 01 03 00 00 00 a0 0f 00 00 e0 2e 00 00 00 80
25 00 00 00 c2 01 00 00 fc 00 00 00 00 00 00 00 00 00 00 00 ba 00 01 00
07 01 00 00 ff ff 00 00 03 01 07 05 01 02 40 00 00 07 05 82 02 40 00 00
07 05 83 03 10 00 10
Debug: skipped 1 class/vendor specific interface descriptors
Debug: usb_set_params: called. config x01 ifc x00 eps x20c88/x8f97370
Error: /proc/bus/usb/003/006: initialization failed (driver ccid)
Error: unable to open reader ccid@/proc/bus/usb/003/006
-- snap --

lsusb output:
-- snip --
Bus 003 Device 006: ID 04e6:e003 SCM Microsystems, Inc. SPR532 PinPad
SmartCard Reader
-- snap --

I am using fedora core 4 with the openct 0.6.5 (rpm install) and fedora
core 4 with openct 0.6.6 (self compiled). Both results in the same
error.

Anyone got an idea? I would like to use openct for usb tokens and
readers in the future, and get rid of pcscd.

Thanks,
Simon


--
Simon Eisenmann

[ mailto:[hidden email] ]

[ struktur AG | Friedrichstr. 14 | 70174 Stuttgart ]
[ T. +49.711.896656.68 | F.+49.711.89665610 ]
[ http://www.struktur.de | mailto:[hidden email] ]

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Chaskiel Grundman-3
--On Monday, September 19, 2005 14:48:25 +0200 Simon Eisenmann
<[hidden email]> wrote:

> today i noticed that openct now supports ccid readers. I tested with my
> spr 532 reader which works just fine with pcsc-lite. Though if i
> initialize openct i get the following error:

I can't tell what's going on here. The ccid driver's open() reports errors
with ct_error() if it is going to fail, and I don't see those messages.

According to
<http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/readers/SPR532.txt?op=file&rev=0&sc=0>it
appears that at least some SPR 532's do not report the correct interface
class. If your device is similar, then that would explain why the openct
ccid driver is rejecting the device.

Could you send me "lsusb -v -d 04e6:e003" output so I can check this? (I
could probably decode the descriptor in the debug output, but I don't feel
like doing that much work) I can probably work around this by having a
whitelist of devices whose classes are known to be incorrect.

For this device to work, I'll also have to figure out a solution to the
dwMaxCCIDMessageLength < 271 problem, since the descriptor dump on the
pcsc-lite site indicates that the SPR 532's max message length is 263.

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

attachment0 (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Chaskiel Grundman-3
--On Monday, September 19, 2005 14:19:07 -0400 Chaskiel M Grundman
<[hidden email]> wrote:

> For this device to work, I'll also have to figure out a solution to the
> dwMaxCCIDMessageLength < 271 problem, since the descriptor dump on the
> pcsc-lite site indicates that the SPR 532's max message length is 263.

It appears that I submitted a patch for this in January, and it's in the
tree.
I guess that's what I get for using old cvs sandboxes as reference
material...


_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

attachment0 (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Simon Eisenmann
In reply to this post by Chaskiel Grundman-3


On Mon, 2005-09-19 at 14:19 -0400, Chaskiel M Grundman wrote:

> According to
> <http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/readers/SPR532.txt?op=file&rev=0&sc=0>it
> appears that at least some SPR 532's do not report the correct interface
> class. If your device is similar, then that would explain why the openct
> ccid driver is rejecting the device.
>
> Could you send me "lsusb -v -d 04e6:e003" output so I can check this? (I
> could probably decode the descriptor in the debug output, but I don't feel
> like doing that much work) I can probably work around this by having a
> whitelist of devices whose classes are known to be incorrect.

Here are the lsubs details of my device:

[root@redemption ~]# lsusb -v -d 0x04e6:0xe003

Bus 003 Device 002: ID 04e6:e003 SCM Microsystems, Inc. SPR532 PinPad
SmartCard Reader
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        16
  idVendor           0x04e6 SCM Microsystems, Inc.
  idProduct          0xe003 SPR532 PinPad SmartCard Reader
  bcdDevice            4.15
  iManufacturer           1 SCM Microsystems Inc.
  iProduct                2 SPRx32 USB Smart Card Reader
  iSerial                 5 60102436
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           93
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 CCID Class
    bmAttributes         0x80
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1
      bInterfaceProtocol      1
      iInterface              4 CCID Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval              16



Best regards,
Simon


--

Simon Eisenmann

[ mailto:[hidden email] ]

[ struktur AG | Friedrichstr. 14 | 70174 Stuttgart ]
[ T. +49.711.896656.68 | F.+49.711.89665610 ]
[ http://www.struktur.de | mailto:[hidden email] ]

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Chaskiel Grundman-3
The attached patch (against the openct trunk) alters the ccid driver to
accept the "proprietary" interface class id and class descriptors tagged as
proprietary for the following devices (list derived from
<http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/readers>)

{ 0x04e6, 0xe003 }, /* SCM SPR 532 */
{ 0x046a, 0x003e }, /* Cherry SmartTerminal ST-2XXX */
{ 0x413c, 0x2100 }, /* Dell USB Smartcard Keyboard */
{ 0x04e6, 0x5120 }, /* SCM SCR331-DI (NTT) */
{ 0x04e6, 0x5111 }, /* SCM SCR331-DI */
{ 0x08e6, 0x1359 }, /* Verisign secure storage token */
{ 0x08e6, 0xACE0 }, /* Verisign secure  token */


Other changes included in the patch are
- remove the need for struct usb_ccid_descriptor to be packed
- check the slot/sequence of a ccid bulk-in message before the error code.
(this is not sufficient to support multi-slot readers correctly, but it's a
step in the right direction)

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel

ccid-proprietary-device.diff (7K) Download Attachment
attachment1 (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Andreas Jellinghaus-2
thanks, commited to trunk.

shall we start another openct release cycle, or wait another
week for more changes to be submitted?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: openct ccid driver not working for spr 532

Simon Eisenmann
In reply to this post by Chaskiel Grundman-3
Works like a charm with the openct trunk now! Thanks for the patch.

Cheers,
Simon

On Tue, 2005-09-20 at 15:54 -0400, Chaskiel M Grundman wrote:

> The attached patch (against the openct trunk) alters the ccid driver to
> accept the "proprietary" interface class id and class descriptors tagged as
> proprietary for the following devices (list derived from
> <http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/readers>)
>
> { 0x04e6, 0xe003 }, /* SCM SPR 532 */
> { 0x046a, 0x003e }, /* Cherry SmartTerminal ST-2XXX */
> { 0x413c, 0x2100 }, /* Dell USB Smartcard Keyboard */
> { 0x04e6, 0x5120 }, /* SCM SCR331-DI (NTT) */
> { 0x04e6, 0x5111 }, /* SCM SCR331-DI */
> { 0x08e6, 0x1359 }, /* Verisign secure storage token */
> { 0x08e6, 0xACE0 }, /* Verisign secure  token */
>
>
> Other changes included in the patch are
> - remove the need for struct usb_ccid_descriptor to be packed
> - check the slot/sequence of a ccid bulk-in message before the error code.
> (this is not sufficient to support multi-slot readers correctly, but it's a
> step in the right direction)
--

Simon Eisenmann

[ mailto:[hidden email] ]

[ struktur AG | Friedrichstr. 14 | 70174 Stuttgart ]
[ T. +49.711.896656.68 | F.+49.711.89665610 ]
[ http://www.struktur.de | mailto:[hidden email] ]

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel