From 5b7c0aba50abf70ac081277141aaf375e4d8373d Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 19 Feb 2017 10:20:55 -0500 Subject: Avoid use of deprecated function in (deprecated) Serialized_RNG constructor --- src/lib/rng/rng.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/rng/rng.cpp') 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 } -- cgit v1.2.3