Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get data from Watchdata Token #13

Closed
giroberto opened this issue Feb 3, 2016 · 9 comments
Closed

Can't get data from Watchdata Token #13

giroberto opened this issue Feb 3, 2016 · 9 comments

Comments

@giroberto
Copy link

Hello, I had reported while ago that I can't connect to my token using CCID and with your help I could make the computer recognize it, but now I can't get the certificate.
The ATR is not present on smartcard_list.txt, I added it manually to it.

Is a usb token from watchdata. I will attach a log using your code, versions
pcsc-perl 1.4.14-1
pcsc-tools 1.4.25-1
pcsclite 1.8.14-1
opensc 0.15.0-1
ccid 1.4.20-1
and another working log using watchdata driver.

log_pcsclite.txt
log_wd.txt

parse_pcsclite.txt
parse_wd.txt

getinfo_pcsclite.txt
getinfo_wd.txt

@giroberto giroberto changed the title Can't get data from Token Can't get data from Watchdata Token Feb 3, 2016
@LudovicRousseau
Copy link
Owner

According to getinfo_wd.txt the token is correctly working at the PKCS#11 level.
It is not a CCID issue.

You should read PKCS#11 documentation or contact Watch data if is a bug in /usr/lib/watchdata/ICP/lib/libwdpkcs_icp.so.

@giroberto
Copy link
Author

_wd logs are not using your ccid, are samples using watchdata supplied
driver
Em 3 de fev de 2016 13:08, "Ludovic Rousseau" [email protected]
escreveu:

According to getinfo_wd.txt the token is correctly working at the PKCS#11
level.
It is not a CCID issue.

You should read PKCS#11 documentation or contact Watch data if is a bug in
/usr/lib/watchdata/ICP/lib/libwdpkcs_icp.so.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@LudovicRousseau
Copy link
Owner

Why not use the watchdata driver if it works for you?

It looks like it is a fork or my CCID driver:

05007151 ccid_usb.c:697:OpenUSBByName() ifdManufacturerString: WatchData
05007154 ccid_usb.c:698:OpenUSBByName() ifdProductString: WatchData CCID driver
05007156 ccid_usb.c:699: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.

Where can I get the driver?

@giroberto
Copy link
Author

Because I work developing a application using token authentication
accepting a variety o models and using the pcsclite will be easier to
maintain and deploy.

yes, it is a fork I believe
I attached the driver, but you can download fom
https://www.watchdata.com/brazil/watchkey/index.htm

2016-02-03 13:21 GMT-02:00 Ludovic Rousseau [email protected]:

Why not use the watchdata driver if it works for you?

It looks like it is a fork or my CCID driver:

05007151 ccid_usb.c:697:OpenUSBByName() ifdManufacturerString: WatchData
05007154 ccid_usb.c:698:OpenUSBByName() ifdProductString: WatchData CCID driver
05007156 ccid_usb.c:699: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.

Where can I get the driver?


Reply to this email directly or view it on GitHub
#13 (comment)
.

@LudovicRousseau
Copy link
Owner

I already contacted watchdata last year about this forked driver but got no answer.
Maybe you should NOT work with token providers like this that do not respect the software licenses.

@giroberto
Copy link
Author

You're right, thank you for your support.

2016-02-03 16:02 GMT-02:00 Ludovic Rousseau [email protected]:

I already contacted watchdata last year about this forked driver but got
no answer.
Maybe you should NOT work with token providers like this that do not
respect the software licenses.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@cyberaguiar
Copy link

Hi giroberto,
I facing the same problem with watchdata tokens, do find some solution?
Thanks

@giroberto
Copy link
Author

I did not found any solution using CCID, I had to keep using manufacturer's provided driver.

@eferro70
Copy link

eferro70 commented Jun 9, 2016

Watchdata driver works but it bugs if there is a safenet aladdin driver installed. The bug occurs when the processes pcscd and pcscd_wd are running and watchdata token is inserted. If the pcscd is stoped everything gets ok.

LudovicRousseau added a commit that referenced this issue Oct 23, 2023
Declare ReaderIndex[] as _Atomic as it can be accessed from 2 different
threads.

