diff options
36 files changed, 110 insertions, 109 deletions
diff --git a/Makefile.org b/Makefile.org index 0f370d2ea5..245b6b55f4 100644 --- a/Makefile.org +++ b/Makefile.org @@ -355,8 +355,8 @@ install: all chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ done @echo installing man 1 - @for i in doc/apps/*.pod; do (cd `dirname $$i`; fn=`basename $$i .pod`; sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; ../../util/pod2man.pl --section=$$sec --date=`date +%Y-%m-%d` --center=OpenSSL --release=$(VERSION) `basename $$i` > $(INSTALL_PREFIX)$(INSTALLTOP)/man/man$$sec/`basename $$i .pod`.$$sec); done + @for i in doc/apps/*.pod; do (cd `dirname $$i`; fn=`basename $$i .pod`; sec=`[ "$$fn" = "config" ] && echo 5 || echo 1`; ../../util/pod2man.pl --section=$$sec --center=OpenSSL --release=$(VERSION) `basename $$i` > $(INSTALL_PREFIX)$(INSTALLTOP)/man/man$$sec/`basename $$i .pod`.$$sec); done @echo installing man 3 - @for i in doc/crypto/*.pod doc/ssl/*.pod; do (cd `dirname $$i`; ../../util/pod2man.pl --section=3 --date=`date +%Y-%m-%d` --center=OpenSSL --release=$(VERSION) `basename $$i` > $(INSTALL_PREFIX)$(INSTALLTOP)/man/man3/`basename $$i .pod`.3); done + @for i in doc/crypto/*.pod doc/ssl/*.pod; do (cd `dirname $$i`; ../../util/pod2man.pl --section=3 --center=OpenSSL --release=$(VERSION) `basename $$i` > $(INSTALL_PREFIX)$(INSTALLTOP)/man/man3/`basename $$i .pod`.3); done # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/apps/openssl.c b/apps/openssl.c index 71f5ba7f67..17f9fe6ba7 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -164,7 +164,7 @@ int main(int Argc, char *Argv[]) program_name(Argv[0],pname,PROG_NAME_SIZE); f.name=pname; - fp=(FUNCTION *)lh_retrieve(prog,(char *)&f); + fp=(FUNCTION *)lh_retrieve(prog,&f); if (fp != NULL) { Argv[0]=pname; @@ -262,7 +262,7 @@ static int do_cmd(LHASH *prog, int argc, char *argv[]) if ((argc <= 0) || (argv[0] == NULL)) { ret=0; goto end; } f.name=argv[0]; - fp=(FUNCTION *)lh_retrieve(prog,(char *)&f); + fp=(FUNCTION *)lh_retrieve(prog,&f); if (fp != NULL) { ret=fp->func(argc,argv); @@ -361,7 +361,7 @@ static LHASH *prog_init(void) if ((ret=lh_new(hash,cmp)) == NULL) return(NULL); for (f=functions; f->name != NULL; f++) - lh_insert(ret,(char *)f); + lh_insert(ret,f); return(ret); } diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index 3f2ecee5c2..92efb0ba02 100644 --- a/crypto/asn1/a_type.c +++ b/crypto/asn1/a_type.c @@ -282,7 +282,7 @@ void ASN1_TYPE_free(ASN1_TYPE *a) { if (a == NULL) return; ASN1_TYPE_component_free(a); - Free((char *)(char *)a); + Free((char *)a); } int ASN1_TYPE_get(ASN1_TYPE *a) diff --git a/crypto/asn1/p7_lib.c b/crypto/asn1/p7_lib.c index d3e596dab3..638a04c966 100644 --- a/crypto/asn1/p7_lib.c +++ b/crypto/asn1/p7_lib.c @@ -251,7 +251,7 @@ void PKCS7_free(PKCS7 *a) { ASN1_OBJECT_free(a->type); } - Free((char *)(char *)a); + Free((char *)a); } void PKCS7_content_free(PKCS7 *a) diff --git a/crypto/asn1/x_pkey.c b/crypto/asn1/x_pkey.c index 0c81558dc4..b8c30b3cd5 100644 --- a/crypto/asn1/x_pkey.c +++ b/crypto/asn1/x_pkey.c @@ -147,5 +147,5 @@ void X509_PKEY_free(X509_PKEY *x) if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey); if ((x->key_data != NULL) && (x->key_free)) Free((char *)x->key_data); - Free((char *)(char *)x); + Free((char *)x); } diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c index a7cd828978..f5aeb237f5 100644 --- a/crypto/bio/b_dump.c +++ b/crypto/bio/b_dump.c @@ -92,7 +92,7 @@ int BIO_dump(BIO *bio, const char *s, int len) if (((i*DUMP_WIDTH)+j)>=len) { strcat(buf," "); } else { - ch=((unsigned char)*((char *)(s)+i*DUMP_WIDTH+j)) & 0xff; + ch=((unsigned char)*(s+i*DUMP_WIDTH+j)) & 0xff; sprintf(tmp,"%02x%c",ch,j==7?'-':' '); strcat(buf,tmp); } @@ -101,7 +101,7 @@ int BIO_dump(BIO *bio, const char *s, int len) for(j=0;j<DUMP_WIDTH;j++) { if (((i*DUMP_WIDTH)+j)>=len) break; - ch=((unsigned char)*((char *)(s)+i*DUMP_WIDTH+j)) & 0xff; + ch=((unsigned char)*(s+i*DUMP_WIDTH+j)) & 0xff; #ifndef CHARSET_EBCDIC sprintf(tmp,"%c",((ch>=' ')&&(ch<='~'))?ch:'.'); #else diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index dce0c0390b..a8610f2021 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -166,7 +166,11 @@ int BIO_get_port(const char *str, unsigned short *port_ptr) /* Note: under VMS with SOCKETSHR, it seems like the first * parameter is 'char *', instead of 'const char *' */ - s=getservbyname((char *)str,"tcp"); + s=getservbyname( +#ifndef CONST_STRICT + (char *) +#endif + str,"tcp"); if(s != NULL) *port_ptr=ntohs((unsigned short)s->s_port); CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME); @@ -374,7 +378,11 @@ struct hostent *BIO_gethostbyname(const char *name) /* Note: under VMS with SOCKETSHR, it seems like the first * parameter is 'char *', instead of 'const char *' */ - ret=gethostbyname((char *)name); + ret=gethostbyname( +#ifndef CONST_STRICT + (char *) +#endif + name); if (ret == NULL) goto end; diff --git a/crypto/cast/c_ecb.c b/crypto/cast/c_ecb.c index 33182f2b71..0b3da9ad87 100644 --- a/crypto/cast/c_ecb.c +++ b/crypto/cast/c_ecb.c @@ -60,7 +60,7 @@ #include "cast_lcl.h" #include <openssl/opensslv.h> -char *CAST_version="CAST" OPENSSL_VERSION_PTEXT; +const char *CAST_version="CAST" OPENSSL_VERSION_PTEXT; void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, CAST_KEY *ks, int enc) diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c index 13db218a29..3031fa3b44 100644 --- a/crypto/conf/conf.c +++ b/crypto/conf/conf.c @@ -336,7 +336,7 @@ again: ERR_R_MALLOC_FAILURE); goto err; } - vv=(CONF_VALUE *)lh_insert(ret,(char *)v); + vv=(CONF_VALUE *)lh_insert(ret,v); if (vv != NULL) { sk_CONF_VALUE_delete_ptr(ts,vv); @@ -378,7 +378,7 @@ char *CONF_get_string(LHASH *conf, char *section, char *name) { vv.name=name; vv.section=section; - v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv); + v=(CONF_VALUE *)lh_retrieve(conf,&vv); if (v != NULL) return(v->value); if (strcmp(section,"ENV") == 0) { @@ -388,7 +388,7 @@ char *CONF_get_string(LHASH *conf, char *section, char *name) } vv.section="default"; vv.name=name; - v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv); + v=(CONF_VALUE *)lh_retrieve(conf,&vv); if (v != NULL) return(v->value); else @@ -405,7 +405,7 @@ static CONF_VALUE *get_section(LHASH *conf, char *section) if ((conf == NULL) || (section == NULL)) return(NULL); vv.name=NULL; vv.section=section; - v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv); + v=(CONF_VALUE *)lh_retrieve(conf,&vv); return(v); } @@ -443,12 +443,12 @@ void CONF_free(LHASH *conf) conf->down_load=0; /* evil thing to make sure the 'Free()' * works as expected */ - lh_doall_arg(conf,(void (*)())value_free_hash,(char *)conf); + lh_doall_arg(conf,(void (*)())value_free_hash,conf); /* We now have only 'section' entries in the hash table. * Due to problems with */ - lh_doall_arg(conf,(void (*)())value_free_stack,(char *)conf); + lh_doall_arg(conf,(void (*)())value_free_stack,conf); lh_free(conf); } @@ -456,7 +456,7 @@ static void value_free_hash(CONF_VALUE *a, LHASH *conf) { if (a->name != NULL) { - a=(CONF_VALUE *)lh_delete(conf,(char *)a); + a=(CONF_VALUE *)lh_delete(conf,a); } } @@ -708,7 +708,7 @@ static CONF_VALUE *new_section(LHASH *conf, char *section) v->name=NULL; v->value=(char *)sk; - vv=(CONF_VALUE *)lh_insert(conf,(char *)v); + vv=(CONF_VALUE *)lh_insert(conf,v); if (vv != NULL) { #if !defined(NO_STDIO) && !defined(WIN16) diff --git a/crypto/crypto.h b/crypto/crypto.h index 6334eab238..f58ebc4a73 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -302,12 +302,12 @@ void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), v void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); void CRYPTO_get_mem_debug_functions(void (**m)(),void (**r)(),void (**f)(),void (**so)(),long (**go)()); -void *CRYPTO_malloc_locked(int num, char *file, int line); +void *CRYPTO_malloc_locked(int num, const char *file, int line); void CRYPTO_free_locked(void *); -void *CRYPTO_malloc(int num, char *file, int line); +void *CRYPTO_malloc(int num, const char *file, int line); void CRYPTO_free(void *); -void *CRYPTO_realloc(void *addr,int num, char *file, int line); -void *CRYPTO_remalloc(void *addr,int num, char *file, int line); +void *CRYPTO_realloc(void *addr,int num, const char *file, int line); +void *CRYPTO_remalloc(void *addr,int num, const char *file, int line); void CRYPTO_set_mem_debug_options(long bits); long CRYPTO_get_mem_debug_options(); diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c index 892f15e2d7..917ec725ea 100644 --- a/crypto/des/enc_writ.c +++ b/crypto/des/enc_writ.c @@ -135,7 +135,7 @@ int des_enc_write(int fd, const void *_buf, int len, } else { - cp=(unsigned char*)buf; + cp=buf; rnum=((len+7)/8*8); /* round up to nearest eight */ } diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c index 5522824952..c6abb87201 100644 --- a/crypto/des/str2key.c +++ b/crypto/des/str2key.c @@ -87,7 +87,7 @@ void des_string_to_key(const char *str, des_cblock *key) #endif des_set_odd_parity(key); des_set_key_unchecked(key,ks); - des_cbc_cksum((unsigned char*)str,key,length,ks,key); + des_cbc_cksum((const unsigned char*)str,key,length,ks,key); memset(ks,0,sizeof(ks)); des_set_odd_parity(key); } @@ -146,9 +146,9 @@ void des_string_to_2keys(const char *str, des_cblock *key1, des_cblock *key2) des_set_odd_parity(key1); des_set_odd_parity(key2); des_set_key_unchecked(key1,ks); - des_cbc_cksum((unsigned char*)str,key1,length,ks,key1); + des_cbc_cksum((const unsigned char*)str,key1,length,ks,key1); des_set_key_unchecked(key2,ks); - des_cbc_cksum((unsigned char*)str,key2,length,ks,key2); + des_cbc_cksum((const unsigned char*)str,key2,length,ks,key2); memset(ks,0,sizeof(ks)); des_set_odd_parity(key1); des_set_odd_parity(key2); diff --git a/crypto/err/err.c b/crypto/err/err.c index 8baa53c40d..9b4eb612ed 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -222,7 +222,7 @@ void ERR_load_strings(int lib, ERR_STRING_DATA *str) while (str->error) { str->error|=ERR_PACK(lib,0,0); - lh_insert(error_hash,(char *)str); + lh_insert(error_hash,str); str++; } CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH); @@ -428,7 +428,7 @@ const char *ERR_lib_error_string(unsigned long e) if (error_hash != NULL) { d.error=ERR_PACK(l,0,0); - p=(ERR_STRING_DATA *)lh_retrieve(error_hash,(char *)&d); + p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); } CRYPTO_r_unlock(CRYPTO_LOCK_ERR_HASH); @@ -449,7 +449,7 @@ const char *ERR_func_error_string(unsigned long e) if (error_hash != NULL) { d.error=ERR_PACK(l,f,0); - p=(ERR_STRING_DATA *)lh_retrieve(error_hash,(char *)&d); + p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); } CRYPTO_r_unlock(CRYPTO_LOCK_ERR_HASH); @@ -470,12 +470,11 @@ const char *ERR_reason_error_string(unsigned long e) if (error_hash != NULL) { d.error=ERR_PACK(l,0,r); - p=(ERR_STRING_DATA *)lh_retrieve(error_hash,(char *)&d); + p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); if (p == NULL) { d.error=ERR_PACK(0,0,r); - p=(ERR_STRING_DATA *)lh_retrieve(error_hash, - (char *)&d); + p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); } } @@ -518,7 +517,7 @@ void ERR_remove_state(unsigned long pid) pid=(unsigned long)CRYPTO_thread_id(); tmp.pid=pid; CRYPTO_w_lock(CRYPTO_LOCK_ERR); - p=(ERR_STATE *)lh_delete(thread_hash,(char *)&tmp); + p=(ERR_STATE *)lh_delete(thread_hash,&tmp); CRYPTO_w_unlock(CRYPTO_LOCK_ERR); if (p != NULL) ERR_STATE_free(p); @@ -552,7 +551,7 @@ ERR_STATE *ERR_get_state(void) else { tmp.pid=pid; - ret=(ERR_STATE *)lh_retrieve(thread_hash,(char *)&tmp); + ret=(ERR_STATE *)lh_retrieve(thread_hash,&tmp); CRYPTO_r_unlock(CRYPTO_LOCK_ERR); } @@ -570,7 +569,7 @@ ERR_STATE *ERR_get_state(void) ret->err_data_flags[i]=0; } CRYPTO_w_lock(CRYPTO_LOCK_ERR); - tmpp=(ERR_STATE *)lh_insert(thread_hash,(char *)ret); + tmpp=(ERR_STATE *)lh_insert(thread_hash,ret); CRYPTO_w_unlock(CRYPTO_LOCK_ERR); if (tmpp != NULL) /* old entry - should not happen */ { diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c index a54384a71c..16f6e60ad8 100644 --- a/crypto/evp/bio_ok.c +++ b/crypto/evp/bio_ok.c @@ -456,7 +456,7 @@ static void sig_out(BIO* b) longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); ctx->buf_len+= md->digest->md_size; - EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN)); + EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); md->digest->final(&(ctx->buf[ctx->buf_len]), &(md->md.base[0])); ctx->buf_len+= md->digest->md_size; ctx->blockout= 1; @@ -480,7 +480,7 @@ static void sig_in(BIO* b) longswap(&(md->md.base[0]), md->digest->md_size); ctx->buf_off+= md->digest->md_size; - EVP_DigestUpdate(md, (unsigned char*)WELLKNOWN, strlen(WELLKNOWN)); + EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); md->digest->final(tmp, &(md->md.base[0])); ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; ctx->buf_off+= md->digest->md_size; diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index 801322beb6..4d025d7ee7 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -107,12 +107,9 @@ const char *lh_version="lhash" OPENSSL_VERSION_PTEXT; #define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */ #define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */ - -#define P_CP char * -#define P_CPP char *,char * static void expand(LHASH *lh); static void contract(LHASH *lh); -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash); +static LHASH_NODE **getrn(LHASH *lh, void *data, unsigned long *rhash); LHASH *lh_new(unsigned long (*h)(), int (*c)()) { @@ -179,11 +176,11 @@ void lh_free(LHASH *lh) Free((char *)lh); } -char *lh_insert(LHASH *lh, char *data) +void *lh_insert(LHASH *lh, void *data) { unsigned long hash; LHASH_NODE *nn,**rn; - char *ret; + void *ret; lh->error=0; if (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)) @@ -217,11 +214,11 @@ char *lh_insert(LHASH *lh, char *data) return(ret); } -char *lh_delete(LHASH *lh, char *data) +void *lh_delete(LHASH *lh, void *data) { unsigned long hash; LHASH_NODE *nn,**rn; - char *ret; + void *ret; lh->error=0; rn=getrn(lh,data,&hash); @@ -248,11 +245,11 @@ char *lh_delete(LHASH *lh, char *data) return(ret); } -char *lh_retrieve(LHASH *lh, char *data) +void *lh_retrieve(LHASH *lh, void *data) { unsigned long hash; LHASH_NODE **rn; - char *ret; + void *ret; lh->error=0; rn=getrn(lh,data,&hash); @@ -275,7 +272,7 @@ void lh_doall(LHASH *lh, void (*func)()) lh_doall_arg(lh,func,NULL); } -void lh_doall_arg(LHASH *lh, void (*func)(), char *arg) +void lh_doall_arg(LHASH *lh, void (*func)(), void *arg) { int i; LHASH_NODE *a,*n; @@ -332,7 +329,7 @@ static void expand(LHASH *lh) if ((lh->p) >= lh->pmax) { j=(int)lh->num_alloc_nodes*2; - n=(LHASH_NODE **)Realloc((char *)lh->b, + n=(LHASH_NODE **)Realloc(lh->b, (unsigned int)sizeof(LHASH_NODE *)*j); if (n == NULL) { @@ -360,7 +357,7 @@ static void contract(LHASH *lh) lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ if (lh->p == 0) { - n=(LHASH_NODE **)Realloc((char *)lh->b, + n=(LHASH_NODE **)Realloc(lh->b, (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); if (n == NULL) { @@ -391,7 +388,7 @@ static void contract(LHASH *lh) } } -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) +static LHASH_NODE **getrn(LHASH *lh, void *data, unsigned long *rhash) { LHASH_NODE **ret,*n1; unsigned long hash,nn; @@ -426,8 +423,7 @@ static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) } /* -static unsigned long lh_strhash(str) -char *str; +unsigned long lh_strhash(char *str) { int i,l; unsigned long ret=0; diff --git a/crypto/lhash/lhash.h b/crypto/lhash/lhash.h index 6e5a1fe708..6f6eeb2698 100644 --- a/crypto/lhash/lhash.h +++ b/crypto/lhash/lhash.h @@ -73,7 +73,7 @@ extern "C" { typedef struct lhash_node_st { - char *data; + void *data; struct lhash_node_st *next; #ifndef NO_HASH_COMP unsigned long hash; @@ -116,13 +116,13 @@ typedef struct lhash_st * in lh_insert(). */ #define lh_error(lh) ((lh)->error) -LHASH *lh_new(unsigned long (*h)(), int (*c)()); +LHASH *lh_new(unsigned long (*h)(/* void *a */), int (*c)(/* void *a,void *b */)); void lh_free(LHASH *lh); -char *lh_insert(LHASH *lh, char *data); -char *lh_delete(LHASH *lh, char *data); -char *lh_retrieve(LHASH *lh, char *data); -void lh_doall(LHASH *lh, void (*func)(/* char *b */)); -void lh_doall_arg(LHASH *lh, void (*func)(/*char *a,char *b*/),char *arg); +void *lh_insert(LHASH *lh, void *data); +void *lh_delete(LHASH *lh, void *data); +void *lh_retrieve(LHASH *lh, void *data); + void lh_doall(LHASH *lh, void (*func)(/*void *b*/)); +void lh_doall_arg(LHASH *lh, void (*func)(/*void *a,void *b*/),void *arg); unsigned long lh_strhash(const char *c); #ifndef NO_FP_API diff --git a/crypto/md5/md5_dgst.c b/crypto/md5/md5_dgst.c index ba0115ae79..9ff9f938cc 100644 --- a/crypto/md5/md5_dgst.c +++ b/crypto/md5/md5_dgst.c @@ -60,7 +60,7 @@ #include "md5_locl.h" #include <openssl/opensslv.h> -char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; +const char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; /* Implemented from RFC1321 The MD5 Message-Digest Algorithm */ diff --git a/crypto/mem.c b/crypto/mem.c index 67f8d12cc0..dac3d2685c 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -159,7 +159,7 @@ void CRYPTO_get_mem_debug_functions(void (**m)(), void (**r)(), void (**f)(),voi } -void *CRYPTO_malloc_locked(int num, char *file, int line) +void *CRYPTO_malloc_locked(int num, const char *file, int line) { char *ret = NULL; @@ -191,7 +191,7 @@ void CRYPTO_free_locked(void *str) free_debug_func(NULL, 1); } -void *CRYPTO_malloc(int num, char *file, int line) +void *CRYPTO_malloc(int num, const char *file, int line) { char *ret = NULL; @@ -211,7 +211,7 @@ void *CRYPTO_malloc(int num, char *file, int line) return ret; } -void *CRYPTO_realloc(void *str, int num, char *file, int line) +void *CRYPTO_realloc(void *str, int num, const char *file, int line) { char *ret = NULL; @@ -239,7 +239,7 @@ void CRYPTO_free(void *str) free_debug_func(NULL, 1); } -void *CRYPTO_remalloc(void *a, int num, char *file, int line) +void *CRYPTO_remalloc(void *a, int num, const char *file, int line) { if (a != NULL) Free(a); a=(char *)Malloc(num); diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index f3ad5ff235..ad5297bc01 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -257,7 +257,7 @@ static APP_INFO *pop_info() if (amih != NULL) { tmp.thread=CRYPTO_thread_id(); - if ((ret=(APP_INFO *)lh_delete(amih,(char *)&tmp)) != NULL) + if ((ret=(APP_INFO *)lh_delete(amih,&tmp)) != NULL) { APP_INFO *next=ret->next; diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index e8aa7dace1..3086b15161 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -132,7 +132,7 @@ const char *OBJ_NAME_get(const char *name, int type) for (;;) { - ret=(OBJ_NAME *)lh_retrieve(names_lh,(char *)&on); + ret=(OBJ_NAME *)lh_retrieve(names_lh,&on); if (ret == NULL) return(NULL); if ((ret->alias) && !alias) { @@ -168,7 +168,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data) onp->type=type; onp->data=data; - ret=(OBJ_NAME *)lh_insert(names_lh,(char *)onp); + ret=(OBJ_NAME *)lh_insert(names_lh,onp); if (ret != NULL) { /* free things */ @@ -203,7 +203,7 @@ int OBJ_NAME_remove(const char *name, int type) type&= ~OBJ_NAME_ALIAS; on.name=name; on.type=type; - ret=(OBJ_NAME *)lh_delete(names_lh,(char *)&on); + ret=(OBJ_NAME *)lh_delete(names_lh,&on); if (ret != NULL) { /* free things */ diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index aa5c50e5cc..6eeb530802 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -234,7 +234,7 @@ int OBJ_add_object(ASN1_OBJECT *obj) { ao[i]->type=i; ao[i]->obj=o; - aop=(ADDED_OBJ *)lh_insert(added,(char *)ao[i]); + aop=(ADDED_OBJ *)lh_insert(added,ao[i]); /* memory leak, buit should not normally matter */ if (aop != NULL) Free(aop); @@ -272,7 +272,7 @@ ASN1_OBJECT *OBJ_nid2obj(int n) ad.type=ADDED_NID; ad.obj= &ob; ob.nid=n; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return(adp->obj); else @@ -304,7 +304,7 @@ const char *OBJ_nid2sn(int n) ad.type=ADDED_NID; ad.obj= &ob; ob.nid=n; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return(adp->obj->sn); else @@ -336,7 +336,7 @@ const char *OBJ_nid2ln(int n) ad.type=ADDED_NID; ad.obj= &ob; ob.nid=n; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return(adp->obj->ln); else @@ -361,7 +361,7 @@ int OBJ_obj2nid(ASN1_OBJECT *a) { ad.type=ADDED_DATA; ad.obj=a; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return (adp->obj->nid); } op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, @@ -500,7 +500,7 @@ int OBJ_ln2nid(const char *s) { ad.type=ADDED_LNAME; ad.obj= &o; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return (adp->obj->nid); } op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, @@ -519,7 +519,7 @@ int OBJ_sn2nid(const char *s) { ad.type=ADDED_SNAME; ad.obj= &o; - adp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad); + adp=(ADDED_OBJ *)lh_retrieve(added,&ad); if (adp != NULL) return (adp->obj->nid); } op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)sn_objs,NUM_SN, diff --git a/crypto/rand/rand.h b/crypto/rand/rand.h index 5ab94a779b..b5d2166b06 100644 --- a/crypto/rand/rand.h +++ b/crypto/rand/rand.h @@ -82,7 +82,7 @@ void RAND_seed(const void *buf,int num); void RAND_add(const void *buf,int num,int entropy); 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); +const char *RAND_file_name(char *file,int num); #ifdef WINDOWS void RAND_screen(void); #endif diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index cea9f54e73..7ff06adccc 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -184,7 +184,7 @@ err: return(err ? -1 : ret); } -char *RAND_file_name(char *buf, int size) +const char *RAND_file_name(char *buf, int size) { char *s; char *ret=NULL; diff --git a/crypto/ripemd/rmd_dgst.c b/crypto/ripemd/rmd_dgst.c index f3a5017199..be3eb2204a 100644 --- a/crypto/ripemd/rmd_dgst.c +++ b/crypto/ripemd/rmd_dgst.c @@ -60,7 +60,7 @@ #include "rmd_locl.h" #include <openssl/opensslv.h>< |