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

"Card absent or mute" errors when ejecting and reinserting a card #142

Closed
emaxx-google opened this issue Jul 15, 2020 · 3 comments
Closed
Labels

Comments

@emaxx-google
Copy link
Collaborator

There seems to be some currently not well understood combination of conditions that leads to the CCID driver being unable to power up the card and, consequently, to failures to perform any SCard operations with it.
One scenario that seems to cause this issue relatively often is ejecting a card and reinserting it back within 2-3 seconds; however, the same problem was observed in other scenarios as well.
It's also unclear whether it's related to specific reader(s) or card(s); so far it was reproduced on two different readers ("SCM Microsystems Inc. SCR 3310" and "Gemalto IDBridge CT30") and on one specific card ("Oberthur Cosmo (eID)"). It was reproduced on two different versions of the CCID Free Software driver: 1.4.33 and 1.4.31.

In the logs, the problem manifests itself through the following errors:
CmdPowerOn Card absent or mute
IFDHPowerICC() PowerUp failed

@emaxx-google
Copy link
Collaborator Author

emaxx-google commented Jul 15, 2020

According to detailed CCID logs, in both successful and failing scenario the same command is sent to the reader:

62 00 00 00 00 00 05 00 00 00

(according to specs, 62h corresponds to the "PC_to_RDR_IccPowerOn" message)

However, the response to this command is different. In the success case, we get:

80 16 00 00 00 00 05 00 00 00 <then the ATR code follows>

meanwhile in the failing case we get:

80 00 00 00 00 00 05 41 FE 00

IIUC, 80h corresponds to the "RDR_to_PC_DataBlock" message, 41h corresponds to bmICCStatus=1 ("An ICC is present and inactive (not activated or shut down by hardware error)") and bmCommandStatus=1 ("Failed (error code provided by the error register)"), FEh is "ICC_MUTE" (with the documented possible cause "CCID timed out while talking to the ICC"). Overall, this combination of the error codes is documented for the PowerOn command as "ICC mute (Time out)".

@emaxx-google
Copy link
Collaborator Author

I've tried a couple of workarounds, but so far none of them helps. For posterity:

  • Tried to repeat the PC_to_RDR_IccPowerOn command in a loop (up to 100 times);
  • Tried to additionally do the PC_to_RDR_IccPowerOff command before each PC_to_RDR_IccPowerOn retry attempt;
  • Tried inserting 1-second sleeps between the retry attempts.

@emaxx-google
Copy link
Collaborator Author

Closing this - we haven't seen this recently, and it might've been a hardware issue.

@emaxx-google emaxx-google closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant