Solaris 11 and pcsc-lite

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

Solaris 11 and pcsc-lite

William To
Hi All, 

I know this may not be the best place to ask, but I am really exhausted from trying to find information from Google and Oracle about their pcsc-lite on Solaris 11.

What I have now is a Solaris 11 box with a PC/SC reader (SCM SCR-331 DI) attached to the USB port. My intention is to access a smart card using PC/SC using the locally attached reader on the USB port. 

I have downloaded the Solaris PCSC_lite_1.3 and CCID_IFD_1.3.10 and set up according to Oracle's instructions (installing the packages etc.) After installing the packages I expected the rdrlist in the pcsctools directory would list out the locally installed reader, but what I got is "SCardEstablishContext error: Service not available." error message. I checked out the documentation and it means "the pcscd service is not started". I used "ps -ef | grep pcscd" and found the process.

I then launched the pcscd daemon in the foreground and found the message like this:

wto@solaris:~$ sudo /usr/lib/smartcard/pcscd -L -f -d DEBUG -a
Password: 
validate.c:174:() PCSCLITE_LIB_DIR=/usr/lib/smartcard, argv[0]:pcscdValidate.so.1
debuglog.c:298:() Debug options: APDU
cfgfuncs.c:913:() launchMode............ LAUNCHER
cfgfuncs.c:913:() logLevel ............. DEBUG
cfgfuncs.c:913:() logType .............. STDERR
cfgfuncs.c:913:() logFile .............. <null>
cfgfuncs.c:913:() baseDir .............. /var/run/pcscd
cfgfuncs.c:913:() instanceScript........ <null>
cfgfuncs.c:913:() ifdPluginDir ......... <null>
cfgfuncs.c:913:() pcscdPIDFile ......... /var/run/pcscd/pcscd.pid
cfgfuncs.c:913:() pcscConfigFile........ /etc/smartcard/pcscd.conf
cfgfuncs.c:913:() readerConfigFile...... <null>
cfgfuncs.c:913:() netBindFile .......... <null>
cfgfuncs.c:913:() pcscdMemMappedFile.... <null>
cfgfuncs.c:913:() argv0 ................ /usr/lib/smartcard/pcscd
cfgfuncs.c:913:() transportType ........ SOCKET_INETV4
cfgfuncs.c:913:() portNbr .............. 5999
cfgfuncs.c:913:() dpyNbr ............... -1
cfgfuncs.c:913:() screenNbr ............ -1
cfgfuncs.c:913:() xHostIp .............. 255.255.255.255
cfgfuncs.c:913:() useMappedMemory....... FALSE
cfgfuncs.c:913:() runInForeground ...... TRUE
cfgfuncs.c:913:() apduDebug ............ FALSE
cfgfuncs.c:913:() verbose .............. 0
cfgfuncs.c:913:() portNbrWild .......... FALSE
cfgfuncs.c:913:() baseDirWild .......... FALSE
cfgfuncs.c:913:() useAuthentication..... TRUE
cfgfuncs.c:913:() instanceTimeout ...... 0
cfgfuncs.c:913:() statusPollRate ....... 400000
cfgfuncs.c:913:() fifoPingTimeout ...... 20
cfgfuncs.c:913:() relaunchThreshold .... 2
cfgfuncs.c:913:() relaunchInterval ..... 1
launcher.c:558:() Setup launcher signal handlers

When I tried to launch in "instance mode" I got the following error message:

wto@solaris:~$ sudo /usr/lib/smartcard/pcscd -I -f -d DEBUG -a
Password: 
validate.c:174:() PCSCLITE_LIB_DIR=/usr/lib/smartcard, argv[0]:pcscdValidate.so.1
pcscdaemon.c:413:() pcscd PID=8983 logging...

debuglog.c:298:() Debug options: APDU
instance.c:101:() Initializing new instance: pcscd -I -x :0, pid=8983

instance.c:103:() Setup instance signal handlers
pargs: cannot examine 8872: no such process or core file
instance.c:146:() putenv(DISPLAY=:0)
instance.c:177:() Couldn't open fifo No such file or directory

When I tried to launch in "default mode" I got the following:

