summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/hmac
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/hmac')
-rw-r--r--src/libstrongswan/plugins/hmac/Makefile.in12
-rw-r--r--src/libstrongswan/plugins/hmac/hmac.c4
-rw-r--r--src/libstrongswan/plugins/hmac/hmac_plugin.c80
3 files changed, 28 insertions, 68 deletions
diff --git a/src/libstrongswan/plugins/hmac/Makefile.in b/src/libstrongswan/plugins/hmac/Makefile.in
index e8355ab21..b9e2cd817 100644
--- a/src/libstrongswan/plugins/hmac/Makefile.in
+++ b/src/libstrongswan/plugins/hmac/Makefile.in
@@ -220,13 +220,7 @@ includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
ipsecdir = @ipsecdir@
-<<<<<<< HEAD
-ipsecgid = @ipsecgid@
ipsecgroup = @ipsecgroup@
-ipsecuid = @ipsecuid@
-=======
-ipsecgroup = @ipsecgroup@
->>>>>>> upstream/4.5.1
ipsecuser = @ipsecuser@
libcharon_plugins = @libcharon_plugins@
libdir = @libdir@
@@ -247,6 +241,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -265,14 +261,12 @@ sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
scripts_plugins = @scripts_plugins@
sharedstatedir = @sharedstatedir@
-<<<<<<< HEAD
-=======
soup_CFLAGS = @soup_CFLAGS@
soup_LIBS = @soup_LIBS@
->>>>>>> upstream/4.5.1
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/hmac/hmac.c b/src/libstrongswan/plugins/hmac/hmac.c
index c7b2739df..397a1ea11 100644
--- a/src/libstrongswan/plugins/hmac/hmac.c
+++ b/src/libstrongswan/plugins/hmac/hmac.c
@@ -147,8 +147,8 @@ METHOD(hmac_t, destroy, void,
private_hmac_t *this)
{
this->h->destroy(this->h);
- free(this->opaded_key.ptr);
- free(this->ipaded_key.ptr);
+ chunk_clear(&this->opaded_key);
+ chunk_clear(&this->ipaded_key);
free(this);
}
diff --git a/src/libstrongswan/plugins/hmac/hmac_plugin.c b/src/libstrongswan/plugins/hmac/hmac_plugin.c
index c15a29b1c..47d6d3cde 100644
--- a/src/libstrongswan/plugins/hmac/hmac_plugin.c
+++ b/src/libstrongswan/plugins/hmac/hmac_plugin.c
@@ -19,11 +19,6 @@
#include "hmac_signer.h"
#include "hmac_prf.h"
-<<<<<<< HEAD
-=======
-static const char *plugin_name = "hmac";
-
->>>>>>> upstream/4.5.1
typedef struct private_hmac_plugin_t private_hmac_plugin_t;
/**
@@ -37,6 +32,12 @@ struct private_hmac_plugin_t {
hmac_plugin_t public;
};
+METHOD(plugin_t, get_name, char*,
+ private_hmac_plugin_t *this)
+{
+ return "hmac";
+}
+
METHOD(plugin_t, destroy, void,
private_hmac_plugin_t *this)
{
@@ -53,74 +54,40 @@ METHOD(plugin_t, destroy, void,
plugin_t *hmac_plugin_create()
{
private_hmac_plugin_t *this;
-<<<<<<< HEAD
-=======
hasher_t *hasher;
->>>>>>> upstream/4.5.1
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
);
-<<<<<<< HEAD
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256,
- (prf_constructor_t)hmac_prf_create);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA1,
- (prf_constructor_t)hmac_prf_create);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_MD5,
- (prf_constructor_t)hmac_prf_create);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_384,
- (prf_constructor_t)hmac_prf_create);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_512,
- (prf_constructor_t)hmac_prf_create);
-
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_96,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_128,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_160,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_128,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_256,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_96,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_128,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_192,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_384,
- (signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_512_256,
- (signer_constructor_t)hmac_signer_create);
-=======
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA1);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA1, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA1, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_96, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_160, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA1_160, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA256);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_256, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_256_256, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
@@ -128,34 +95,33 @@ plugin_t *hmac_plugin_create()
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_MD5, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_MD5, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_96, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_96, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_128, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_MD5_128, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA384);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_384, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_384, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_192, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_192, get_name(this),
(signer_constructor_t)hmac_signer_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_384, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_384_384, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA512);
if (hasher)
{
hasher->destroy(hasher);
- lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_512, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_512, get_name(this),
(prf_constructor_t)hmac_prf_create);
- lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_512_256, plugin_name,
+ lib->crypto->add_signer(lib->crypto, AUTH_HMAC_SHA2_512_256, get_name(this),
(signer_constructor_t)hmac_signer_create);
}
->>>>>>> upstream/4.5.1
return &this->public.plugin;
}