diff options
Diffstat (limited to 'extra/yassl/taocrypt/src/random.cpp')
-rw-r--r-- | extra/yassl/taocrypt/src/random.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/extra/yassl/taocrypt/src/random.cpp b/extra/yassl/taocrypt/src/random.cpp index cf0720b11d8..6aaa626b648 100644 --- a/extra/yassl/taocrypt/src/random.cpp +++ b/extra/yassl/taocrypt/src/random.cpp @@ -26,6 +26,8 @@ #include "runtime.hpp" #include "random.hpp" +#include <string.h> + #if defined(_WIN32) #define _WIN32_WINNT 0x0400 @@ -52,6 +54,7 @@ RandomNumberGenerator::RandomNumberGenerator() // place a generated block in output void RandomNumberGenerator::GenerateBlock(byte* output, word32 sz) { + memset(output, 0, sz); cipher_.Process(output, output, sz); } @@ -95,11 +98,7 @@ OS_Seed::OS_Seed() { fd_ = open("/dev/urandom",O_RDONLY); if (fd_ == -1) - { - fd_ = open("/dev/random",O_RDONLY); - if (fd_ == -1) error_.SetError(OPEN_RAN_E); - } } |