wto@solaris:~$ sudo /usr/lib/smartcard/pcscd -f -d DEBUG -a
validate.c:174:() PCSCLITE_LIB_DIR=/usr/lib/smartcard, argv[0]:pcscdValidate.so.1
debuglog.c:298:() Debug options: APDU
cfgfuncs.c:913:() launchMode............ DEFAULT
cfgfuncs.c:913:() logLevel ............. DEBUG
cfgfuncs.c:913:() logType .............. STDERR
cfgfuncs.c:913:() logFile .............. <null>
cfgfuncs.c:913:() baseDir .............. /var/run/pcscd
cfgfuncs.c:913:() instanceScript........ <null>
cfgfuncs.c:913:() ifdPluginDir ......... /usr/lib/smartcard/ifd-ccid.bundle
cfgfuncs.c:913:() pcscdPIDFile ......... /var/run/pcscd/pcscd.pid
cfgfuncs.c:913:() pcscConfigFile........ /etc/smartcard/pcscd.conf
cfgfuncs.c:913:() readerConfigFile...... /etc/smartcard/reader-Local.conf
cfgfuncs.c:913:() netBindFile .......... <null>
cfgfuncs.c:913:() pcscdMemMappedFile.... <null>
cfgfuncs.c:913:() argv0 ................ /usr/lib/smartcard/pcscd
cfgfuncs.c:913:() transportType ........ SOCKET_INETV4
cfgfuncs.c:913:() portNbr .............. 0
cfgfuncs.c:913:() dpyNbr ............... 0
cfgfuncs.c:913:() screenNbr ............ 0
cfgfuncs.c:913:() xHostIp .............. 127.0.0.1
cfgfuncs.c:913:() useMappedMemory....... FALSE
cfgfuncs.c:913:() runInForeground ...... TRUE
cfgfuncs.c:913:() apduDebug ............ FALSE
cfgfuncs.c:913:() verbose .............. 0
cfgfuncs.c:913:() portNbrWild .......... FALSE
cfgfuncs.c:913:() baseDirWild .......... FALSE
cfgfuncs.c:913:() useAuthentication..... TRUE
cfgfuncs.c:913:() instanceTimeout ...... 0
cfgfuncs.c:913:() statusPollRate ....... 400000
cfgfuncs.c:913:() fifoPingTimeout ...... 20
cfgfuncs.c:913:() relaunchThreshold .... 2
cfgfuncs.c:913:() relaunchInterval ..... 1
pcscdaemon.c:827:() Invalid reader config file:
/etc/smartcard/reader-Local.conf: No such file or directory
pcscdaemon.c:1054:() Cleaning per-instance files

pcscdaemon.c:838:() pcsc-lite 1.1 daemon ready.
hotplug_libusb.c:103:() HPReadBundleValues(): Drop Dir: /usr/lib/smartcard
hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
hotplug_libusb.c:413:() Adding USB device: /dev/usb:4e6.5111/0
readerfactory.c:1105:() Attempting startup of SCM SCR 331-DI (901001B6) 00 00 using /usr/lib/smartcard/ifd-ccid.bundle/Contents/Solaris/libccid.so
readerfactory.c:976:() Loading IFD Handler 3.0
ifdhandler.c:1518:init_driver() Driver version: 1.3.10
ifdhandler.c:1530:init_driver() LogLevel: 0x0003
ifdhandler.c:1554:init_driver() DriverOptions: 0x0000
ifdhandler.c:87:IFDHCreateChannelByName() lun: 0, device: usb:04e6/5111:libusb:/dev/usb:4e6.5111/0
ccid_usb.c:238:OpenUSBByName() Manufacturer: Ludovic Rousseau ([hidden email])
ccid_usb.c:248:OpenUSBByName() ProductString: Generic CCID driver
ccid_usb.c:254:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
ccid_usb.c:410:OpenUSBByName() Found Vendor/Product: 04E6/5111 (SCM SCR 331-DI)
ccid_usb.c:412:OpenUSBByName() Using USB bus/device: /dev/usb/4e6.5111/0
ccid_usb.c:784:get_data_rates() IFD does not support GET_DATA_RATES request: I/O error
ifdhandler.c:117:IFDHCreateChannelByName() IFDHCreateChannelByName: OpenPortByName succeeded
ifdhandler.c:357:IFDHGetCapabilities() tag: 0xFAE, usb:04e6/5111:libusb:/dev/usb:4e6.5111/0 (lun: 0)
ifdhandler.c:404:IFDHGetCapabilities() Reader supports 2 slot(s)
ifdhandler.c:543:IFDHGetCapabilities() Returning *Length = 1
ifdhandler.c:550:IFDHGetCapabilities() Returning *Value = 
ifdhandler.c:357:IFDHGetCapabilities() tag: 0xFAC, usb:04e6/5111:libusb:/dev/usb:4e6.5111/0 (lun: 0)
ifdhandler.c:543:IFDHGetCapabilities() Returning *Length = 1
ifdhandler.c:550:IFDHGetCapabilities() Returning *Value = 
readerfactory.c:1105:() Attempting startup of SCM SCR 331-DI (901001B6) 00 01 using /usr/lib/smartcard/ifd-ccid.bundle/Contents/Solaris/libccid.so
readerfactory.c:822:() Warning library pointer not NULL
readerfactory.c:976:() Loading IFD Handler 3.0
ifdhandler.c:87:IFDHCreateChannelByName() lun: 1, device: usb:04e6/5111:libusb:/dev/usb:4e6.5111/0
ccid_usb.c:238:OpenUSBByName() Manufacturer: Ludovic Rousseau ([hidden email])
ccid_usb.c:248:OpenUSBByName() ProductString: Generic CCID driver
ccid_usb.c:254:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
ccid_usb.c:349:OpenUSBByName() Opening slot: 1
ifdhandler.c:117:IFDHCreateChannelByName() IFDHCreateChannelByName: OpenPortByName succeeded
ifdhandler.c:1099:IFDHPowerICC() action: PowerUp, usb:04e6/5111:libusb:/dev/usb:4e6.5111/0 (lun: 0)
12:47 Card ATR: 3B BE 96 00 00 41 05 20 00 00 00 00 00 00 00 00 00 90 00 
hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.511

But no matter what mode I launched the pcscd daemon, the rdrlist still returns "SCardEstablishContext error: Service not available."

What I don't understand is, does Solaris pcsc-lite actually support accessing an USB CCID reader attached locally to the box? If yes, what configuration am I missing?

Thanks very much and Best Regards

William To





_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Solaris 11 and pcsc-lite

Marcin Cieslak-3
On Tue, 24 Nov 2015, William To wrote:

> Hi All,
>
> 12:47 Card ATR: 3B BE 96 00 00 41 05 20 00 00 00 00 00 00 00 00 00 90 00
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.511
>
> But no matter what mode I launched the pcscd daemon, the rdrlist still
> returns "SCardEstablishContext error: Service not available."

Getting ATR is good news - pcscd manages to talk to the card.
I don't know how "rdrlist" works, but maybe there is something
wrong with the pcscd communication socket? Is it using libpcsclite
or something else?

I would try running truss(1) on it to try to find out

Marcin

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Solaris 11 and pcsc-lite

William To
Hi All, 

The "rdrlist" is part of the pcsctools supplied by Sun with their pcsc-lite package which I am using.

I don't know how "rdrlist" works, but maybe there is something
wrong with the pcscd communication socket? Is it using libpcsclite

I tried to use it to verify the existence of the USB card reader. What about the "pcscd communication socket"? It's a new Solaris 11.3 box and does not have firewall on. 

I will check on the executable to see whether it uses the libpcsclite.

Regards

William To





On Tue, Nov 24, 2015 at 3:20 PM, Marcin Cieslak <[hidden email]> wrote:
On Tue, 24 Nov 2015, William To wrote:

> Hi All,
>
> 12:47 Card ATR: 3B BE 96 00 00 41 05 20 00 00 00 00 00 00 00 00 00 90 00
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.511
>
> But no matter what mode I launched the pcscd daemon, the rdrlist still
> returns "SCardEstablishContext error: Service not available."

Getting ATR is good news - pcscd manages to talk to the card.
I don't know how "rdrlist" works, but maybe there is something
wrong with the pcscd communication socket? Is it using libpcsclite
or something else?

I would try running truss(1) on it to try to find out

Marcin

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle


_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Solaris 11 and pcsc-lite

William To
In reply to this post by Marcin Cieslak-3
Hi All, 

Here's the dependency list from Sun's own "rdrlist":

