aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2010-12-04 11:43:06 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2010-12-04 11:43:06 +0100
commitdd621140d30439afda67a6eaf6bdec44227d5f67 (patch)
tree6740394ab1b85361380eb2eb954f64d2a5b06bec /src
parentc742935dac012f6ff9330ce09c3a1ec631e7cd9f (diff)
downloadstrongswan-dd621140d30439afda67a6eaf6bdec44227d5f67.tar.bz2
strongswan-dd621140d30439afda67a6eaf6bdec44227d5f67.tar.xz
Migrated pkcs1_plugin_t to INIT/METHOD macros
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c b/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
index d3afb5c67..33732f8a4 100644
--- a/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
+++ b/src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
@@ -32,10 +32,8 @@ struct private_pkcs1_plugin_t {
pkcs1_plugin_t public;
};
-/**
- * Implementation of pkcs1_plugin_t.pkcs1troy
- */
-static void destroy(private_pkcs1_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ private_pkcs1_plugin_t *this)
{
lib->creds->remove_builder(lib->creds,
(builder_function_t)pkcs1_public_key_load);
@@ -52,9 +50,15 @@ static void destroy(private_pkcs1_plugin_t *this)
*/
plugin_t *pkcs1_plugin_create()
{
- private_pkcs1_plugin_t *this = malloc_thing(private_pkcs1_plugin_t);
+ private_pkcs1_plugin_t *this;
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
+ INIT(this,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
+ );
lib->creds->add_builder(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, FALSE,
(builder_function_t)pkcs1_public_key_load);