==================
WARNING: ThreadSanitizer: data race (pid=4017)
  Write of size 4 at 0x7fd1b32be970 by main thread (mutexes: write M0, write M1):
    #0 ReleaseReaderIndex CCID/src/utils.c:81:21 (libccid.so+0xa672) (BuildId: 69b3a74d7af87f05c5edb71935a43b024a0fe968)
    #1 FreeChannel CCID/src/ifdhandler.c:92:2 (libccid.so+0xa672)
    #2 IFDHCloseChannel CCID/src/ifdhandler.c:302:2 (libccid.so+0xa672)
    #3 IFDCloseIFD PCSC/src/ifdwrapper.c:190:7 (pcscd+0xd9e30) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #4 RFUnInitializeReader PCSC/src/readerfactory.c:1153:9 (pcscd+0xd9e30)
    #5 removeReader PCSC/src/readerfactory.c:645:2 (pcscd+0xd9e30)
    #6 _UnrefReader PCSC/src/readerfactory.c:120:3 (pcscd+0xd9e30)
    #7 IFDCloseIFD PCSC/src/ifdwrapper.c:190:7 (pcscd+0xd9e30) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #8 RFUnInitializeReader PCSC/src/readerfactory.c:1153:9 (pcscd+0xd9e30)
    #9 removeReader PCSC/src/readerfactory.c:645:2 (pcscd+0xd9e30)
    #10 _UnrefReader PCSC/src/readerfactory.c:120:3 (pcscd+0xd9e30)
    #11 RFRemoveReader PCSC/src/readerfactory.c:624:5 (pcscd+0xdd282) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #12 RFRemoveReader PCSC/src/readerfactory.c:624:5 (pcscd+0xdd282) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #13 RFRemoveReader PCSC/src/readerfactory.c:624:5 (pcscd+0xdd282) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #14 RFCleanupReaders PCSC/src/readerfactory.c:1396:9 (pcscd+0xddb9e) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #15 SVCServiceRunLoop PCSC/src/pcscdaemon.c:123:4 (pcscd+0xd9574) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #16 main PCSC/src/pcscdaemon.c:801:2 (pcscd+0xd8810) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

  Previous read of size 4 at 0x7fd1b32be970 by thread T7:
    #0 LunToReaderIndex CCID/src/utils.c:72:14 (libccid.so+0xf8aa) (BuildId: 69b3a74d7af87f05c5edb71935a43b024a0fe968)
    #1 IFDHPolling CCID/src/ifdhandler.c:313:28 (libccid.so+0xb1bf) (BuildId: 69b3a74d7af87f05c5edb71935a43b024a0fe968)
    #2 EHStatusHandlerThread PCSC/src/eventhandler.c:467:10 (pcscd+0xd6f9b) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

  As if synchronized via sleep:
    #0 nanosleep <null> (pcscd+0x515ed) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #1 SYS_Sleep PCSC/src/sys_unix.c:69:9 (pcscd+0xdfbf9) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #2 SVCServiceRunLoop PCSC/src/pcscdaemon.c:117:10 (pcscd+0xd956a) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #3 main PCSC/src/pcscdaemon.c:801:2 (pcscd+0xd8810) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

  Location is global 'ReaderIndex' of size 64 at 0x7fd1b32be970 (libccid.so+0x22970)

  Mutex M0 (0x7b0c00000ed0) created at:
    #0 pthread_mutex_init <null> (pcscd+0x555cf) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #1 RFAddReader PCSC/src/readerfactory.c:355:9 (pcscd+0xdb4b7) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #2 HPAddDevice PCSC/src/hotplug_libudev.c:512:8 (pcscd+0xe3409) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #3 HPScanUSB PCSC/src/hotplug_libudev.c:579:3 (pcscd+0xe2a1d) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #4 HPRegisterForHotplugEvents PCSC/src/hotplug_libudev.c:761:2 (pcscd+0xe2a1d)
    #5 main PCSC/src/pcscdaemon.c:768:7 (pcscd+0xd8717) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

  Mutex M1 (0x7fd1b32be948) created at:
    #0 pthread_mutex_lock <null> (pcscd+0x71ada) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #1 CreateChannelByNameOrChannel CCID/src/ifdhandler.c:119:8 (libccid.so+0x82ae) (BuildId: 69b3a74d7af87f05c5edb71935a43b024a0fe968)
    #2 IFDHCreateChannelByName CCID/src/ifdhandler.c:233:9 (libccid.so+0x7e55) (BuildId: 69b3a74d7af87f05c5edb71935a43b024a0fe968)
    #3 IFDOpenIFD PCSC/src/ifdwrapper.c:136:9 (pcscd+0xdd0cb) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #4 RFInitializeReader PCSC/src/readerfactory.c:1121:8 (pcscd+0xdd0cb)
    #5 RFAddReader PCSC/src/readerfactory.c:366:7 (pcscd+0xdb52a) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #6 RFAddReader PCSC/src/readerfactory.c:366:7 (pcscd+0xdb52a) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #7 HPAddDevice PCSC/src/hotplug_libudev.c:512:8 (pcscd+0xe3409) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #8 HPScanUSB PCSC/src/hotplug_libudev.c:579:3 (pcscd+0xe2a1d) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #9 HPRegisterForHotplugEvents PCSC/src/hotplug_libudev.c:761:2 (pcscd+0xe2a1d)
    #10 main PCSC/src/pcscdaemon.c:768:7 (pcscd+0xd8717) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

  Thread T7 (tid=4049, running) created by thread T4 at:
    #0 pthread_create <null> (pcscd+0x53dfd) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #1 ThreadCreate PCSC/src/utils.c:184:8 (pcscd+0xe3cab) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #2 EHSpawnEventHandler PCSC/src/eventhandler.c:233:7 (pcscd+0xd6840) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #3 RFAddReader PCSC/src/readerfactory.c:397:8 (pcscd+0xdb6ba) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #4 HPAddDevice PCSC/src/hotplug_libudev.c:512:8 (pcscd+0xe3409) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)
    #5 HPEstablishUSBNotifications PCSC/src/hotplug_libudev.c:646:6 (pcscd+0xe3783) (BuildId: 046d0874ce19c882d4f3b8ab5213aa4cd336cd5e)

SUMMARY: ThreadSanitizer: data race CCID/src/utils.c:81:21 in ReleaseReaderIndex
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants