aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-21 04:16:28 +0000
committerlloyd <[email protected]>2006-09-21 04:16:28 +0000
commit623917ff27073b3471b7e2fc200d4f2e9217fd86 (patch)
tree9f9cb60d8aa25c1422f4355f3d96dadfaccd1274 /src
parentf7169dce7f61182bdda6b4bc8ac598ed830d82b2 (diff)
Simplify the initial RNG seeding operation
Diffstat (limited to 'src')
-rw-r--r--src/init_def.cpp25
-rw-r--r--src/policy.cpp1
2 files changed, 7 insertions, 19 deletions
diff --git a/src/init_def.cpp b/src/init_def.cpp
index 6faa5d86f..f85af086c 100644
--- a/src/init_def.cpp
+++ b/src/init_def.cpp
@@ -65,26 +65,15 @@ void LibraryInitializer::initialize(const InitializerOptions& args,
if(args.seed_rng())
{
- const u32bit min_entropy =
- global_config().option_as_u32bit("rng/min_entropy");
-
- if(min_entropy != 0)
+ for(u32bit j = 0; j != 4; ++j)
{
- u32bit bits_so_far = 0;
-
- for(u32bit j = 0; j != 4; ++j)
- {
- u32bit to_get = min_entropy - bits_so_far;
-
- bits_so_far += global_state().seed_prng(true, to_get);
-
- if(bits_so_far >= min_entropy)
- break;
- }
-
- if(bits_so_far < min_entropy)
- throw PRNG_Unseeded("Unable to collect sufficient entropy");
+ global_state().seed_prng(true, 384);
+ if(global_state().rng_is_seeded())
+ break;
}
+
+ if(!global_state().rng_is_seeded())
+ throw PRNG_Unseeded("Unable to collect sufficient entropy");
}
if(args.fips_mode() || args.self_test())
diff --git a/src/policy.cpp b/src/policy.cpp
index d1e691929..949e7ac2c 100644
--- a/src/policy.cpp
+++ b/src/policy.cpp
@@ -196,7 +196,6 @@ void set_default_config(Config& config)
config.set("conf", "pem/forgive", "8");
config.set("conf", "pem/width", "64");
- config.set("conf", "rng/min_entropy", "256", false);
config.set("conf", "rng/ms_capi_prov_type", "INTEL_SEC:RSA_FULL");
config.set("conf", "rng/unix_path", "/usr/ucb:/usr/etc:/etc");
config.set("conf", "rng/es_files", "/dev/urandom:/dev/random");