diff options
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r-- | src/lib/rng/rng.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/rng/rng.cpp b/src/lib/rng/rng.cpp index 57e25cdd2..4fa8e42a6 100644 --- a/src/lib/rng/rng.cpp +++ b/src/lib/rng/rng.cpp @@ -58,7 +58,16 @@ RandomNumberGenerator* RandomNumberGenerator::make_rng() } #if defined(BOTAN_TARGET_OS_HAS_THREADS) -Serialized_RNG::Serialized_RNG() : m_rng(RandomNumberGenerator::make_rng()) {} + +#if defined(BOTAN_HAS_AUTO_SEEDING_RNG) +Serialized_RNG::Serialized_RNG() : m_rng(new AutoSeeded_RNG) {} +#else +Serialized_RNG::Serialized_RNG() + { + throw Exception("Serialized_RNG default constructor failed: AutoSeeded_RNG disabled in build"); + } +#endif + #endif } |