Solaris 10 has a IFDhandler /usr/lib/smartcard/ifdh_scmi2c.so,
with man pages and a /usr/include/smartcard/ifdhandler.h
This refer to the "Muscle PC/SC IFD Driver Development Kit"

But to get this to work with PCSC lite required two patches.

The SUN verison of IFDHPowerICC expects to be called with
CardAtrLength set to the max size of the ATR, and will return
in this field the size of the ATR. (The CCID driver does not
check this field, and zeros it on input.)

The IFDHSetProtocolParameters will return
IFD_PROTOCOL_NOT_SUPPORTED  rather then IFD_NOT_SUPPORTED.

Attached is a patch to address these problems in a way that
should be compatable with other IFDHandlers.

There may still be other issues as I am still having problems,
but not nessesarily related to the driver.

And here is a reader.conf that works with PCSCD:

reader.conf:
# for use on Solaris 10
#
FRIENDLYNAME "Internal Reader"
DEVICENAME /dev/scmi2c0
LIBPATH /usr/lib/smartcard/ifdh_scmi2c.so
CHANNELID "00"

--

 Douglas E. Engert  <[EMAIL PROTECTED]>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439
 (630) 252-5444
Index: src/eventhandler.c
===================================================================
--- src/eventhandler.c  (revision 1672)
+++ src/eventhandler.c  (working copy)
@@ -222,6 +222,13 @@
                        &rContext->readerState->cardAtrLength);
        if (dwStatus & SCARD_PRESENT)
        {
+/* Solaris says cardAtrLength is an input, and is max length*/
+/* and returns 600 if it is passed as zero */
+/* CCID driver sets this to 0 at start. */
+               Log2(PCSC_LOG_INFO, "DEE >cardAtrLength = %d", 
+                       rContext->readerState->cardAtrLength);
+               rContext->readerState->cardAtrLength = MAX_ATR_SIZE;
+
                rv = IFDPowerICC(rContext, IFD_POWER_UP,
                        rContext->readerState->cardAtr,
                        &rContext->readerState->cardAtrLength);
@@ -257,7 +264,7 @@
                        dwStatus &= ~SCARD_NEGOTIABLE;
                        dwStatus &= ~SCARD_SPECIFIC;
                        dwStatus &= ~SCARD_UNKNOWN;
-                       Log1(PCSC_LOG_ERROR, "Error powering up card.");
+                       Log2(PCSC_LOG_ERROR, "Error powering up card. %d",rv);
                }
 
                dwCurrentState = SCARD_PRESENT;
@@ -375,6 +382,7 @@
                                 * Power and reset the card 
                                 */
                                SYS_USleep(PCSCLITE_STATUS_WAIT);
+                               rContext->readerState->cardAtrLength = 
MAX_ATR_SIZE;
                                rv = IFDPowerICC(rContext, IFD_POWER_UP,
                                        rContext->readerState->cardAtr,
                                        &rContext->readerState->cardAtrLength);
Index: src/prothandler.c
===================================================================
--- src/prothandler.c   (revision 1672)
+++ src/prothandler.c   (working copy)
@@ -136,6 +136,10 @@
                        Log2(PCSC_LOG_INFO, "PTS not supported by driver, using 
T=%d",
                                (SCARD_PROTOCOL_T0 == protocol) ? 0 : 1);
                else
+               if (IFD_PROTOCOL_NOT_SUPPORTED == rv) {
+                       Log2(PCSC_LOG_INFO, "PTS protocol not supported, using 
T=%d",
+                               (SCARD_PROTOCOL_T0 == protocol) ? 0 : 1);
+               } else
                {
                        Log3(PCSC_LOG_INFO, "PTS failed (%d), using T=%d", rv,
                                (SCARD_PROTOCOL_T0 == protocol) ? 0 : 1);
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to