/* make a random number and set the top and bottom bits */
time(&tim);
- RAND_seed((unsigned char *)&tim,sizeof(tim));
+ RAND_seed(&tim,sizeof(tim));
RAND_bytes(buf,(int)bytes);
if (top)
#ifndef NOPROTO
void MD5_Init(MD5_CTX *c);
-void MD5_Update(MD5_CTX *c, unsigned char *data, unsigned long len);
+void MD5_Update(MD5_CTX *c, const void *data, unsigned long len);
void MD5_Final(unsigned char *md, MD5_CTX *c);
unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md);
void MD5_Transform(MD5_CTX *c, unsigned char *b);
c->num=0;
}
-void MD5_Update(c, data, len)
+void MD5_Update(c, _data, len)
MD5_CTX *c;
-register unsigned char *data;
+const void *_data;
unsigned long len;
{
+ register const unsigned char *data=_data;
register ULONG *p;
int sw,sc;
ULONG l;
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={
}
static void ssleay_rand_seed(buf,num)
-unsigned char *buf;
+const void *buf;
int num;
{
int i,j,k,st_idx,st_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 */
/*
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
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);
*/
#include <stdio.h>
-#include "cryptlib.h"
#include <sys/types.h>
#include <time.h>
#include "rand.h"
}
void RAND_seed(buf,num)
-unsigned char *buf;
+const void *buf;
int num;
{
if (rand_meth != NULL)
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);
int ret= -1;
int new_state,state;
- RAND_seed((unsigned char *)&Time,sizeof(Time));
+ RAND_seed(&Time,sizeof(Time));
ERR_clear_error();
clear_sys_error();
int ret= -1;
int new_state,state;
- RAND_seed((unsigned char *)&Time,sizeof(Time));
+ RAND_seed(&Time,sizeof(Time));
ERR_clear_error();
clear_sys_error();
void (*cb)()=NULL;
int new_state,state;
- RAND_seed((unsigned char *)&l,sizeof(l));
+ RAND_seed(&l,sizeof(l));
ERR_clear_error();
clear_sys_error();
void (*cb)()=NULL;
int new_state,state;
- RAND_seed((unsigned char *)&l,sizeof(l));
+ RAND_seed(&l,sizeof(l));
ERR_clear_error();
clear_sys_error();
BIO *under;
int new_state,state,skip=0;;
- RAND_seed((unsigned char *)&Time,sizeof(Time));
+ RAND_seed(&Time,sizeof(Time));
ERR_clear_error();
clear_sys_error();
BIO *under;
int new_state,state,skip=0;
- RAND_seed((unsigned char *)&Time,sizeof(Time));
+ RAND_seed(&Time,sizeof(Time));
ERR_clear_error();
clear_sys_error();