diff options
author | Justin King-Lacroix <justinkl@google.com> | 2018-03-16 19:37:24 -0700 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-03-29 14:59:11 +0200 |
commit | 1ca877e3d3b1315ee9358f7e3c9096e10e14486e (patch) | |
tree | 399e7da18757ec3c7570cf5537c9b1a5e5de0049 | |
parent | 46901ab914e3f37e6e7287d47d9ab1281e3d64dc (diff) |
Treat CKR_CRYPTOKI_ALREADY_INITIALIZED correctly
In p11_kit_modules_initialize(), treat a return code
of CKR_CRYPTOKI_ALREADY_INITIALIZED as identical to
CKR_OK.
-rw-r--r-- | p11-kit/modules.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c index fb99e31..96baa44 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -2115,7 +2115,7 @@ p11_kit_modules_initialize (CK_FUNCTION_LIST **modules, for (i = 0, out = 0; modules[i] != NULL; i++, out++) { rv = modules[i]->C_Initialize (NULL); - if (rv != CKR_OK) { + if (rv != CKR_OK && rv != CKR_CRYPTOKI_ALREADY_INITIALIZED) { name = p11_kit_module_get_name (modules[i]); if (name == NULL) name = strdup ("(unknown)"); @@ -2130,6 +2130,11 @@ p11_kit_modules_initialize (CK_FUNCTION_LIST **modules, out--; free (name); } else { + if (rv == CKR_CRYPTOKI_ALREADY_INITIALIZED) { + name = p11_kit_module_get_name (modules[i]); + p11_message ("%s: module was already initialized", + name ? name : "(unknown)"); + } modules[out] = modules[i]; } } |