diff options
author | Martin Willi <martin@strongswan.org> | 2009-06-04 21:27:31 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-06-09 11:18:57 +0200 |
commit | a41d0932c2eff104a4702045c7a0662e4469e4fa (patch) | |
tree | e256fff5051b99a2ebfa26f3675d4a13f92b6c45 /src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | |
parent | 8e97e32705de41d50260fc6ee6d86efd4201606e (diff) | |
download | strongswan-a41d0932c2eff104a4702045c7a0662e4469e4fa.tar.bz2 strongswan-a41d0932c2eff104a4702045c7a0662e4469e4fa.tar.xz |
gcrypt rng implementation
Diffstat (limited to 'src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 <library.h> #include <debug.h> @@ -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; } |