aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/entropy/entropy_srcs.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-18 10:10:09 +0000
committerlloyd <[email protected]>2015-03-18 10:10:09 +0000
commit1c5c28f2e8a605c0429bacd49fc8cacbbb50377a (patch)
treecd955920104c7d1d3db0cd56af7d350a04124de9 /src/lib/entropy/entropy_srcs.cpp
parent827080864508e03d796c5138b34d563977d693bb (diff)
Remove the shared IO buffer from EntropySource_Accumulator.
Instead each source that needs a buffer maintains their own.
Diffstat (limited to 'src/lib/entropy/entropy_srcs.cpp')
-rw-r--r--src/lib/entropy/entropy_srcs.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/entropy/entropy_srcs.cpp b/src/lib/entropy/entropy_srcs.cpp
index 67bced409..d44ab8c92 100644
--- a/src/lib/entropy/entropy_srcs.cpp
+++ b/src/lib/entropy/entropy_srcs.cpp
@@ -74,8 +74,7 @@ std::vector<std::unique_ptr<EntropySource>> get_default_entropy_sources()
#endif
#if defined(BOTAN_HAS_ENTROPY_SRC_PROC_WALKER)
- sources.push_back(std::unique_ptr<EntropySource>(
- new ProcWalking_EntropySource("/proc")));
+ sources.push_back(std::unique_ptr<EntropySource>(new ProcWalking_EntropySource("/proc")));
#endif
#if defined(BOTAN_HAS_ENTROPY_SRC_WIN32)
@@ -87,8 +86,7 @@ std::vector<std::unique_ptr<EntropySource>> get_default_entropy_sources()
#endif
#if defined(BOTAN_HAS_ENTROPY_SRC_UNIX_PROCESS_RUNNER)
- sources.push_back(std::unique_ptr<EntropySource>(
- new Unix_EntropySource(
+ sources.push_back(std::unique_ptr<EntropySource>(new Unix_EntropySource(
{ "/bin", "/sbin", "/usr/bin", "/usr/sbin" }
)));
#endif
@@ -110,11 +108,11 @@ void EntropySource::poll_available_sources(class Entropy_Accumulator& accum)
static std::vector<std::unique_ptr<EntropySource>> g_sources(get_default_entropy_sources());
if(g_sources.empty())
- throw std::runtime_error("No entropy sources enabled at build time, poll failed");
+ throw std::runtime_error("No entropy sources enabled at build time, RNG poll failed");
size_t poll_attempt = 0;
- while(!accum.polling_goal_achieved() && poll_attempt < 16)
+ while(!accum.polling_finished() && poll_attempt < 16)
{
const size_t src_idx = poll_attempt % g_sources.size();
g_sources[src_idx]->poll(accum);