Roy Keene (Contractor) wrote:
Karsten Ohme wrote:

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:



<SNIP>

Here is a more functional fix:

This one works a very nicely according to my partner working on the cac stuff.
Thanks.

diff -uNr muscleframework-1.1.5.orig/libmusclepkcs11/src/p11x_slot.c muscleframework-1.1.5.orig.rsk/libmusclepkcs11/src/p11x_slot.c --- 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-19 09:54:40.000000000 -0500
@@ -200,7 +200,7 @@
         if (slot->conn.hCard)
         {
log_Log(LOG_LOW, "Releasing connection (slot_ReleaseConnection)"); - (void)MSC_ERROR(msc_ReleaseConnection(&slot->conn, MSC_LEAVE_TOKEN));
+            msc_ReleaseConnection(&slot->conn, MSC_LEAVE_TOKEN);
             log_Log(LOG_LOW, "Done releasing (slot_ReleaseConnection)");
         }

@@ -899,7 +899,8 @@
         if (slot->conn.hCard)
         {
log_Log(LOG_LOW, "Releasing connection (slot_DisconnectSlot)");
-            (void)MSC_ERROR(msc_ReleaseConnection(&slot->conn, action));
+            msc_ReleaseConnection(&slot->conn, action);
+            musclecard_fini();
         }

         slot->conn.hCard = 0;


The first hunk may not be needed. The first part of the second hunk (delete, add) may also not be needed. musclecard_fini() releases the "localHContext" which is invalidated.

There will probably be no more follow-ups to these patches since I've started using CoolKey primarily (since it has fewer dependencies, and requires fewer locally maintained patches).

--
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to