Implemented libstrongswan.plugins.random.strong_equals_true option

This commit is contained in:
Andreas Steffen
2013-11-16 00:11:40 +01:00
parent 85adb98daf
commit b63246c5db
4 changed files with 26 additions and 0 deletions
@@ -51,6 +51,9 @@ static int dev_random = -1;
/** /dev/urandom file descriptor */
static int dev_urandom = -1;
/** Is strong randomness equivalent to true randomness? */
static bool strong_equals_true = FALSE;
/**
* See header.
*/
@@ -67,6 +70,14 @@ int random_plugin_get_dev_urandom()
return dev_urandom;
}
/**
* See header.
*/
bool random_plugin_get_strong_equals_true()
{
return strong_equals_true;
}
/**
* Open a random device file
*/
@@ -131,6 +142,8 @@ plugin_t *random_plugin_create()
},
);
strong_equals_true = lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.random.strong_equals_true", FALSE);
urandom_file = lib->settings->get_str(lib->settings,
"libstrongswan.plugins.random.urandom", DEV_URANDOM);
random_file = lib->settings->get_str(lib->settings,