aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/openssl/openssl_plugin.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2008-04-28 15:56:44 +0000
committerTobias Brunner <tobias@strongswan.org>2008-04-28 15:56:44 +0000
commit63cdbca21196c027b8c13701084522e31ee59775 (patch)
treed551e4e712aaad8e882d1a5377656c6d47d5420e /src/libstrongswan/plugins/openssl/openssl_plugin.c
parenta733b30276c5a588eabbd861f855292a3d33daeb (diff)
downloadstrongswan-63cdbca21196c027b8c13701084522e31ee59775.tar.bz2
strongswan-63cdbca21196c027b8c13701084522e31ee59775.tar.xz
added wrapper for OpenSSL hashers
Diffstat (limited to 'src/libstrongswan/plugins/openssl/openssl_plugin.c')
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_plugin.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c
index bfdec83ca..c4395ac7a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_plugin.c
+++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c
@@ -21,6 +21,7 @@
#include <library.h>
#include "openssl_crypter.h"
+#include "openssl_hasher.h"
typedef struct private_openssl_plugin_t private_openssl_plugin_t;
@@ -42,6 +43,8 @@ static void destroy(private_openssl_plugin_t *this)
{
lib->crypto->remove_crypter(lib->crypto,
(crypter_constructor_t)openssl_crypter_create);
+ lib->crypto->remove_hasher(lib->crypto,
+ (hasher_constructor_t)openssl_hasher_create);
EVP_cleanup();
@@ -59,6 +62,7 @@ plugin_t *plugin_create()
OpenSSL_add_all_algorithms();
+ /* crypter */
lib->crypto->add_crypter(lib->crypto, ENCR_DES,
(crypter_constructor_t)openssl_crypter_create);
lib->crypto->add_crypter(lib->crypto, ENCR_3DES,
@@ -76,5 +80,19 @@ plugin_t *plugin_create()
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC,
(crypter_constructor_t)openssl_crypter_create);
+ /* hasher */
+ lib->crypto->add_hasher(lib->crypto, HASH_MD2,
+ (hasher_constructor_t)openssl_hasher_create);
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5,
+ (hasher_constructor_t)openssl_hasher_create);
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1,
+ (hasher_constructor_t)openssl_hasher_create);
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256,
+ (hasher_constructor_t)openssl_hasher_create);
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384,
+ (hasher_constructor_t)openssl_hasher_create);
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512,
+ (hasher_constructor_t)openssl_hasher_create);
+
return &this->public.plugin;
}