diff options
Diffstat (limited to 'src/lib/libcrypto/rand/randfile.c')
| -rw-r--r-- | src/lib/libcrypto/rand/randfile.c | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 663a36cb70..f4376cf8cc 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
| @@ -73,7 +73,7 @@ | |||
| 73 | # include <sys/stat.h> | 73 | # include <sys/stat.h> | 
| 74 | #endif | 74 | #endif | 
| 75 | 75 | ||
| 76 | #include <openssl/e_os.h> | 76 | #include "openssl/e_os.h" | 
| 77 | #include <openssl/crypto.h> | 77 | #include <openssl/crypto.h> | 
| 78 | #include <openssl/rand.h> | 78 | #include <openssl/rand.h> | 
| 79 | 79 | ||
| @@ -83,6 +83,9 @@ | |||
| 83 | 83 | ||
| 84 | /* #define RFILE ".rnd" - defined in ../../e_os.h */ | 84 | /* #define RFILE ".rnd" - defined in ../../e_os.h */ | 
| 85 | 85 | ||
| 86 | /* Note that these functions are intended for seed files only. | ||
| 87 | * Entropy devices and EGD sockets are handled in rand_unix.c */ | ||
| 88 | |||
| 86 | int RAND_load_file(const char *file, long bytes) | 89 | int RAND_load_file(const char *file, long bytes) | 
| 87 | { | 90 | { | 
| 88 | /* If bytes >= 0, read up to 'bytes' bytes. | 91 | /* If bytes >= 0, read up to 'bytes' bytes. | 
| @@ -213,7 +216,7 @@ err: | |||
| 213 | return (rand_err ? -1 : ret); | 216 | return (rand_err ? -1 : ret); | 
| 214 | } | 217 | } | 
| 215 | 218 | ||
| 216 | const char *RAND_file_name(char *buf, int size) | 219 | const char *RAND_file_name(char *buf, size_t size) | 
| 217 | { | 220 | { | 
| 218 | char *s = NULL; | 221 | char *s = NULL; | 
| 219 | char *ret=NULL; | 222 | char *ret=NULL; | 
| @@ -239,6 +242,8 @@ const char *RAND_file_name(char *buf, int size) | |||
| 239 | strlcat(buf,RFILE,size); | 242 | strlcat(buf,RFILE,size); | 
| 240 | ret=buf; | 243 | ret=buf; | 
| 241 | } | 244 | } | 
| 245 | else | ||
| 246 | buf[0] = '\0'; /* no file name */ | ||
| 242 | } | 247 | } | 
| 243 | 248 | ||
| 244 | #ifdef DEVRANDOM | 249 | #ifdef DEVRANDOM | 
| @@ -257,3 +262,4 @@ const char *RAND_file_name(char *buf, int size) | |||
| 257 | #endif | 262 | #endif | 
| 258 | return(ret); | 263 | return(ret); | 
| 259 | } | 264 | } | 
| 265 | |||
