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

HID OMNIKEY 5023 ; ccid_usb.c:888:WriteUSB() write failed (1/14): LIBUSB_ERROR_TIMEOUT #101

Closed
Sukhoimaster opened this issue Oct 17, 2022 · 10 comments
Assignees

Comments

@Sukhoimaster
Copy link

Dear Ludovic,
First of all, I would to express deepest gratitude to the whole team and you for this PCSC , CCID, & Pyscard project.
The project has been very much helpful for those required such as myself 😃

Regarding the above subject, im requesting support for the issue im facing .

The application process

Originally ;

  • using [ACS ACR1281-u reader] with Pyscard API for my application to read write smart card [MIFARE+ 1k ,4k & DESFIRE EV2(contain MIFARE 4k configuration & data)].

  • Process flow

  • Start > SAM Key decrypt [ACR reader SAM slot] to extract Mifare key > Load mifare key & Authenticate [ACR reader] > Read & Write smart card [ACR reader].

  • Problem

  • Failed to authenticate smartcard : DESFIRE EV2, loaded with Mifare+ 4k data & config [CARD ATR : 3B 89 80 01 D0 05 00 03 00 5E BB 00 00 3B]

  • Finding

  • Not caused by the Pyscard API, but the ACS ACR1281-u reader lower layer/firmware itself . (Already liaise with ACR team)

Alternative ;
using [ACS ACR1281-u reader] & [HID OMNIKEY 5023] with Pyscard API for my application to read write smart card [MIFARE+ 1k ,4k & DESFIRE EV2(contain MIFARE 4k configuration & data)].

  • Process flow

Start > SAM Key decrypt [ACR reader SAM slot] to extract Mifare key > Load mifare key & Authenticate [HID reader] > Read & Write smart card [HID reader]

  • Problem

  • Middleware [PC/SC] unable to communicating with HID OMNIKEY 5023,thus alternative solution is not proven yet.

  • Finding

  • Pcsc_scan tools v1.5.4-1: pcsc_scan.txt

  • as below

I have tried in various configuration scenario.

Below is the required information ;

Scenario 1

Driver and middleware were built from Linux apt Package manager.

Version

[HID OMNIKEY 5023] is supported in this release.
libacsccid is present since driver for [ACR 1281-u] not available in libccid 1.4.30-1

  • Middleware (PC/SC) ; libpcsclite1:armhf v1.8.24-1 pcscd_ver.txt
  • USB Driver ; libusb-1.0-0:armhf v2:1.0.22-2
  • python3-pyscard ; 1.9.9-2build1-armhf

Platform

  • OS : Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux os_info.txt
  • Smart card middleware : libpcsclite1:armhf : 1.8.24-1
  • Smart card reader : HID Global OMNIKEY 5023 Smart Card Reader
  • Smart card name : MIFARE+ 4k SL1

LOG

Scenario 2

Driver and middleware built from current release repository : pcsc-lite-1.9.9, ccid-1.5.0 & libusb v1.0.26

Pcsc-lite configuration : --disable-libudev , --enable-libusb pcscv199.txt

Version

[ACR 1281-u] is now supported in this release. No longer required libacsccid [checked &tested] 🤩

Platform

  • OS : Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux [os_info.txt]
  • Smart card middleware : pcsc-lite v 1.9.9
  • Smart card reader : HID Global OMNIKEY 5023 Smart Card Reader
  • Smart card name : MIFARE+ 4k SL1

LOG

Scenario 3

Driver and middleware built from current release repository : pcsc-lite-1.9.9, ccid-1.5.0 & libusb v1.0.26

Pcsc-lite configuration : [default] libudev : enabled , libusb : disabled

Version

  • HID Global OMNIKEY 5023 Smart Card Reader [OMNIKEY 5023 Smart Card Reader] ,
  • Reader driver ; libccid : 1.5.0 [ccid150.txt]
  • Middleware (PC/SC) ; Pcscd ; V 1.9.9 [ pcscd_ver_1.txt]

Platform

  • OS : Linux beaglebone 4.19.94-ti-r42 #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020 armv7l GNU/Linux [os_info.txt]
  • Smart card middleware : pcsc-lite v 1.9.9
  • Smart card reader : HID Global OMNIKEY 5023 Smart Card Reader
  • Smart card name : MIFARE+ 4k SL1

LOG

  • Attachment log_2.txt

  • Nothing significant , since ccid is build with default configuration --enable-libusb

Changes of environment setup has done with proper install & removal/uninstall step.
e.g: apt autoremove , make uninstall , make distclean , configure.

@LudovicRousseau
Copy link
Owner

In log_2.txt I only find a ACS ACR1281U reader. No OMNIKEY 5023.

I don't understand why you generate so many configurations.
I don't understand why you try to use the ACS driver with the OMNIKEY reader.

In acshk/acsccid#32 @godfreychung already said that your card is not a Mifare card.

@Sukhoimaster
Copy link
Author

Sukhoimaster commented Oct 17, 2022

This is the new log for log_2(1).txt.

