Skip to content

[question] T0/T1 protocol choice during SCardConnect and SCardTransmit #213

@lisa-bella97

Description

@lisa-bella97

I have two questions about your SCardConnect and SCardTransmit implementation.

  1. I call SCardConnect with dwPreferredProtocols = SCARD_PROTOCOL_T0. CCID reader and card both support T0 and T1 protocols, reader has feature "Automatic parameters negotiation made by the CCID". Such readers exist and can be found in https://ccid.apdu.fr/select_readers/?dwFeatures=6&dwProtocols=3. In theory, reader and card can agree on T1 protocol during automatic parameters negotiation, but SCardConnect will return T0 protocol as pdwActiveProtocol because of dwPreferredProtocols. Is it correct behaviour? How to know which protocol is negotiated between reader and card during automatic parameters negotiation? Looking at your sources of SCardConnect and IFDHSetProtocolParameters, I don't see any checks whether the auto-negotiated protocol is equal to the active protocol.

  2. SCardTransmit calls CmdXfrBlock at CCID driver level. I can't figure out why at APDU (short and extended) exchange level APDUs are always transmitted using T0 protocol (even though pdwActiveProtocol can be T1 protocol)? I also noticed that readers from previous question (with Automatic parameters negotiation and T0 and T1 support) have only APDU level of exchange (not TPDU or Character). Is it true that at this level of exchange we don't care which protocol is active - the real communication between reader and card will always be done using the negotiated parameters or T0 only?

Thank you very much for help!

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions