LudovicRousseau / PyKCS11

PKCS#11 Wrapper for Python
GNU General Public License v2.0
96 stars 35 forks source link

Trustkey Token on Linux. Testing with #27

Closed mndar closed 6 years ago

mndar commented 6 years ago

Your system information

Please describe your issue in as much detail as possible:

Thank you for your help so far LudovicRousseau. Referring to https://github.com/LudovicRousseau/CCID/issues/43 for usb token Trustkey (Watchdata token) I installed the drivers from the manufacturer's website and it installs pcscd_wd. I found a library in the binaries libwdpkcs_TRUSTKEY.so This is the result of the executiion

$ _PYKCS11LIB=/usr/lib/WatchData/TRUSTKEY/lib/libwdpkcsTRUSTKEY.so python getinfo.py cryptokiVersion: 2.10 flags:
libraryDescription: PKCS#11 cryptoki module
libraryVersion: 1.0 manufacturerID: WatchData
Available Slots: 3 [1, 2, 3] Slot n.: 1 firmwareVersion: 1.00 flags: CKF_REMOVABLE_DEVICE, CKF_HW_SLOT hardwareVersion: 1.00 manufacturerID: Watchdata Technologies Pte.Ltd slotDescription: WatchData IC CARD Reader/Writer 0
SessionInfo Error: CKR_SLOT_ID_INVALID (0x00000003) Slot n.: 2 firmwareVersion: 1.00 flags: CKF_REMOVABLE_DEVICE, CKF_HW_SLOT hardwareVersion: 1.00 manufacturerID: Watchdata Technologies Pte.Ltd slotDescription: WatchData IC CARD Reader/Writer 1
SessionInfo Error: CKR_SLOT_ID_INVALID (0x00000003) Slot n.: 3 firmwareVersion: 1.00 flags: CKF_REMOVABLE_DEVICE, CKF_HW_SLOT hardwareVersion: 1.00 manufacturerID: Watchdata Technologies Pte.Ltd slotDescription: WatchData IC CARD Reader/Writer 2
SessionInfo Error: CKR_SLOT_ID_INVALID (0x00000003)

Are these errors normal or do they indicate some missing implementation?

There's also a library libpkcs11wrapper.so distributed with the binary only driver package.

Steps for reproducing this issue:

  1. Download Linux drivers from http://trustkeytoken.co.in/ . Unpack the zip and install apt-get install /disks/storage/downloads/TrustKey_linux/wdtokentool-trustkey_3.4.3-1_all.deb

  2. Run getinfo.py $ _PYKCS11LIB=/usr/lib/WatchData/TRUSTKEY/lib/libwdpkcsTRUSTKEY.so python getinfo.py

Note: This only works with driver distributed by the manufacturer, which as you said in the referred issue, is a modification of your CCID driver. I have emailed the manufacturer for the source code of the driver.

LudovicRousseau commented 6 years ago

It looks like the PKCS#11 library from Trustkey is bogus. Maybe you can use the library even if some calls fails.

Since I don't have this hardware I can't really help you.

mndar commented 6 years ago

Thank you for your insight. I have posted my questions on the opensc-devel@lists.sourceforge.net mailing list asking about which driver can be used as skeleton for this token's driver. Any tips? You can close this issue.

LudovicRousseau commented 6 years ago

Do you have a different result with getinfo.py if you use my CCID driver instead of pcscd_wd? To be sure just remove the driver from Trustkey and try again.

I would like to know if the reader should be in the "should work" or "unsupported" list.

mndar commented 6 years ago

Unfortunately that's not going to be possible as I've started the refund process on Amazon. I manufacturer has not responded to the technical queries, so I had no choice.

LudovicRousseau commented 6 years ago

ok