I take "try and error' approach with different configuration since im not very familiar with Human Interface Device integration. Thats why in my 1st scenario I build the package from the package manager . Which is very straight forward and ease for me.
My thought were, by diversify the package build method will narrow down the troubleshooting step for the developer as yourself.

Really hoping the PC/SC Workgroup will meet the mission target for standardization .

Reason for having ACS driver is, im using ACR1281-u completely for my application at initial.
I have 2 different smartcard version . MIFARE+ 4k & DESFIRE EV2

Then I encounter problem mentioned in acshk/acsccid#32 ; highlighting error reading DESFIRE EV2 with ISO 14443-4 A protocol using the ACR reader.

Reason for having OMNIKEY reader is because this the best available reader I can get from my area. Which was told to me that can resolve my issue with ACS reader by the merchant.

So my alternate plan is, use ACS reader for extracting securekey from SAM. Pass the extracted key to OMNIKEY Key for accessing the smart card and complete my application purpose.

Now, im having an issue with the reader driver for connecting to OMNIKEY.

I hope my clarification has been helpful.

@LudovicRousseau
Copy link
Owner

From log.txt (from Scenario 1) I see timeout errors:

00000147 -> 000000 65 00 00 00 00 00 05 00 00 00 
03003422 ccid_usb.c:898:ReadUSB() read failed (1/4): -7 LIBUSB_ERROR_TIMEOUT
00000463 ifdwrapper.c:364:IFDStatusICC() Card not transacted: 612

The reader does not respond to driver's commands. This is not normal. I can't do much.
This reader is in the "Should work but untested by me" list https://ccid.apdu.fr/ccid/shouldwork.html#0x076B0x5023
Maybe I should move it in the "Unsupported" list.

You can try to contact HID Global OMNIKEY support. Maybe they have a reader firmware update.

@Sukhoimaster
Copy link
Author

Yes , I think you should move it.

I will contact HID team to get support accordingly from them.

Thanks, very much appriciated.
Will close this issue now

@LudovicRousseau
Copy link
Owner

The reader is now in the "Unsupported or partly supported CCID readers" list
https://ccid.apdu.fr/ccid/unsupported.html#0x076B0x5023

@Sukhoimaster Sukhoimaster reopened this Oct 19, 2022
@Sukhoimaster
Copy link
Author

Sukhoimaster commented Oct 19, 2022

Hello @LudovicRousseau ,
after contacting with HID team.

They manage to get the HID working with the CCID release 1.4.34
pcsc_HID

The HID environment setup as below (screenshot from email reply) ;
image

I did follow the same environment setup on Linux armv7 x64 but FAILED

with new error

dyn_unix.c:58:DYN_LoadLibrary() /usr/lib/pcsc/drivers/ifd-ccid-hid-global.bundle/Contents/Linux/libccid.so: /usr/lib/arm-linux-gnueabihf/libfl.so.2: undefined symbol: yylex

Included log for reference .
hid_pcsc.txt pcscd log with environment setup suggested by HID .

It seem to me that the reader not respond to driver's command like you mentioned before .

Any comment from you ?

@LudovicRousseau
Copy link
Owner

From your log you are using the CCID driver version 1.4.30, not 1.4.34 or the latest 1.5.0.

I also see that a driver is installed in /usr/lib/pcsc/drivers/ifd-ccid-hid-global.bundle/ but failed to load.

00013524 [-1225163632] dyn_unix.c:58:DYN_LoadLibrary() /usr/lib/pcsc/drivers/ifd-ccid-hid-global.bundle/Contents/Linux/libccid.so: /usr/lib/arm-linux-gnueabihf/libfl.so.2: undefined symbol: yylex

Maybe your reader uses a firmware different than the one used by HID support team

I suggest to test on an x86 platform (standard PC with Ubuntu 22.04 for example) to eliminate possible issues with your ARM platform.

@Sukhoimaster
Copy link
Author

Hey @LudovicRousseau ,
I have tested on an x64 platform
Linux sonix 5.4.0-128-generic #144~18.04.1-Ubuntu SMP Thu Sep 22 11:08:41 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

And the driver seem to be working for HID OMNIKEY 5023
Here is the log for reference .

PC/SC Daemon ;
log_pcscd.txt

in this Log im using ccid release 1.4.34
I did also test using 1.5.0 and it working flawlessly .
ccid 1.5.0

pcsc-scan tools ;
pcsc_scan.txt

  • [ x86 platform ] Working & tested ; by HID Team
  • [ x64 plattform ] Working & tested ; by myself.
  • [ arm ] Failed using beaglebone armv7 . Will test using Raspberry pi 3b for validation .

@LudovicRousseau
Copy link
Owner

Your log_pcscd.txt does not contain the low level logs. But since you are able to get the card ATR I guess everything works fine.

Now you have to debug you USB stack on the beaglebone.
For the Raspberry pi you should read https://ludovicrousseau.blogspot.com/2014/04/usb-issues-with-raspberry-pi.html

I moved the reader back in the "Should work" list.

@Sukhoimaster
Copy link
Author

Yes , i have to debug my USB in the beaglebone.
Maybe I can try the same approach with full speed mode.
Ill try to dig around .
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants