From 483db3ee5d0c0e92dd8ecd8bf0cbefaa6254b6eb Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 27 Jun 2012 11:15:33 +0200 Subject: If a module is not marked 'critical' then ignore failure * Ignore failure when initializing registered modules when 'critical' is not set on a module. --- p11-kit/modules.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'p11-kit/modules.c') diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 0694895..69fa88f 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -710,6 +710,7 @@ _p11_kit_initialize_registered_unlocked_reentrant (void) { Module *mod; hashiter iter; + int critical; CK_RV rv; rv = init_globals_unlocked (); @@ -727,10 +728,17 @@ _p11_kit_initialize_registered_unlocked_reentrant (void) rv = initialize_module_unlocked_reentrant (mod); + /* + * Module failed to initialize. If this is a critical module, + * then this, should abort loading of others. + */ if (rv != CKR_OK) { - _p11_debug ("failed to initialize module: %s: %s", - mod->name, p11_kit_strerror (rv)); - break; + critical = _p11_conf_parse_boolean (_p11_hash_get (mod->config, "critical"), 0); + if (critical) { + _p11_debug ("failed to initialize module: %s: %s", + mod->name, p11_kit_strerror (rv)); + break; + } } } } -- cgit v1.1