/* Loaded modules */
void *dl_module;
- int dlopen_count;
/* Initialized modules */
CK_C_INITIALIZE_ARGS init_args;
return CKR_GENERAL_ERROR;
}
- mod->dlopen_count++;
-
gfl = dlsym (mod->dl_module, "C_GetFunctionList");
if (!gfl) {
_p11_message ("couldn't find C_GetFunctionList entry point in module: %s: %s",
return rv;
}
+ debug ("opened module: %s", path);
return CKR_OK;
}
prev = hash_get (gl.modules, mod->funcs);
if (prev != NULL) {
+ debug ("duplicate module %s, using previous", path);
free_module_unlocked (mod);
mod = prev;
if (!mod->initialize_count) {
+ debug ("C_Initialize: calling");
+
_p11_unlock ();
assert (mod->funcs);
_p11_lock ();
+ debug ("C_Initialize: result: %lu", rv);
+
/*
* Because we have the mutex unlocked above, two initializes could
* race. Therefore we need to take CKR_CRYPTOKI_ALREADY_INITIALIZED
CK_RV rv = CKR_OK;
/* WARNING: This function must be reentrant for the same arguments */
- debug ("in");
+ debug ("in: %s", module_path);
_p11_lock ();