Re: OpenSC with qemu (Gemplus support)

Anton Gerasimov <[email protected]>
Newsgroups gmane.comp.encryption.opensc.devel
Message-ID <[email protected]>
I don't have a physical token, what I'm trying to do is to emulate one
using (approximately) this manual [1]. Unfortunately Qemu seems to be
able to emulate just that one device type, so I don't have much choise here.

After some new tries pcscd gives some output that as far as I understand
indicates that it has made contact to the virtual card (attached), but
opensc-tool still only shows OpenCT readers.

'opensc-tool -a' doesn't show anything useful as well:
  $ opensc-tool -a
     Card not present.

Regarding the versions:

OpenSC: 0.16.0
OS: Linux v4.4.60 (Openembedded/Yocto build).
OpenCT: 0.6.20
PCSClite: 1.8.13

Thanks,
Anton

[1]: https://github.com/qemu/qemu/blob/master/docs/ccid.txt
On 09/06/2017 03:51 PM, Douglas E Engert wrote:
> Your command only list the readers, and it also says you are using the
> OpenCT
> rather the PCSClite.
>
> What versions of software are you using?
> OpenSC, OS, OpenCT, PCSClite?
>
> You said you are trying to use qemu. I use virtual Box, which presents
> to the
> virtual machine the real ID of a reader. I am not sure if qemu does
> that or presents
> a generic reader with ID 08e6:4433.
>
> The lsusb just says what type of reader. Are you using some token with
> a built in reader?
> If so what is it?
>
> What token are you using? The OpenSC driver Gemplus-GPK-16k is very
> old and was a card.
>
>
> to list the atr, try:
> opensc-tool -a
>
> Also look at using OpenSC debug in config file see:
>
> https://github.com/OpenSC/OpenSC/wiki/Using-OpenSC
>
>
> On 9/6/2017 7:48 AM, Anton Gerasimov wrote:
>> Hi,
>>
>> I'm trying to get OpenSC working with qemu (qemu-system-x86_64). It
>> emulates Gemplus token (lsusb output: 'ID 08e6:4433 Gemalto (was
>> Gemplus) GemPC433-Swap'), and it is unclear to me if it is supported in
>> OpenSC. It is listed as unsupported hardware [1], but the page for
>> Gemplus itself says it is supported [2].
>>
>> If it is not, I would be grateful for any hints about how qemu and
>> OpenSC can be put to work together. opensc-tool --list-readers currently
>> gives
>>
>>    # Detected readers (openct)
>>    Nr.  Card  Features  Name
>>    0    No              OpenCT reader (detached)
>>    1    No              OpenCT reader (detached)
>>
>> which as far as I understands means it can't detect any devices.
>>
>> Thanks,
>> Anton Gerasimov
>>
>> [1]
>> https://github.com/OpenSC/OpenSC/wiki/Supported-hardware-(smart-cards-and-USB-tokens)
>>
>> [2] https://github.com/OpenSC/OpenSC/wiki/Gemplus-GPK-16k
>>
>

