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

How to cope with hardware error (?) of Yubikey 4 OTP+U2F+CCID #155

Closed
frankmorgner opened this issue Apr 16, 2023 · 4 comments
Closed

How to cope with hardware error (?) of Yubikey 4 OTP+U2F+CCID #155

frankmorgner opened this issue Apr 16, 2023 · 4 comments
Assignees

Comments

@frankmorgner
Copy link
Contributor

Versions

  • smart card reader driver name and version: Yubikey 4 OTP+U2F+CCID
  • pcscd version: 1.8.26-3, libccid version: 1.4.31-1
  • the output of the command /usr/sbin/pcscd --version: pcsc-lite version 1.8.26.

Platform

  • Operating system or GNU/Linux distribution name and version: Linux xps13 5.15.0-69-generic #76~20.04.1-Ubuntu SMP Mon Mar 20 15:54:19 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Smart card middleware name and version: OpenSC current master

Issue

  • pcscd is running for a longer time and sometimes (not always) after waking up from hibernation, I am receiving a transmit error, which persits until the token is re-inserted again:
00000004 winscard.c:1595:SCardTransmit() Send Protocol: T=1
00000006 APDU: 00 CB 3F FF 03 5C 01 7E 00 
00000005 ifdhandler.c:1302:IFDHTransmitToICC() usb:1050/0407:libudev:2:/dev/bus/usb/001/023 (lun: 0)
00000004 commands.c:1623:CmdXfrBlockAPDU_extended() T=0 (extended): 9 bytes
00000009 -> 000000 6F 09 00 00 00 00 61 00 00 00 00 CB 3F FF 03 5C 01 7E 00 
00000181 <- 000000 81 00 00 00 00 00 61 40 FC 00 
00000007 commands.c:1523:CCID_Receive Overrun error
00000003 SW: 
00000003 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
00000003 winscard.c:1620:SCardTransmit() Card not transacted: 0x80100016
  • If possible, the CCID driver should be fixed to restart the connection or work around this problem. If not, I'd like to know whether restarting the communication is possible in software via the smart card middleware via a PC/SC call from OpenSC.
  • Currently the only way to get the token back into a working state is to manually unplug it and inserting it again.

Log

pcscd-log-clean.txt

@LudovicRousseau
Copy link
Owner

Hello Frank

What do you call hibernation?
suspend to RAM ? or suspend to disk with a complete power off?

You can have a look at #154
It is not exactly the same problem but maybe the patch in LudovicRousseau/CCID@f3d3b86 can help.

@LudovicRousseau LudovicRousseau self-assigned this Apr 17, 2023
@frankmorgner
Copy link
Contributor Author

I'm adding that rule to my system and will report in a couple of days about the (hopefully positive) effects 😉

@LudovicRousseau
Copy link
Owner

Your error is surprising.

  • the reader is not disconnect at hibernation. I can't find anything like that in your logs
  • the reader works fine until the problem. The previous APDU works fine and nothing special happened between the two events
  • the error "Overrun error" comes from the reader itself, not from the CCID driver or libusb
    the error 0xFC is defined in the CCID specification as: Overrun error while talking to the ICC

The problem is between the smart card reader and the smart card. Here it is a token so the problem is internal to the token.
It looks like a firmware bug. I am not sure the CCID driver can do anything to solve it.

@frankmorgner
Copy link
Contributor Author

I added the UDEV rule a while ago and didn't observe the problem anymore. At least this workaround seems to be good enough. Thank you.

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