summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rand/rand_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rand/rand_lib.c')
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c
index 34c6d5b968..b09a300c46 100644
--- a/src/lib/libcrypto/rand/rand_lib.c
+++ b/src/lib/libcrypto/rand/rand_lib.c
@@ -57,7 +57,6 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <sys/types.h>
61#include <time.h> 60#include <time.h>
62#include <openssl/rand.h> 61#include <openssl/rand.h>
63 62
@@ -90,9 +89,22 @@ void RAND_seed(const void *buf, int num)
90 rand_meth->seed(buf,num); 89 rand_meth->seed(buf,num);
91 } 90 }
92 91
93void RAND_bytes(unsigned char *buf, int num) 92void RAND_add(const void *buf, int num, double entropy)
94 { 93 {
95 if (rand_meth != NULL) 94 if (rand_meth != NULL)
96 rand_meth->bytes(buf,num); 95 rand_meth->add(buf,num,entropy);
97 } 96 }
98 97
98int RAND_bytes(unsigned char *buf, int num)
99 {
100 if (rand_meth != NULL)
101 return rand_meth->bytes(buf,num);
102 return(-1);
103 }
104
105int RAND_pseudo_bytes(unsigned char *buf, int num)
106 {
107 if (rand_meth != NULL)
108 return rand_meth->pseudorand(buf,num);
109 return(-1);
110 }