diff options
Diffstat (limited to 'src/lib/entropy/dev_random')
-rw-r--r-- | src/lib/entropy/dev_random/dev_random.cpp | 6 | ||||
-rw-r--r-- | src/lib/entropy/dev_random/dev_random.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/entropy/dev_random/dev_random.cpp b/src/lib/entropy/dev_random/dev_random.cpp index 7c95fe20d..b115e0da2 100644 --- a/src/lib/entropy/dev_random/dev_random.cpp +++ b/src/lib/entropy/dev_random/dev_random.cpp @@ -81,15 +81,15 @@ void Device_EntropySource::poll(Entropy_Accumulator& accum) if(::select(max_fd + 1, &read_set, nullptr, nullptr, &timeout) < 0) return; - secure_vector<byte>& io_buffer = accum.get_io_buffer(READ_ATTEMPT); + m_buf.resize(READ_ATTEMPT); for(size_t i = 0; i != m_devices.size(); ++i) { if(FD_ISSET(m_devices[i], &read_set)) { - const ssize_t got = ::read(m_devices[i], &io_buffer[0], io_buffer.size()); + const ssize_t got = ::read(m_devices[i], &m_buf[0], m_buf.size()); if(got > 0) - accum.add(&io_buffer[0], got, ENTROPY_BITS_PER_BYTE); + accum.add(&m_buf[0], got, ENTROPY_BITS_PER_BYTE); } } } diff --git a/src/lib/entropy/dev_random/dev_random.h b/src/lib/entropy/dev_random/dev_random.h index 44b02ede0..1df616d56 100644 --- a/src/lib/entropy/dev_random/dev_random.h +++ b/src/lib/entropy/dev_random/dev_random.h @@ -29,6 +29,7 @@ class Device_EntropySource : public EntropySource private: typedef int fd_type; + secure_vector<byte> m_buf; std::vector<fd_type> m_devices; }; |