diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:56:21 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:56:21 +0100 |
commit | 7e02e491129ed1dad2a802766a1820ff29e50912 (patch) | |
tree | cb8140615cc7d5e633ec9166c39450bedaa9efaf /src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c | |
parent | c7b778450e477f3537f14d3a445c23438f5dcf86 (diff) | |
download | strongswan-7e02e491129ed1dad2a802766a1820ff29e50912.tar.bz2 strongswan-7e02e491129ed1dad2a802766a1820ff29e50912.tar.xz |
Migrated fips_prf plugin to INIT/METHOD macros
Diffstat (limited to 'src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c index f41265637..fed3eafec 100644 --- a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c +++ b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c @@ -31,10 +31,8 @@ struct private_fips_prf_plugin_t { fips_prf_plugin_t public; }; -/** - * Implementation of fips_prf_plugin_t.destroy - */ -static void destroy(private_fips_prf_plugin_t *this) +METHOD(plugin_t, destroy, void, + private_fips_prf_plugin_t *this) { lib->crypto->remove_prf(lib->crypto, (prf_constructor_t)fips_prf_create); @@ -46,9 +44,15 @@ static void destroy(private_fips_prf_plugin_t *this) */ plugin_t *fips_prf_plugin_create() { - private_fips_prf_plugin_t *this = malloc_thing(private_fips_prf_plugin_t); - - this->public.plugin.destroy = (void(*)(plugin_t*))destroy; + private_fips_prf_plugin_t *this; + + INIT(this, + .public = { + .plugin = { + .destroy = _destroy, + }, + }, + ); lib->crypto->add_prf(lib->crypto, PRF_FIPS_SHA1_160, (prf_constructor_t)fips_prf_create); |