summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/sha1
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/sha1')
-rw-r--r--src/libstrongswan/plugins/sha1/Makefile.in4
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_plugin.c22
2 files changed, 16 insertions, 10 deletions
diff --git a/src/libstrongswan/plugins/sha1/Makefile.in b/src/libstrongswan/plugins/sha1/Makefile.in
index 1036bedfc..3d96f4339 100644
--- a/src/libstrongswan/plugins/sha1/Makefile.in
+++ b/src/libstrongswan/plugins/sha1/Makefile.in
@@ -220,9 +220,7 @@ includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
ipsecdir = @ipsecdir@
-ipsecgid = @ipsecgid@
ipsecgroup = @ipsecgroup@
-ipsecuid = @ipsecuid@
ipsecuser = @ipsecuser@
libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
@@ -261,6 +259,8 @@ sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
scripts_plugins = @scripts_plugins@
sharedstatedir = @sharedstatedir@
+soup_CFLAGS = @soup_CFLAGS@
+soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
diff --git a/src/libstrongswan/plugins/sha1/sha1_plugin.c b/src/libstrongswan/plugins/sha1/sha1_plugin.c
index 7b9cf878f..dda2cbc1a 100644
--- a/src/libstrongswan/plugins/sha1/sha1_plugin.c
+++ b/src/libstrongswan/plugins/sha1/sha1_plugin.c
@@ -19,6 +19,8 @@
#include "sha1_hasher.h"
#include "sha1_prf.h"
+static const char *plugin_name = "sha1";
+
typedef struct private_sha1_plugin_t private_sha1_plugin_t;
/**
@@ -32,10 +34,8 @@ struct private_sha1_plugin_t {
sha1_plugin_t public;
};
-/**
- * Implementation of sha1_plugin_t.destroy
- */
-static void destroy(private_sha1_plugin_t *this)
+METHOD(plugin_t, destroy, void,
+ private_sha1_plugin_t *this)
{
lib->crypto->remove_hasher(lib->crypto,
(hasher_constructor_t)sha1_hasher_create);
@@ -49,13 +49,19 @@ static void destroy(private_sha1_plugin_t *this)
*/
plugin_t *sha1_plugin_create()
{
- private_sha1_plugin_t *this = malloc_thing(private_sha1_plugin_t);
+ private_sha1_plugin_t *this;
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
+ INIT(this,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
+ );
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
(hasher_constructor_t)sha1_hasher_create);
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1,
+ lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, plugin_name,
(prf_constructor_t)sha1_prf_create);
return &this->public.plugin;