aboutsummaryrefslogtreecommitdiffstats
path: root/src/entropy/unix_procs/es_unix.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-23 18:02:08 +0000
committerlloyd <[email protected]>2008-11-23 18:02:08 +0000
commit1bddfc5aeffc8ece20c18b4b8f6a9a006969ff80 (patch)
tree4d3d3bde418c6fde92c30e439939cb3b2889c3ba /src/entropy/unix_procs/es_unix.h
parent6ed33c39344921294b782f004002a942cbd82eb6 (diff)
Change unix_procs entropy source to be a plain EntropySource instead of
a Buffered_EntropySource. Data used in the poll is directly accumulated into the output buffer using XOR, wrapping around as needed. The implementation uses xor_into_buf from xor_buf.h This is simpler and more convincingly secure than the method used by Buffered_EntropySource. In particular the collected data is persisted in the buffer there much longer than needed. It is also much harder for entropy sources to signal errors or a failure to collected data using Buffered_EntropySource. And, with the simple xor_into_buf function, it is actually quite easy to remove without major changes.
Diffstat (limited to 'src/entropy/unix_procs/es_unix.h')
-rw-r--r--src/entropy/unix_procs/es_unix.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/entropy/unix_procs/es_unix.h b/src/entropy/unix_procs/es_unix.h
index 907ebbc3a..f4af255ca 100644
--- a/src/entropy/unix_procs/es_unix.h
+++ b/src/entropy/unix_procs/es_unix.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_ENTROPY_SRC_UNIX_H__
#define BOTAN_ENTROPY_SRC_UNIX_H__
-#include <botan/buf_es.h>
+#include <botan/entropy_src.h>
#include <botan/unix_cmd.h>
#include <vector>
@@ -15,7 +15,7 @@ namespace Botan {
/*************************************************
* Unix Entropy Source *
*************************************************/
-class BOTAN_DLL Unix_EntropySource : public Buffered_EntropySource
+class BOTAN_DLL Unix_EntropySource : public EntropySource
{
public:
std::string name() const { return "Unix Entropy Source"; }
@@ -25,8 +25,8 @@ class BOTAN_DLL Unix_EntropySource : public Buffered_EntropySource
private:
static void add_default_sources(std::vector<Unix_Program>&);
- void do_fast_poll();
- void do_slow_poll();
+ u32bit fast_poll(byte buf[], u32bit length);
+ u32bit slow_poll(byte buf[], u32bit length);
const std::vector<std::string> PATH;
std::vector<Unix_Program> sources;