summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>1999-02-09 23:01:08 +0000
committerBen Laurie <ben@openssl.org>1999-02-09 23:01:08 +0000
commitbf5dcd135fb77dc23d8566b6456317a10e806b7d (patch)
treec4af8eeb22fcec5a1b58ec82d476e8757e57ef5f /crypto/rand
parent119f62881a57ac10f1b347492da43589d16012f8 (diff)
More exactitude with function arguments.
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/md_rand.c12
-rw-r--r--crypto/rand/rand.h6
-rw-r--r--crypto/rand/rand_lib.c3
-rw-r--r--crypto/rand/randfile.c2
4 files changed, 11 insertions, 12 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index c52d89babb..b04bb1e158 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -131,7 +131,7 @@ static long md_count[2]={0,0};
char *RAND_version="RAND part of OpenSSL 0.9.2 31-Dec-1998";
static void ssleay_rand_cleanup(void);
-static void ssleay_rand_seed(unsigned char *buf, int num);
+static void ssleay_rand_seed(const void *buf, int num);
static void ssleay_rand_bytes(unsigned char *buf, int num);
RAND_METHOD rand_ssleay_meth={
@@ -156,7 +156,7 @@ static void ssleay_rand_cleanup()
}
static void ssleay_rand_seed(buf,num)
-unsigned char *buf;
+const void *buf;
int num;
{
int i,j,k,st_idx,st_num;
@@ -249,15 +249,15 @@ int num;
CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
/* put in some default random data, we need more than
* just this */
- RAND_seed((unsigned char *)&m,sizeof(m));
+ RAND_seed(&m,sizeof(m));
#ifndef MSDOS
l=getpid();
- RAND_seed((unsigned char *)&l,sizeof(l));
+ RAND_seed(&l,sizeof(l));
l=getuid();
- RAND_seed((unsigned char *)&l,sizeof(l));
+ RAND_seed(&l,sizeof(l));
#endif
l=time(NULL);
- RAND_seed((unsigned char *)&l,sizeof(l));
+ RAND_seed(&l,sizeof(l));
/* #ifdef DEVRANDOM */
/*
diff --git a/crypto/rand/rand.h b/crypto/rand/rand.h
index 34ef90373e..7baac68ee5 100644
--- a/crypto/rand/rand.h
+++ b/crypto/rand/rand.h
@@ -66,7 +66,7 @@ extern "C" {
typedef struct rand_meth_st
{
#ifndef NOPROTO
- void (*seed)(unsigned char *buf, int num);
+ void (*seed)(const void *buf, int num);
void (*bytes)(unsigned char *buf, int num);
void (*cleanup)(void);
#else
@@ -81,8 +81,8 @@ void RAND_set_rand_method(RAND_METHOD *meth);
RAND_METHOD *RAND_get_rand_method(void );
RAND_METHOD *RAND_SSLeay(void);
void RAND_cleanup(void );
-void RAND_bytes( unsigned char *buf,int num);
-void RAND_seed( unsigned char *buf,int num);
+void RAND_bytes(unsigned char *buf,int num);
+void RAND_seed(const void *buf,int num);
int RAND_load_file(const char *file,long max_bytes);
int RAND_write_file(const char *file);
char *RAND_file_name(char *file,int num);
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index 4503215e1d..6bea09211c 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -57,7 +57,6 @@
*/
#include <stdio.h>
-#include "cryptlib.h"
#include <sys/types.h>
#include <time.h>
#include "rand.h"
@@ -87,7 +86,7 @@ void RAND_cleanup()
}
void RAND_seed(buf,num)
-unsigned char *buf;
+const void *buf;
int num;
{
if (rand_meth != NULL)
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 8ee23b61d1..3ae95f9012 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -84,7 +84,7 @@ long bytes;
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);