Hi to everybody,
I have been working these days with opensc 0.11.6 and Solaris 10 11/06
with pcsc-lite version 1.1 from solaris[1].
I am working with a card that works with trusted channel and I have
found strange things with the sc_reset() and pcsc_reconnect() functions.
The reader I am working with is the SunRay 270 internal Reader. I don't
know if it works same mode in other readers.
The fact is that when I make and sc_reset, which calls to pcsc_reconnect
which executes the following line:
pcsc-reader.c:490 rv = priv->gpriv->SCardReconnect(pslot->pcsc_card,
priv->gpriv->connect_exclusive ?
SCARD_SHARE_EXCLUSIVE : SCARD_SHARE_SHARED,
SCARD_PROTOCOL_ANY, reset ?
SCARD_UNPOWER_CARD : SCARD_LEAVE_CARD, &active_proto);
The pcsc daemon says that has send a reset and it seems to receive ATR
correctly, but the card is not reset. How can it be?
If I where in trusted channel, I execute sc_reset and I send a
non-ciphered apdu the card returns me an error saying that the apdu must
be ciphered when It should accept non-ciphered because of the reset.
I have been trying and if I change the code to this:
pcsc-reader.c:490 rv = priv->gpriv->SCardReconnect(pslot->pcsc_card,
priv->gpriv->connect_exclusive ?
SCARD_SHARE_EXCLUSIVE : SCARD_SHARE_SHARED,
SCARD_PROTOCOL_ANY, reset ?
SCARD_RESET_CARD : SCARD_LEAVE_CARD, &active_proto);
It works perfect. What do you thing about? The code should look like
this? Maybe we can put a macro detecting Solaris...
[1]:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/viewproductdetail-start?productref=pcsc-lite-1.1-sp-...@cds-cds_smi
--
Marc Rios Vallès
[email protected]
C3PO, S.A.
http://www.c3po.es
C/ Alejandro Goicoechea, 6 Local 9 - 08960 St. Just Desvern, Barcelona
Tel. 93 417 99 55 - Fax 93 253 12 80
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel