aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-10-13 13:01:56 +0200
committerMartin Willi <martin@revosec.ch>2011-10-14 10:05:48 +0200
commite64d1141ff38c8aee86400d8a6fc5e7d430192d2 (patch)
tree533eb1043f8057f76f1c1e54150aefdd6268cd07 /src
parent756b504e40f61f5b0566d4682bbf4affa31ae8b5 (diff)
downloadstrongswan-e64d1141ff38c8aee86400d8a6fc5e7d430192d2.tar.bz2
strongswan-e64d1141ff38c8aee86400d8a6fc5e7d430192d2.tar.xz
Add features support to fips-prf plugin
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
index 7038da146..68b6bacb2 100644
--- a/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
+++ b/src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
@@ -37,11 +37,21 @@ METHOD(plugin_t, get_name, char*,
return "fips-prf";
}
+METHOD(plugin_t, get_features, int,
+ private_fips_prf_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_REGISTER(PRF, fips_prf_create),
+ PLUGIN_PROVIDE(PRF, PRF_FIPS_SHA1_160),
+ PLUGIN_DEPENDS(PRF, PRF_KEYED_SHA1),
+ };
+ *features = f;
+ return countof(f);
+}
+
METHOD(plugin_t, destroy, void,
private_fips_prf_plugin_t *this)
{
- lib->crypto->remove_prf(lib->crypto,
- (prf_constructor_t)fips_prf_create);
free(this);
}
@@ -51,25 +61,16 @@ METHOD(plugin_t, destroy, void,
plugin_t *fips_prf_plugin_create()
{
private_fips_prf_plugin_t *this;
- prf_t *prf;
INIT(this,
.public = {
.plugin = {
.get_name = _get_name,
- .reload = (void*)return_false,
+ .get_features = _get_features,
.destroy = _destroy,
},
},
);
- prf = lib->crypto->create_prf(lib->crypto, PRF_KEYED_SHA1);
- if (prf)
- {
- prf->destroy(prf);
- lib->crypto->add_prf(lib->crypto, PRF_FIPS_SHA1_160, get_name(this),
- (prf_constructor_t)fips_prf_create);
- }
-
return &this->public.plugin;
}