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

PCSC Type of Card, 1, 2, 4 ? #287

Open
fliot opened this issue Nov 5, 2024 · 5 comments
Open

PCSC Type of Card, 1, 2, 4 ? #287

fliot opened this issue Nov 5, 2024 · 5 comments

Comments

@fliot
Copy link

fliot commented Nov 5, 2024

First of all, fabulous projects guys, warm congrats.

Here is my mixup,
Smartcard > Smartcard Reader > VICC Linux > BivXReader Win > PCSC compliant application

I'm focusing on some legacy tool, that use exclusively PCSC access.

  • Using this tools with directly connected smartcard to the applicative host, this tool report "card type: 1" for one card, and "card type: 2" for the other (SUCCESS).

  • Using this tools with remotted PCSCD on an other linux host, the applicative host, this tool report "card type: 1" for one card, and "card type: 2" for the other (SUCCESS).

  • But using this tool though VICC -> BivXReader, this tool reports each card having a "card type: 4" (FAILURE, this simple card type identification is blocking for this tool).

It almost perfectly works ! 99% of the usual pcsc tools I'm using are working fine in this VICC -> BivXReader setting.

Any idea of what mean card type ?
All functions works, this parameter is useless in our context ?
I will certainly lure the local application, patching VICC or BivXReader (please advise), and putting some hardstored "card type" depending ATR, does it take sense ?

Thanks in advance for your advises and inputs.
Regards.

@frankmorgner
Copy link
Owner

I have no idea what those card types are. The Atr is forwarded from vicc to the windws vpcd, so that should be identical. You could start investigating by intercepting APDUs and PC/SC commands on the Windows client to check for differences.

use, for example, https://www.mysmartlogon.com/knowledge-base/trace-apdu-on-windows/

@fliot
Copy link
Author

fliot commented Nov 15, 2024

Hi @frankmorgner

I played with API Monitor, on working and BivXReader environment, got some success seeing data/traffic on these different system api(s), but I didn't see anything that could help me to understand this "card type".

I also did the effort to have a BivXReader building/compiling environment, and I'm able to build my own version and deploy it on vm instance, without driver signature issue, but I didn't find anything that would be related to "card type" in this code, but it's certainly the good place to look for, since, even without card inserted, my legacy tool is reporting "card type"=4.

I'm quite lost, any hints would be useful,

@frankmorgner
Copy link
Owner

do you have some example APDUs that you can post here?

@fliot
Copy link
Author

fliot commented Nov 15, 2024

I successfully get these
image
But didn't succeed to get SCardTransmit
Thanks for your guidance.
Regards.

@frankmorgner
Copy link
Owner

It seems that SCardGetAttrib always occurs before a SCardDisconnect. Maybe the original application is using this function call to get SCARD_ATTR_ICC_TYPE_PER_ATR (the second argument dwAttrId should be something like 0x90304). This attribute isn't supported by my driver. Maybe this is causing some problem.

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

2 participants