wto@solaris:~$ ldd PCSC-lite_1.3/SunOS.i386/pcsctools/rdrlist/i386/rdrlist
libpcsclite.so.1 => /usr/lib/libpcsclite.so.1
libc.so.1 => /lib/libc.so.1
libdl.so.1 => /lib/libdl.so.1
libpthread.so.1 => /lib/libpthread.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libmp.so.2 => /lib/libmp.so.2
libucrypto.so.1 => /lib/libucrypto.so.1
libelf.so.1 => /lib/libelf.so.1
libcryptoutil.so.1 => /lib/libcryptoutil.so.1
libz.so.1 => /lib/libz.so.1
wto@solaris:~$ 


So it's using the libpcsclite.so.1 which is part of the pcsc-lite.

Should I make the effort of building pcsc-lite under Solaris 11 again if it is so difficult to configure the Sun's package to work? 

Regards

William To

On Tue, Nov 24, 2015 at 3:20 PM, Marcin Cieslak <[hidden email]> wrote:
On Tue, 24 Nov 2015, William To wrote:

> Hi All,
>
> 12:47 Card ATR: 3B BE 96 00 00 41 05 20 00 00 00 00 00 00 00 00 00 90 00
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.511
>
> But no matter what mode I launched the pcscd daemon, the rdrlist still
> returns "SCardEstablishContext error: Service not available."

Getting ATR is good news - pcscd manages to talk to the card.
I don't know how "rdrlist" works, but maybe there is something
wrong with the pcscd communication socket? Is it using libpcsclite
or something else?

I would try running truss(1) on it to try to find out

Marcin

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle


_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
Reply | Threaded
Open this post in threaded view
|

Re: Solaris 11 and pcsc-lite

William To
Hi All, 

I tried the PCSC_lite_1.3 and CCID_IFD_1.3.10 on another Solaris 10 virtual machine and the daemon started correctly and found the USB reader and the inserted smart card. 

And then I found out that there is an old version of PCSC lite 1.6.1 that compiles and runs under Solaris 11 x64. What happens now is when I run scriptor, it returns "Can't get info: Transaction failed." which I am trying to solve now.

Regards

William To



On Tue, Nov 24, 2015 at 3:44 PM, William To <[hidden email]> wrote:
Hi All, 

Here's the dependency list from Sun's own "rdrlist":

wto@solaris:~$ ldd PCSC-lite_1.3/SunOS.i386/pcsctools/rdrlist/i386/rdrlist
libpcsclite.so.1 => /usr/lib/libpcsclite.so.1
libc.so.1 => /lib/libc.so.1
libdl.so.1 => /lib/libdl.so.1
libpthread.so.1 => /lib/libpthread.so.1
libsocket.so.1 => /lib/libsocket.so.1
libnsl.so.1 => /lib/libnsl.so.1
libmp.so.2 => /lib/libmp.so.2
libucrypto.so.1 => /lib/libucrypto.so.1
libelf.so.1 => /lib/libelf.so.1
libcryptoutil.so.1 => /lib/libcryptoutil.so.1
libz.so.1 => /lib/libz.so.1
wto@solaris:~$ 


So it's using the libpcsclite.so.1 which is part of the pcsc-lite.

Should I make the effort of building pcsc-lite under Solaris 11 again if it is so difficult to configure the Sun's package to work? 

Regards

William To

On Tue, Nov 24, 2015 at 3:20 PM, Marcin Cieslak <[hidden email]> wrote:
On Tue, 24 Nov 2015, William To wrote:

> Hi All,
>
> 12:47 Card ATR: 3B BE 96 00 00 41 05 20 00 00 00 00 00 00 00 00 00 90 00
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:286:() Refresh USB device: /dev/usb:4e6.5111/0
> hotplug_libusb.c:272:() Found matching USB device: /dev/usb:4e6.511
>
> But no matter what mode I launched the pcscd daemon, the rdrlist still
> returns "SCardEstablishContext error: Service not available."

Getting ATR is good news - pcscd manages to talk to the card.
I don't know how "rdrlist" works, but maybe there is something
wrong with the pcscd communication socket? Is it using libpcsclite
or something else?

I would try running truss(1) on it to try to find out

Marcin

_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle



_______________________________________________
Pcsclite-muscle mailing list
[hidden email]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle