diff options
author | Martin Willi <martin@strongswan.org> | 2009-06-04 15:51:20 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-06-09 11:18:56 +0200 |
commit | f908ff9f910dee0ae727a9406025d603d63bad71 (patch) | |
tree | 615f61141447980bf7bafbf1cb8b2922337079f1 /src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | |
parent | 513a1a2835d94a7b409b40051628c7a2d1107af3 (diff) | |
download | strongswan-f908ff9f910dee0ae727a9406025d603d63bad71.tar.bz2 strongswan-f908ff9f910dee0ae727a9406025d603d63bad71.tar.xz |
gcrypt hasher implementation
Diffstat (limited to 'src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c index c31dbe33d..062e890c8 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c @@ -15,6 +15,8 @@ #include "gcrypt_plugin.h" +#include "gcrypt_hasher.h" + #include <library.h> #include <debug.h> @@ -45,6 +47,8 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL; */ static void destroy(private_gcrypt_plugin_t *this) { + lib->crypto->remove_hasher(lib->crypto, + (hasher_constructor_t)gcrypt_hasher_create); free(this); } @@ -71,6 +75,22 @@ plugin_t *plugin_create() this->public.plugin.destroy = (void(*)(plugin_t*))destroy; + /* hashers */ + lib->crypto->add_hasher(lib->crypto, HASH_SHA1, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_MD2, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_MD4, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_MD5, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_SHA256, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_SHA384, + (hasher_constructor_t)gcrypt_hasher_create); + lib->crypto->add_hasher(lib->crypto, HASH_SHA512, + (hasher_constructor_t)gcrypt_hasher_create); + return &this->public.plugin; } |