aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorReto Guadagnini <rguadagn@hsr.ch>2012-06-08 17:15:09 +0200
committerTobias Brunner <tobias@strongswan.org>2013-02-19 12:25:00 +0100
commit932717fbde194bba61a0cbea304fb7c0ded0368d (patch)
tree9065ba8c4facf29d5580d48e0814c8c9d4104288 /src
parenta77bbc3b8c37dc8513ce79531012e65c6daf247a (diff)
downloadstrongswan-932717fbde194bba61a0cbea304fb7c0ded0368d.tar.bz2
strongswan-932717fbde194bba61a0cbea304fb7c0ded0368d.tar.xz
ipseckey: Added "enable" option for the IPSECKEY plugin to strongswan.conf
Diffstat (limited to 'src')
-rw-r--r--src/libcharon/plugins/ipseckey/ipseckey_plugin.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/libcharon/plugins/ipseckey/ipseckey_plugin.c b/src/libcharon/plugins/ipseckey/ipseckey_plugin.c
index 563c36633..6f0f10507 100644
--- a/src/libcharon/plugins/ipseckey/ipseckey_plugin.c
+++ b/src/libcharon/plugins/ipseckey/ipseckey_plugin.c
@@ -40,6 +40,11 @@ struct private_ipseckey_plugin_t {
* credential set
*/
ipseckey_cred_t *cred;
+
+ /**
+ * IPSECKEY based authentication enabled
+ */
+ bool enabled;
};
METHOD(plugin_t, get_name, char*,
@@ -51,7 +56,10 @@ METHOD(plugin_t, get_name, char*,
METHOD(plugin_t, destroy, void,
private_ipseckey_plugin_t *this)
{
- lib->credmgr->remove_set(lib->credmgr, &this->cred->set);
+ if (this->enabled)
+ {
+ lib->credmgr->remove_set(lib->credmgr, &this->cred->set);
+ }
this->res->destroy(this->res);
DESTROY_IF(this->cred);
free(this);
@@ -73,6 +81,8 @@ plugin_t *ipseckey_plugin_create()
},
},
.res = lib->resolver->create(lib->resolver),
+ .enabled = lib->settings->get_bool(lib->settings,
+ "charon.plugins.ipseckey.enable", FALSE),
);
if (!this->res)
@@ -83,8 +93,11 @@ plugin_t *ipseckey_plugin_create()
return NULL;
}
- this->cred = ipseckey_cred_create(this->res);
- lib->credmgr->add_set(lib->credmgr, &this->cred->set);
+ if (this->enabled)
+ {
+ this->cred = ipseckey_cred_create(this->res);
+ lib->credmgr->add_set(lib->credmgr, &this->cred->set);
+ }
return &this->public.plugin;
}