added a gcrypt.quick_random option to generate weak testing keys faster
authorMartin Willi <martin@strongswan.org>
Mon, 15 Jun 2009 16:06:16 +0000 (18:06 +0200)
committerMartin Willi <martin@strongswan.org>
Mon, 15 Jun 2009 16:06:16 +0000 (18:06 +0200)
src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c

index 18e26e7..1d6d74a 100644 (file)
@@ -130,6 +130,11 @@ plugin_t *plugin_create()
        
        /* we currently do not use secure memory */
        gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
+       if (lib->settings->get_bool(lib->settings,
+                                                       "libstrongswan.plugins.gcrypt.quick_random", FALSE))
+       {
+               gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0);
+       }
        gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
        
        this = malloc_thing(private_gcrypt_plugin_t);