summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/modules.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index 0185450..f068510 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -104,7 +104,6 @@ typedef struct _Module {
/* Loaded modules */
void *dl_module;
- int dlopen_count;
/* Initialized modules */
CK_C_INITIALIZE_ARGS init_args;
@@ -260,8 +259,6 @@ dlopen_and_get_function_list (Module *mod, const char *path)
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",
@@ -276,6 +273,7 @@ dlopen_and_get_function_list (Module *mod, const char *path)
return rv;
}
+ debug ("opened module: %s", path);
return CKR_OK;
}
@@ -300,6 +298,7 @@ load_module_from_file_unlocked (const char *path, Module **result)
prev = hash_get (gl.modules, mod->funcs);
if (prev != NULL) {
+ debug ("duplicate module %s, using previous", path);
free_module_unlocked (mod);
mod = prev;
@@ -454,6 +453,8 @@ initialize_module_unlocked_reentrant (Module *mod)
if (!mod->initialize_count) {
+ debug ("C_Initialize: calling");
+
_p11_unlock ();
assert (mod->funcs);
@@ -461,6 +462,8 @@ initialize_module_unlocked_reentrant (Module *mod)
_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
@@ -1086,7 +1089,7 @@ p11_kit_load_initialize_module (const char *module_path,
CK_RV rv = CKR_OK;
/* WARNING: This function must be reentrant for the same arguments */
- debug ("in");
+ debug ("in: %s", module_path);
_p11_lock ();