aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-03-30 16:13:55 -0400
committerJack Lloyd <[email protected]>2017-03-30 16:13:55 -0400
commit074bc5ad520397793f83c84c762da38b39fbf36b (patch)
tree07932632e567c1dd283790f1a4620a459493c4b4 /src
parent19e08bd300b269446b5611078d3137761e92df2f (diff)
parenteb9bde389750a567cfbfc3c25770323173b6e770 (diff)
Merge GH #954 Always poll 256 bytes from getentropy syscall
Diffstat (limited to 'src')
-rw-r--r--src/lib/entropy/getentropy/getentropy.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/entropy/getentropy/getentropy.cpp b/src/lib/entropy/getentropy/getentropy.cpp
index 56c356eba..e578a4ed5 100644
--- a/src/lib/entropy/getentropy/getentropy.cpp
+++ b/src/lib/entropy/getentropy/getentropy.cpp
@@ -12,12 +12,13 @@
namespace Botan {
/**
-* Gather BOTAN_SYSTEM_RNG_POLL_REQUEST bytes entropy from getentropy(2).
-* This is 64 bytes, note that maximum buffer size is limited to 256 bytes.
+* Gather 256 bytes entropy from getentropy(2). Note that maximum
+* buffer size is limited to 256 bytes. On OpenBSD this does neither
+* block nor fail.
*/
size_t Getentropy::poll(RandomNumberGenerator& rng)
{
- secure_vector<uint8_t> buf(BOTAN_SYSTEM_RNG_POLL_REQUEST);
+ secure_vector<uint8_t> buf(256);
if(::getentropy(buf.data(), buf.size()) == 0)
{