-- 
Anton Gerasimov, ATS Advanced Telematic Systems GmbH
Kantstrasse 162, 10623 Berlin
Managing Directors: Dirk Pöschl, Armin G. Schmidt
Register Court: HRB 151501 B, Amtsgericht Charlottenburg

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Opensc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
pcscs.log (text/x-log, 10.8 KB)
00000000 ../../pcsc-lite-1.8.13/src/debuglog.c:292:DebugLogSetLevel() debug level=debug
00000071 ../../pcsc-lite-1.8.13/src/debuglog.c:321:DebugLogSetCategory() Debug options: APDU
00000007 ../../pcsc-lite-1.8.13/src/pcscdaemon.c:268:main() Force colored logs
00000024 ../../pcsc-lite-1.8.13/src/utils.c:84:GetDaemonPid() Can't open /var/run/pcscd/pcscd.pid: No such file or directory
00003551 configfile.l:283:DBGetReaderListDir() Parsing conf directory: /etc/reader.conf.d
00002707 configfile.l:317:DBGetReaderListDir() Skipping non regular file: .
00000012 configfile.l:355:DBGetReaderList() Parsing conf file: /etc/reader.conf.d/openct.conf
00000275 configfile.l:212:evaluatetoken() Add reader: OpenCT
00000020 configfile.l:317:DBGetReaderListDir() Skipping non regular file: ..
00000016 ../../pcsc-lite-1.8.13/src/readerfactory.c:1012:RFInitializeReader() Attempting startup of OpenCT 00 00 using /usr/lib/openct-ifd.so
00003990 ../../pcsc-lite-1.8.13/src/dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/lib/openct-ifd.so: undefined symbol: IFDHCreateChannelByName
00000015 ../../pcsc-lite-1.8.13/src/readerfactory.c:865:RFBindFunctions() Loading IFD Handler 2.0
00000084 ../../pcsc-lite-1.8.13/src/readerfactory.c:1043:RFInitializeReader() Open Port 0x0 Failed (/dev/null)
00000006 ../../pcsc-lite-1.8.13/src/readerfactory.c:335:RFAddReader() OpenCT init failed.
00000005 ../../pcsc-lite-1.8.13/src/readerfactory.c:558:RFRemoveReader() UnrefReader() count was: 1
00000003 ../../pcsc-lite-1.8.13/src/readerfactory.c:1063:RFUnInitializeReader() Attempting shutdown of OpenCT 00 00.
00000002 ../../pcsc-lite-1.8.13/src/readerfactory.c:934:RFUnloadReader() Unloading reader driver.
00000051 ../../pcsc-lite-1.8.13/src/pcscdaemon.c:569:main() pcsc-lite 1.8.13 daemon ready.
00006455 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000102 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000088 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0627, PID: 0x0001, path: /dev/bus/usb/001/002
00000139 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x1D6B, PID: 0x0001, path: /dev/bus/usb/001/001
00000097 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0409, PID: 0x55AA, path: /dev/bus/usb/001/003
00000139 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x08E6, PID: 0x4433, path: /dev/bus/usb/001/004
00000010 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:435:HPAddDevice() Adding USB device: Generic CCID Reader
00000065 ../../pcsc-lite-1.8.13/src/readerfactory.c:1012:RFInitializeReader() Attempting startup of Generic CCID Reader [CCID Interface] (1-0000:00:01.2-2.1) 00 00 using /usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so
00000464 ../../pcsc-lite-1.8.13/src/dyn_unix.c:106:DYN_GetAddress() IFDHCreateChannelByName: /usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so: undefined symbol: IFDHCreateChannelByName
00000010 ../../pcsc-lite-1.8.13/src/readerfactory.c:865:RFBindFunctions() Loading IFD Handler 2.0
00000070 ../../pcsc-lite-1.8.13/src/readerfactory.c:1043:RFInitializeReader() Open Port 0x200000 Failed (usb:08e6/4433:libudev:0:/dev/bus/usb/001/004)
00000006 ../../pcsc-lite-1.8.13/src/readerfactory.c:335:RFAddReader() Generic CCID Reader [CCID Interface] (1-0000:00:01.2-2.1) init failed.
00000003 ../../pcsc-lite-1.8.13/src/readerfactory.c:558:RFRemoveReader() UnrefReader() count was: 1
00000009 ../../pcsc-lite-1.8.13/src/readerfactory.c:1063:RFUnInitializeReader() Attempting shutdown of Generic CCID Reader [CCID Interface] (1-0000:00:01.2-2.1) 00 00.
00000003 ../../pcsc-lite-1.8.13/src/readerfactory.c:934:RFUnloadReader() Unloading reader driver.
00000033 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:501:HPAddDevice() Failed adding USB device: Generic CCID Reader
00000006 ../../pcsc-lite-1.8.13/src/readerfactory.c:1012:RFInitializeReader() Attempting startup of Generic CCID Reader [CCID Interface] (1-0000:00:01.2-2.1) 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000912 ../../pcsc-lite-1.8.13/src/readerfactory.c:897:RFBindFunctions() Loading IFD Handler 3.0
00000025 ../../ccid-1.4.24/src/ifdhandler.c:1953:init_driver() Driver version: 1.4.24
00000474 ../../ccid-1.4.24/src/ifdhandler.c:1970:init_driver() LogLevel: 0x0003
00000009 ../../ccid-1.4.24/src/ifdhandler.c:1981:init_driver() DriverOptions: 0x0000
00000103 ../../ccid-1.4.24/src/ifdhandler.c:1994:init_driver() LogLevel from LIBCCID_ifdLogLevel: 0x000F
00000006 ../../ccid-1.4.24/src/ifdhandler.c:110:CreateChannelByNameOrChannel() Lun: 0, device: usb:08e6/4433:libudev:0:/dev/bus/usb/001/004
00000006 ../../ccid-1.4.24/src/ccid_usb.c:237:OpenUSBByName() Reader index: 0, Device: usb:08e6/4433:libudev:0:/dev/bus/usb/001/004
00000009 ../../ccid-1.4.24/src/ccid_usb.c:269:OpenUSBByName() interface_number: 0
00000003 ../../ccid-1.4.24/src/ccid_usb.c:270:OpenUSBByName() usb bus/device: 1/4
00000003 ../../ccid-1.4.24/src/ccid_usb.c:287:OpenUSBByName() Using: /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist
00000440 ../../ccid-1.4.24/src/ccid_usb.c:305:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau ([email protected])
00000009 ../../ccid-1.4.24/src/ccid_usb.c:306:OpenUSBByName() ifdProductString: Generic CCID driver
00000004 ../../ccid-1.4.24/src/ccid_usb.c:307: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.
00000418 ../../ccid-1.4.24/src/ccid_usb.c:391:OpenUSBByName() Try device: 1/4
00000008 ../../ccid-1.4.24/src/ccid_usb.c:401:OpenUSBByName() vid/pid : 08E6/4433
00000003 ../../ccid-1.4.24/src/ccid_usb.c:448:OpenUSBByName() Checking device: 1/4
00000002 ../../ccid-1.4.24/src/ccid_usb.c:510:OpenUSBByName() Trying to open USB bus/device: 1/4
00000061 ../../ccid-1.4.24/src/ccid_usb.c:612:OpenUSBByName() Found Vendor/Product: 08E6/4433 (Gemalto Gemplus USB SmartCard Reader 433-Swap)
00000006 ../../ccid-1.4.24/src/ccid_usb.c:614:OpenUSBByName() Using USB bus/device: 1/4
00000002 ../../ccid-1.4.24/src/ccid_usb.c:666:OpenUSBByName() bNumDataRatesSupported is 0
00008182 ../../ccid-1.4.24/src/ccid_usb.c:1230:InterruptRead() before (0)
00029542 ../../ccid-1.4.24/src/ccid_usb.c:1276:InterruptRead() after (0) (0)
00000024 NotifySlotChange: 50 03 
00000007 -> 000000 65 00 00 00 00 00 00 00 00 00 
00001937 <- 000000 81 00 00 00 00 00 00 00 00 00 
00000019 -> 000000 65 00 00 00 00 00 01 00 00 00 
00002013 <- 000000 81 00 00 00 00 00 01 00 00 00 
00000020 -> 000000 6B 01 00 00 00 00 02 00 00 00 6A 
00002017 <- 000000 81 00 00 00 00 00 02 40 00 00 
00000018 ../../ccid-1.4.24/src/commands.c:992:CmdEscapeCheck Command not supported or not allowed
00000005 ../../ccid-1.4.24/src/ccid.c:221:set_gemalto_firmware_features() GET_FIRMWARE_FEATURES failed: 612, len=0
00000012 ../../ccid-1.4.24/src/ifdhandler.c:379:IFDHGetCapabilities() tag: 0xFB3, usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000016 ../../pcsc-lite-1.8.13/src/readerfactory.c:355:RFAddReader() Using the reader polling thread
00000004 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000005 -> 000000 65 00 00 00 00 00 03 00 00 00 
00001974 <- 000000 81 00 00 00 00 00 03 00 00 00 
00000023 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000059 ../../ccid-1.4.24/src/ifdhandler.c:379:IFDHGetCapabilities() tag: 0xFAE, usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000008 ../../ccid-1.4.24/src/ifdhandler.c:470:IFDHGetCapabilities() Reader supports 1 slot(s)
00000243 ../../pcsc-lite-1.8.13/src/hotplug_libudev.c:296:get_driver() Looking for a driver for VID: 0x0409, PID: 0x55AA, path: /dev/bus/usb/001/003
00000039 ../../pcsc-lite-1.8.13/src/readerfactory.c:1353:RFWaitForReaderInit() Waiting init for reader: Generic CCID Reader [CCID Interface] (1-0000:00:01.2-2.1) 00 00
00000029 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000007 -> 000000 65 00 00 00 00 00 04 00 00 00 
00001617 <- 000000 81 00 00 00 00 00 04 00 00 00 
00000013 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000005 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000004 -> 000000 65 00 00 00 00 00 05 00 00 00 
00002038 <- 000000 81 00 00 00 00 00 05 00 00 00 
00000016 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000005 ../../ccid-1.4.24/src/ifdhandler.c:1146:IFDHPowerICC() action: PowerUp, usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000004 -> 000000 62 00 00 00 00 00 06 00 00 00 
00002004 <- 000000 80 0C 00 00 00 00 06 00 00 00 3B 89 00 56 43 41 52 44 5F 4E 53 53 
00000036 ../../pcsc-lite-1.8.13/src/eventhandler.c:289:EHStatusHandlerThread() powerState: POWER_STATE_POWERED
00000007 Card ATR: 3B 89 00 56 43 41 52 44 5F 4E 53 53 
00000005 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000004 -> 000000 65 00 00 00 00 00 07 00 00 00 
00002006 <- 000000 81 00 00 00 00 00 07 00 00 00 
00000016 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000005 ../../ccid-1.4.24/src/ifdhandler.c:308:IFDHPolling() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0) 5000 ms
00000004 ../../ccid-1.4.24/src/ccid_usb.c:1230:InterruptRead() before (0)
05000996 ../../ccid-1.4.24/src/ccid_usb.c:1276:InterruptRead() after (0) (2)
00000025 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000008 -> 000000 65 00 00 00 00 00 08 00 00 00 
00001982 <- 000000 81 00 00 00 00 00 08 00 00 00 
00000016 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000004 ../../ccid-1.4.24/src/ifdhandler.c:1146:IFDHPowerICC() action: PowerDown, usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000005 -> 000000 63 00 00 00 00 00 09 00 00 00 
00001999 <- 000000 81 00 00 00 00 00 09 01 00 00 
00000014 ../../pcsc-lite-1.8.13/src/eventhandler.c:478:EHStatusHandlerThread() powerState: POWER_STATE_UNPOWERED
00000004 ../../ccid-1.4.24/src/ifdhandler.c:1813:IFDHICCPresence() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0)
00000004 -> 000000 65 00 00 00 00 00 0A 00 00 00 
00002007 <- 000000 81 00 00 00 00 00 0A 01 00 00 
00000014 ../../ccid-1.4.24/src/ifdhandler.c:1934:IFDHICCPresence() Card present
00000005 ../../ccid-1.4.24/src/ifdhandler.c:308:IFDHPolling() usb:08e6/4433:libudev:0:/dev/bus/usb/001/004 (lun: 0) 600000 ms
00000030 ../../ccid-1.4.24/src/ccid_usb.c:1230:InterruptRead() before (0)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.