The proxy module would unload the PKCS#11 modules it was proxying when C_Finalize() was called. However if a caller in another thread was inside of a PKCS#11 function at the time, this would cause a crash.
Created attachment 93991 [details] [review] proxy: Fix cases where modules are unloaded while in use The proxy module would unload the PKCS#11 modules it was proxying when C_Finalize() was called. However if a caller in another thread was inside of a PKCS#11 function at the time, this would cause a crash. Change things around so that underlying modules are finalized during the proxy C_Finalize() but not released/unloaded until the proxy module itself is unloaded.
Created attachment 93992 [details] [review] proxy: Remove assertions when module is not initialized We should return CKR_CRYPTOKI_NOT_INITIALIZED rather than assert() when proxy PKCS#11 functions are called before the module is initialized.
Pushed to git master ie: 0.20.x. This bug/patch is not applicable to the older 0.18.x code.
Tested by djasa@redhat.com here: https://bugzilla.redhat.com/show_bug.cgi?id=1060232
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.