Martin Paljak wrote:
Hi,

It turnes out that the default build on osx is not very usable on os x when one starts to plug and unplug the card at 'strange' moments. I got a lot of asserts on card_lock>=1, For example when removing the card just when starting a SSL connection, before the pkcs#11 had been initialized, or for example when removing the card before ssl session had ended.

I spent some time trying to understand the issue and looking at the locking code and doing various experiments.

Anyway now i can play in-out with the card while firefox stays open so it seems to be better than before. Nils, Stef - please have a look and comment/adjust.
...
Index: pkcs11/pkcs11-global.c
===================================================================
--- pkcs11/pkcs11-global.c      (revision 343)
+++ pkcs11/pkcs11-global.c      (working copy)
@@ -29,6 +29,9 @@
 #endif
 #include "sc-pkcs11.h"

+/* Usually we want to support threads however we can (for example, to make FF 
happy) */
+#define PKCS11_THREAD_LOCKING 1

perhaps we should remove the PKCS11_THREAD_LOCKING macro completely

+
 sc_context_t *context = NULL;
 struct sc_pkcs11_pool session_pool;
 struct sc_pkcs11_slot virtual_slots[SC_PKCS11_MAX_VIRTUAL_SLOTS];
@@ -114,6 +117,7 @@
 static CK_C_INITIALIZE_ARGS_PTR        _locking;
 static void *                  _lock = NULL;
 #if (defined(HAVE_PTHREAD) || defined(_WIN32)) && 
defined(PKCS11_THREAD_LOCKING)
+#define HAVE_OS_LOCKING

what is this define good for ?

otherwise it looks good

Cheers,
Nils
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to