summaryrefslogtreecommitdiffstats
path: root/src/crypto/rand
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/rand')
-rw-r--r--src/crypto/rand/rand.c12
-rw-r--r--src/crypto/rand/windows.c2
2 files changed, 13 insertions, 1 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) {
diff --git a/src/crypto/rand/windows.c b/src/crypto/rand/windows.c
index 1a0cb8b..7bfcb1d 100644
--- a/src/crypto/rand/windows.c
+++ b/src/crypto/rand/windows.c
@@ -27,7 +27,7 @@
* "Community Additions" comment on MSDN here:
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx */
#define SystemFunction036 NTAPI SystemFunction036
-#include <ntsecapi.h>
+#include <NTSecAPI.h>
#undef SystemFunction036
#pragma warning(pop)