Ticket #72 (assigned defect)

Opened 3 years ago

Last modified 3 years ago

Investigate multithreaded access to PKCS#11

Reported by: martin Owned by: nils
Priority: normal Milestone: 0.12.0
Component: pkcs11 Version: devel
Severity: normal Keywords: days
Cc:

Description

Allow multiple threads to access pkcs#11 module (and as well libopensc?)

Change History

Changed 3 years ago by stef

The problem is currently that one thread could do a C_Finalize() which causes the sc_context_t struct to be released. But if another thread is stilling waiting in C_WaitForSlotEvent(), it will call/work with an invalid sc_context_t (-> crash, ...)

This is the case in e.g. Firefox 1.5 which switched from polling for slot events in the main thread, to opening a new thread and doing a C_WaitForSlotEvent() in that thread.

Changed 3 years ago by nils

  • owner changed from opensc-devel@… to nils
  • status changed from new to assigned

The real problem is that its not even clear which opensc function should be reentrant (and which objects could be shared among different threads). Before this hasn't been specified (and of course this should be well documented) is doesn't even make sense to think about using opensc in a multi-threaded environment like a pkcs11 lib.

Changed 3 years ago by nils

  • milestone set to 0.12.0
Note: See TracTickets for help on using tickets.