diff options
Diffstat (limited to 'src/crypto/rand/rand.c')
-rw-r--r-- | src/crypto/rand/rand.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/crypto/rand/rand.c b/src/crypto/rand/rand.c index ae30edb..a647b6a 100644 --- a/src/crypto/rand/rand.c +++ b/src/crypto/rand/rand.c @@ -14,6 +14,7 @@ #include <openssl/rand.h> +#include <limits.h> #include <string.h> #include <openssl/mem.h> @@ -95,6 +96,7 @@ int RAND_bytes(uint8_t *buf, size_t len) { return 1; } + memset(state->partial_block, 0, sizeof(state->partial_block)); state->calls_used = kMaxCallsPerRefresh; } @@ -149,6 +151,16 @@ int RAND_pseudo_bytes(uint8_t *buf, size_t len) { void RAND_seed(const void *buf, int num) {} +int RAND_load_file(const char *path, long num) { + if (num < 0) { /* read the "whole file" */ + return 1; + } else if (num <= INT_MAX) { + return (int) num; + } else { + return INT_MAX; + } +} + void RAND_add(const void *buf, int num, double entropy) {} int RAND_poll(void) { |