Add a strongswan.conf option to disable loading of all certificates from a pkcs11 module

This commit is contained in:
Martin Willi
2012-10-24 13:07:53 +02:00
parent 794d713dca
commit 434902b302
@@ -81,6 +81,10 @@ static void token_event_cb(private_pkcs11_plugin_t *this, pkcs11_library_t *p11,
this->handle_events_lock->read_lock(this->handle_events_lock); this->handle_events_lock->read_lock(this->handle_events_lock);
if (add && this->handle_events) if (add && this->handle_events)
{
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.modules.%s.load_certs",
TRUE, p11->get_name(p11)))
{ {
creds = pkcs11_creds_create(p11, slot); creds = pkcs11_creds_create(p11, slot);
if (creds) if (creds)
@@ -91,6 +95,7 @@ static void token_event_cb(private_pkcs11_plugin_t *this, pkcs11_library_t *p11,
lib->credmgr->add_set(lib->credmgr, &creds->set); lib->credmgr->add_set(lib->credmgr, &creds->set);
} }
} }
}
else if (this->handle_events) else if (this->handle_events)
{ {
this->mutex->lock(this->mutex); this->mutex->lock(this->mutex);