summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/sha1/sha1_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/sha1/sha1_plugin.c')
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_plugin.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/libstrongswan/plugins/sha1/sha1_plugin.c b/src/libstrongswan/plugins/sha1/sha1_plugin.c
index fcb75dfa2..a9b84e790 100644
--- a/src/libstrongswan/plugins/sha1/sha1_plugin.c
+++ b/src/libstrongswan/plugins/sha1/sha1_plugin.c
@@ -19,11 +19,6 @@
#include "sha1_hasher.h"
#include "sha1_prf.h"
-<<<<<<< HEAD
-=======
-static const char *plugin_name = "sha1";
-
->>>>>>> upstream/4.5.1
typedef struct private_sha1_plugin_t private_sha1_plugin_t;
/**
@@ -37,15 +32,14 @@ struct private_sha1_plugin_t {
sha1_plugin_t public;
};
-<<<<<<< HEAD
-/**
- * Implementation of sha1_plugin_t.destroy
- */
-static void destroy(private_sha1_plugin_t *this)
-=======
+METHOD(plugin_t, get_name, char*,
+ private_sha1_plugin_t *this)
+{
+ return "sha1";
+}
+
METHOD(plugin_t, destroy, void,
private_sha1_plugin_t *this)
->>>>>>> upstream/4.5.1
{
lib->crypto->remove_hasher(lib->crypto,
(hasher_constructor_t)sha1_hasher_create);
@@ -59,29 +53,21 @@ METHOD(plugin_t, destroy, void,
*/
plugin_t *sha1_plugin_create()
{
-<<<<<<< HEAD
- private_sha1_plugin_t *this = malloc_thing(private_sha1_plugin_t);
-
- this->public.plugin.destroy = (void(*)(plugin_t*))destroy;
-
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1,
- (hasher_constructor_t)sha1_hasher_create);
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1,
-=======
private_sha1_plugin_t *this;
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)sha1_hasher_create);
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, plugin_name,
->>>>>>> upstream/4.5.1
+ lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, get_name(this),
(prf_constructor_t)sha1_prf_create);
return &this->public.plugin;