projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More extension code. Incomplete support for subject and issuer alt
[openssl.git]
/
crypto
/
rand
/
randfile.c
diff --git
a/crypto/rand/randfile.c
b/crypto/rand/randfile.c
index f2b37463630d6d544512b2e088977b67051f2114..3ae95f9012f1f3acb51a3787517a93d3815d1acb 100644
(file)
--- a/
crypto/rand/randfile.c
+++ b/
crypto/rand/randfile.c
@@
-57,9
+57,12
@@
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include "cryptlib.h"
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include "e_os.h"
#include "rand.h"
#undef BUFSIZE
#include "rand.h"
#undef BUFSIZE
@@
-69,7
+72,7
@@
/* #define RFILE ".rand" - defined in ../../e_os.h */
int RAND_load_file(file,bytes)
/* #define RFILE ".rand" - defined in ../../e_os.h */
int RAND_load_file(file,bytes)
-char *file;
+c
onst c
har *file;
long bytes;
{
MS_STATIC unsigned char buf[BUFSIZE];
long bytes;
{
MS_STATIC unsigned char buf[BUFSIZE];
@@
-81,12
+84,12
@@
long bytes;
i=stat(file,&sb);
/* If the state fails, put some crap in anyway */
i=stat(file,&sb);
/* If the state fails, put some crap in anyway */
- RAND_seed(
(unsigned char *)
&sb,sizeof(sb));
+ RAND_seed(&sb,sizeof(sb));
ret+=sizeof(sb);
if (i < 0) return(0);
if (bytes <= 0) return(ret);
ret+=sizeof(sb);
if (i < 0) return(0);
if (bytes <= 0) return(ret);
- in=fopen(file,"r");
+ in=fopen(file,"r
b
");
if (in == NULL) goto err;
for (;;)
{
if (in == NULL) goto err;
for (;;)
{
@@
-106,7
+109,7
@@
err:
}
int RAND_write_file(file)
}
int RAND_write_file(file)
-char *file;
+c
onst c
har *file;
{
unsigned char buf[BUFSIZE];
int i,ret=0;
{
unsigned char buf[BUFSIZE];
int i,ret=0;