Commit 12f4abc0 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos Committed by Nikos Mavrogiannopoulos
Browse files

pkcs11: refuse to load modules with duplicate information

That is, when ck_info matches, we soft fail loading the module.
That is, because in several cases the pointers got by p11-kit
may differ for the same modules.

Signed-off-by: default avatarNikos Mavrogiannopoulos <>
parent a630d5a5
......@@ -235,7 +235,8 @@ pkcs11_add_module(const char* name, struct ck_function_list *module, unsigned cu
/* initially check if this module is a duplicate */
for (i = 0; i < active_providers; i++) {
/* already loaded, skip the rest */
if (module == providers[i].module) {
if (module == providers[i].module ||
memcmp(&info, &providers[i].info, sizeof(info)) == 0) {
_gnutls_debug_log("p11: module %s is already loaded.\n", name);
return GNUTLS_E_INT_RET_0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment