aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/rng/rng.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-02-19 10:20:55 -0500
committerJack Lloyd <[email protected]>2017-02-19 10:20:55 -0500
commit5b7c0aba50abf70ac081277141aaf375e4d8373d (patch)
treec386fa3946a17a48ffef41116e15e6e3cb0f2e19 /src/lib/rng/rng.cpp
parent0b56eef10b2d95d4a2e942333b63fb80797d4370 (diff)
Avoid use of deprecated function in (deprecated) Serialized_RNG constructor
Diffstat (limited to 'src/lib/rng/rng.cpp')
-rw-r--r--src/lib/rng/rng.cpp11
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
}