Roy Keene (Contractor) wrote:
> All,
> 
>     I have a DoD CAC Card that I have mostly working with MUSCLE,
> however if the card is removed and re-inserted applications that were
> already running (using the libmusclepkcs11 module) no longer detect the
> presence of the card until the application is restarted.
> 
> I've worked around the issue by recompiling libmusclepkcs11 with the
> following patch:
> 
> --- muscleframework-1.1.5.orig/libmusclepkcs11/src/p11x_slot.c 
> 2004-05-31 05:43:11.000000000 -0500
> +++ muscleframework-1.1.5.orig.rsk/libmusclepkcs11/src/p11x_slot.c
> 2006-07-11 17:12:46.000000000 -0500
> @@ -898,11 +898,11 @@
> 
>          if (slot->conn.hCard)
>          {
> +           slot->conn.hCard = 0;
>              log_Log(LOG_LOW, "Releasing connection
> (slot_DisconnectSlot)");
>              (void)MSC_ERROR(msc_ReleaseConnection(&slot->conn, action));
>          }
> 
> -        slot->conn.hCard = 0;
>          slot->slot_info.flags = (slot->slot_info.flags &
> ~CKF_TOKEN_PRESENT);
>      }
> 
> 
> 
> Are there plans for a better fix ?

This does work? Well it does, but, the msc_ReleaseConnection releases a
card handle. You set the card handle to 0, meaning, that the call is
never successful.

I think the library does only check the value of hCard, and if it is not
0 a connection is assumed, which is wrong for a removed card. The
problem should be solved by checking the card state, i.e. a separate
thread checking the state SCardStateChange or something like this exists
in the PC/SC API ....

I think a more successful version of pkcs11 exists, so maybe a fix is
already contained.

Karsten
> 
> Thanks.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Muscle mailing list
> [email protected]
> http://lists.drizzle.com/mailman/listinfo/muscle

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to