From: Andreas Steffen Date: Sun, 30 Oct 2011 16:59:23 +0000 (+0100) Subject: Added features support to agent plugin X-Git-Tag: 4.6.0~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c57867ebde0e40a310bef269b4590eb48ae7cbf;p=thirdparty%2Fstrongswan.git Added features support to agent plugin --- diff --git a/src/libstrongswan/plugins/agent/agent_plugin.c b/src/libstrongswan/plugins/agent/agent_plugin.c index 79c13b7c14..ed02e24e5e 100644 --- a/src/libstrongswan/plugins/agent/agent_plugin.c +++ b/src/libstrongswan/plugins/agent/agent_plugin.c @@ -37,11 +37,20 @@ METHOD(plugin_t, get_name, char*, return "agent"; } +METHOD(plugin_t, get_features, int, + private_agent_plugin_t *this, plugin_feature_t *features[]) +{ + static plugin_feature_t f[] = { + PLUGIN_REGISTER(PRIVKEY, agent_private_key_open, FALSE), + PLUGIN_PROVIDE(PRIVKEY, KEY_RSA), + }; + *features = f; + return countof(f); +} + METHOD(plugin_t, destroy, void, private_agent_plugin_t *this) { - lib->creds->remove_builder(lib->creds, - (builder_function_t)agent_private_key_open); free(this); } @@ -62,8 +71,6 @@ plugin_t *agent_plugin_create() }, ); - lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, FALSE, - (builder_function_t)agent_private_key_open); return &this->public.plugin; }