-
Notifications
You must be signed in to change notification settings - Fork 128
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 switch from T0 to T1 without disconnecting ? #74
Comments
tbh I have no idea. /cc @LudovicRousseau ? |
You need to call SCardReconnect with the right protocol. This is not currently exposed by mode-pcsclite |
Or do a disconnect with a reset and connect with the new protocol. Either way you have to reset the card IIRC. |
Problem is that I can't disconnect, the authentication process start a secure read / secure update and switch to another protocol in the middle of it, so disconnecting is not an option. Thanks for the feedback anyway, I'm working on a workaround using the CT API, so my node programm will have a to call another programm written in C that'll handle and manage ADPU commands depending on protocols. It's not really optimal so if you guys come up with any other idea, let me know :) |
Why do you need to change protocols in the first place ? Buggy card? Stupid card? Something else ? |
Using the old CT API is a bit strange these days. What do you mean exactly by "I have to switch from T0 to T1 or from T1 to T0."? |
Totally agree, I'd rather not tbh !
Here is the usecase : I have to download official compliance data from a remote device, normally someone would have to go on this device and authenticate using a smartcard in order to download data. To download these data remotely, this device sends me a list of ADPU commands that I forward to the smartcard and I send back the reply from the card. So far, it's all good. Problem is that the authentication protocol from this device specifies that I have to use one protocol or the other on certain conditions. (It's based on the value of some bytes within the buffer that I have to forward to the card).
3b ff 95 00 00 80 31 fe 43 80 31 80 67 b0 85 02 01 f3 a3 13 83 01 90 00 57
Thanks for the idea, I need to try that. |
I have a use case where I have to forward ADPU commands from one device to a remote card to perform an authentication procedure. During the authentication process I have to switch from T0 to T1 or from T1 to T0.
Problem is that if I try to change the protocol between two ADPU commands I get a protocol mismatch exception. Any thoughts on this would be highly appreciated !
The text was updated successfully, but these errors were encountered: