Todd Denniston wrote:
Roy Keene (Contractor) wrote:
<SNIP>

Here is a more functional fix:

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).



My partner found that with newer compilers (gcc >3.3) the attached patch was also needed so that musclecard_fini would be exported by libmusclecard.so. Without this patch newer gcc's put musclecard_fini in local symbols instead of the Text segment that earlier gcc's did.


------------------------------------------------------------------------

diff -uNr libmusclecard-1.3.3.orig/src/misc.h 
libmusclecard-1.3.3.patched/src/misc.h
--- libmusclecard-1.3.3.orig/src/misc.h 2006-05-02 16:53:34.000000000 -0400
+++ libmusclecard-1.3.3.patched/src/misc.h      2006-07-24 20:29:24.000000000 
-0400
@@ -37,7 +37,7 @@
/* GNU Compiler Collection (GCC) */
 #define CONSTRUCTOR __attribute__ ((constructor))
-#define DESTRUCTOR __attribute__ ((destructor))
+#define DESTRUCTOR __attribute__ ((destructor)) __attribute__ ((visibility ("protected")))
 #else


------------------------------------------------------------------------

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

Mr. Denniston,

Thanks. That's annoying since my archive doesn't include libmusclecard. I might look for a better way to invalidate the handle, if CoolKey seems inadequate.

Right now I'm just using CoolKey and it seems to work adequately.

--
        Roy Keene

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to