From a41d0932c2eff104a4702045c7a0662e4469e4fa Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 4 Jun 2009 21:27:31 +0200 Subject: gcrypt rng implementation --- src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c') diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c index 4f66e3421..4d1137d44 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c @@ -17,6 +17,7 @@ #include "gcrypt_hasher.h" #include "gcrypt_crypter.h" +#include "gcrypt_rng.h" #include #include @@ -98,6 +99,8 @@ static void destroy(private_gcrypt_plugin_t *this) (hasher_constructor_t)gcrypt_hasher_create); lib->crypto->remove_crypter(lib->crypto, (crypter_constructor_t)gcrypt_crypter_create); + lib->crypto->remove_rng(lib->crypto, + (rng_constructor_t)gcrypt_rng_create); free(this); } @@ -162,6 +165,14 @@ plugin_t *plugin_create() lib->crypto->add_crypter(lib->crypto, ENCR_TWOFISH_CBC, (crypter_constructor_t)gcrypt_crypter_create); + /* random numbers */ + lib->crypto->add_rng(lib->crypto, RNG_WEAK, + (rng_constructor_t)gcrypt_rng_create); + lib->crypto->add_rng(lib->crypto, RNG_STRONG, + (rng_constructor_t)gcrypt_rng_create); + lib->crypto->add_rng(lib->crypto, RNG_TRUE, + (rng_constructor_t)gcrypt_rng_create); + return &this->public.plugin; } -- cgit v1.2.3