aboutsummaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-30 15:52:44 +0000
committerlloyd <[email protected]>2008-09-30 15:52:44 +0000
commitc967179d47e361cd872bcde6fc6c3f13e2493741 (patch)
tree9ffa5419397c343faa87c85e86b9e0271395ab25 /src/core
parent2369d39cdaedfa24d4ab0d5ca6301ca466b0a9e5 (diff)
Correctly handle Randpool enabled but X9.31 not
Diffstat (limited to 'src/core')
-rw-r--r--src/core/rng.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/rng.cpp b/src/core/rng.cpp
index 16c87f563..d4ef37b5e 100644
--- a/src/core/rng.cpp
+++ b/src/core/rng.cpp
@@ -80,11 +80,13 @@ byte RandomNumberGenerator::next_byte()
*************************************************/
RandomNumberGenerator* RandomNumberGenerator::make_rng()
{
- RandomNumberGenerator* rng = 0;
+#if !defined(BOTAN_HAS_RANDPOOL)
+ return 0;
+#else
+
+ RandomNumberGenerator* rng = new Randpool(get_block_cipher("AES-256"),
+ get_mac("HMAC(SHA-256)"));
-#if defined(BOTAN_HAS_RANDPOOL)
- rng = new Randpool(get_block_cipher("AES-256"),
- get_mac("HMAC(SHA-256)"));
#if defined(BOTAN_HAS_X931_RNG)
rng = new ANSI_X931_RNG(get_block_cipher("AES-256"), rng);
@@ -138,9 +140,8 @@ RandomNumberGenerator* RandomNumberGenerator::make_rng()
rng->add_entropy_source(new FTW_EntropySource("/proc"));
#endif
-#endif
-
return rng;
+#endif
}
}