Migrated fips_prf plugin to INIT/METHOD macros

This commit is contained in:
Andreas Steffen
2010-12-04 20:56:21 +01:00
parent c7b778450e
commit 7e02e49112
2 changed files with 35 additions and 34 deletions
@@ -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);
private_fips_prf_plugin_t *this;
this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
INIT(this,
.public = {
.plugin = {
.destroy = _destroy,
},
},
);
lib->crypto->add_prf(lib->crypto, PRF_FIPS_SHA1_160,
(prf_constructor_t)fips_prf_create);