diff options
author | Ulf Möller <ulf@openssl.org> | 2000-01-30 23:33:40 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-01-30 23:33:40 +0000 |
commit | 51ca375e7e640c6f1441d74abcda731ef7306d0c (patch) | |
tree | 8b661d70f98b8d819edea5f777117ec7be03fab7 /crypto | |
parent | 1749d8a039e637a6ab06f30cd0351605b44dc625 (diff) |
Seek out and destroy another evil cast.
Diffstat (limited to 'crypto')
67 files changed, 105 insertions, 97 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index b36d62079a..c77456b315 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -173,7 +173,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, s=NULL; ret->length=(int)len; - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->data=s; ret->type=V_ASN1_BIT_STRING; if (a != NULL) (*a)=ret; diff --git a/crypto/asn1/a_bytes.c b/crypto/asn1/a_bytes.c index c894f5664c..47a88aa952 100644 --- a/crypto/asn1/a_bytes.c +++ b/crypto/asn1/a_bytes.c @@ -124,7 +124,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp, else s=NULL; - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->length=(int)len; ret->data=s; ret->type=tag; @@ -218,7 +218,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length, { if ((ret->length < len) || (ret->data == NULL)) { - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); s=(unsigned char *)Malloc((int)len + 1); if (s == NULL) { @@ -235,7 +235,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length, else { s=NULL; - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); } ret->length=(int)len; diff --git a/crypto/asn1/a_dup.c b/crypto/asn1/a_dup.c index c0a8709f3b..3202a816d0 100644 --- a/crypto/asn1/a_dup.c +++ b/crypto/asn1/a_dup.c @@ -78,6 +78,6 @@ char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) i=i2d(x,&p); p= b; ret=d2i(NULL,&p,i); - Free((char *)b); + Free(b); return(ret); } diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index 56ee787a23..ccf62e5a04 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -219,7 +219,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp, p+=len; } - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->data=s; ret->length=(int)len; if (a != NULL) (*a)=ret; @@ -242,7 +242,7 @@ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) if (a->length < (sizeof(long)+1)) { if (a->data != NULL) - Free((char *)a->data); + Free(a->data); if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL) memset((char *)a->data,0,sizeof(long)+1); } diff --git a/crypto/asn1/a_hdr.c b/crypto/asn1/a_hdr.c index 8dc58ed6d2..434610e8e1 100644 --- a/crypto/asn1/a_hdr.c +++ b/crypto/asn1/a_hdr.c @@ -115,5 +115,5 @@ void ASN1_HEADER_free(ASN1_HEADER *a) M_ASN1_OCTET_STRING_free(a->header); if (a->meth != NULL) a->meth->destroy(a->data); - Free((char *)a); + Free(a); } diff --git a/crypto/asn1/a_i2d_fp.c b/crypto/asn1/a_i2d_fp.c index 6bd845443c..d9b8035e17 100644 --- a/crypto/asn1/a_i2d_fp.c +++ b/crypto/asn1/a_i2d_fp.c @@ -108,6 +108,6 @@ int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x) j+=i; n-=i; } - Free((char *)b); + Free(b); return(ret); } diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index bcbdc7d4e1..8b6794e8c1 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -248,7 +248,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, memcpy(s,p,(int)len); } - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->data=s; ret->length=(int)len; if (a != NULL) (*a)=ret; @@ -317,7 +317,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp, p+=len; } - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->data=s; ret->length=(int)len; if (a != NULL) (*a)=ret; @@ -340,7 +340,7 @@ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) if (a->length < (sizeof(long)+1)) { if (a->data != NULL) - Free((char *)a->data); + Free(a->data); if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL) memset((char *)a->data,0,sizeof(long)+1); } diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index ab69b955b5..4812724a15 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -222,7 +222,7 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, } if ((ret->data == NULL) || (ret->length < len)) { - if (ret->data != NULL) Free((char *)ret->data); + if (ret->data != NULL) Free(ret->data); ret->data=(unsigned char *)Malloc(len ? (int)len : 1); ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; if (ret->data == NULL) diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c index eed7faaccb..e9c41e3d20 100644 --- a/crypto/asn1/a_sign.c +++ b/crypto/asn1/a_sign.c @@ -129,7 +129,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); goto err; } - if (signature->data != NULL) Free((char *)signature->data); + if (signature->data != NULL) Free(signature->data); signature->data=buf_out; buf_out=NULL; signature->length=outl; @@ -141,8 +141,8 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, err: memset(&ctx,0,sizeof(ctx)); if (buf_in != NULL) - { memset((char *)buf_in,0,(unsigned int)inl); Free((char *)buf_in); } + { memset((char *)buf_in,0,(unsigned int)inl); Free(buf_in); } if (buf_out != NULL) - { memset((char *)buf_out,0,outll); Free((char *)buf_out); } + { memset((char *)buf_out,0,outll); Free(buf_out); } return(outl); } diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index 92efb0ba02..161ef81197 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 *)a); + Free(a); } int ASN1_TYPE_get(ASN1_TYPE *a) diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c index 2f4892f669..d4aede85c3 100644 --- a/crypto/asn1/a_verify.c +++ b/crypto/asn1/a_verify.c @@ -101,7 +101,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); memset(buf_in,0,(unsigned int)inl); - Free((char *)buf_in); + Free(buf_in); if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, (unsigned int)signature->length,pkey) <= 0) diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index ddb7869958..65eaa96c14 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -381,8 +381,8 @@ ASN1_STRING *ASN1_STRING_type_new(int type) void ASN1_STRING_free(ASN1_STRING *a) { if (a == NULL) return; - if (a->data != NULL) Free((char *)a->data); - Free((char *)a); + if (a->data != NULL) Free(a->data); + Free(a); } int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b) diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c index 3bcceecdb8..3d0b1107cb 100644 --- a/crypto/asn1/f_enum.c +++ b/crypto/asn1/f_enum.c @@ -161,7 +161,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE); - if (s != NULL) Free((char *)s); + if (s != NULL) Free(s); goto err; } s=sp; diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c index 55560dd814..cd57331c3f 100644 --- a/crypto/asn1/f_int.c +++ b/crypto/asn1/f_int.c @@ -168,7 +168,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER,ERR_R_MALLOC_FAILURE); - if (s != NULL) Free((char *)s); + if (s != NULL) Free(s); goto err; } s=sp; diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index 5d0cf5a46d..088313689a 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -166,7 +166,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING,ERR_R_MALLOC_FAILURE); - if (s != NULL) Free((char *)s); + if (s != NULL) Free(s); goto err; } s=sp; diff --git a/crypto/asn1/i2d_dhp.c b/crypto/asn1/i2d_dhp.c index fdda4ec41b..61eeb646f9 100644 --- a/crypto/asn1/i2d_dhp.c +++ b/crypto/asn1/i2d_dhp.c @@ -118,7 +118,7 @@ int i2d_DHparams(DH *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); ret=t; err: if (num[2] != NULL) BN_free(num[2]); diff --git a/crypto/asn1/i2d_dsap.c b/crypto/asn1/i2d_dsap.c index f36f0da4e2..4021123ba3 100644 --- a/crypto/asn1/i2d_dsap.c +++ b/crypto/asn1/i2d_dsap.c @@ -107,7 +107,7 @@ int i2d_DSAparams(DSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); ret=t; err: *pp=p; diff --git a/crypto/asn1/i2d_r_pr.c b/crypto/asn1/i2d_r_pr.c index cf5fd9e94e..1250fa4b2d 100644 --- a/crypto/asn1/i2d_r_pr.c +++ b/crypto/asn1/i2d_r_pr.c @@ -119,7 +119,7 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); *pp=p; return(t); } diff --git a/crypto/asn1/i2d_r_pu.c b/crypto/asn1/i2d_r_pu.c index 142392f1ae..582b92ee4c 100644 --- a/crypto/asn1/i2d_r_pu.c +++ b/crypto/asn1/i2d_r_pu.c @@ -105,7 +105,7 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); *pp=p; return(t); } diff --git a/crypto/asn1/i2d_s_pr.c b/crypto/asn1/i2d_s_pr.c index 5d3dcdf197..e399ceaeb9 100644 --- a/crypto/asn1/i2d_s_pr.c +++ b/crypto/asn1/i2d_s_pr.c @@ -116,7 +116,7 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); *pp=p; return(t); } diff --git a/crypto/asn1/i2d_s_pu.c b/crypto/asn1/i2d_s_pu.c index 18f790f746..ca7f251b71 100644 --- a/crypto/asn1/i2d_s_pu.c +++ b/crypto/asn1/i2d_s_pu.c @@ -121,7 +121,7 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + Free(bs.data); *pp=p; if(all) return(t); else return(tot); diff --git a/crypto/asn1/n_pkey.c b/crypto/asn1/n_pkey.c index 7e3d666f6e..d804986b73 100644 --- a/crypto/asn1/n_pkey.c +++ b/crypto/asn1/n_pkey.c @@ -139,7 +139,7 @@ int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) } if (pkey->private_key->data != NULL) - Free((char *)pkey->private_key->data); + Free(pkey->private_key->data); if ((pkey->private_key->data=(unsigned char *)Malloc(l[0])) == NULL) { ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); @@ -334,7 +334,7 @@ static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a) M_ASN1_INTEGER_free(a->version); X509_ALGOR_free(a->algor); M_ASN1_OCTET_STRING_free(a->private_key); - Free((char *)a); + Free(a); } #endif /* NO_RC4 */ diff --git a/crypto/asn1/p5_pbe.c b/crypto/asn1/p5_pbe.c index 8cda4f609a..64e90237cc 100644 --- a/crypto/asn1/p5_pbe.c +++ b/crypto/asn1/p5_pbe.c @@ -103,7 +103,7 @@ void PBEPARAM_free (PBEPARAM *a) if(a==NULL) return; M_ASN1_OCTET_STRING_free(a->salt); M_ASN1_INTEGER_free (a->iter); - Free ((char *)a); + Free (a); } /* Return an algorithm identifier for a PKCS#5 PBE algorithm */ diff --git a/crypto/asn1/p5_pbev2.c b/crypto/asn1/p5_pbev2.c index 44d5b5bc6e..2f6a4c4518 100644 --- a/crypto/asn1/p5_pbev2.c +++ b/crypto/asn1/p5_pbev2.c @@ -104,7 +104,7 @@ void PBE2PARAM_free (PBE2PARAM *a) if(a==NULL) return; X509_ALGOR_free(a->keyfunc); X509_ALGOR_free(a->encryption); - Free ((char *)a); + Free (a); } int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp) @@ -158,7 +158,7 @@ void PBKDF2PARAM_free (PBKDF2PARAM *a) M_ASN1_INTEGER_free(a->iter); M_ASN1_INTEGER_free(a->keylength); X509_ALGOR_free(a->prf); - Free ((char *)a); + Free (a); } /* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm: diff --git a/crypto/asn1/p7_dgst.c b/crypto/asn1/p7_dgst.c index 84e4d557be..cba90e94a1 100644 --- a/crypto/asn1/p7_dgst.c +++ b/crypto/asn1/p7_dgst.c @@ -116,6 +116,6 @@ void PKCS7_DIGEST_free(PKCS7_DIGEST *a) X509_ALGOR_free(a->md); PKCS7_free(a->contents); M_ASN1_OCTET_STRING_free(a->digest); - Free((char *)a); + Free(a); } diff --git a/crypto/asn1/p7_enc.c b/crypto/asn1/p7_enc.c index 8c19b2dc0d..83b0e15faa 100644 --- a/crypto/asn1/p7_enc.c +++ b/crypto/asn1/p7_enc.c @@ -106,6 +106,6 @@ void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a) if (a == NULL) return; M_ASN1_INTEGER_free(a->version); PKCS7_ENC_CONTENT_free(a->enc_data); - Free((char *)a); + Free(a); } diff --git a/crypto/asn1/p7_enc_c.c b/crypto/asn1/p7_enc_c.c index 180a11dc94..582cc78b06 100644 --- a/crypto/asn1/p7_enc_c.c +++ b/crypto/asn1/p7_enc_c.c @@ -115,6 +115,6 @@ void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a) ASN1_OBJECT_free(a->content_type); X509_ALGOR_free(a->algorithm); M_ASN1_OCTET_STRING_free(a->enc_data); - Free((char *)a); + Free(a); } diff --git a/crypto/asn1/p7_evp.c b/crypto/asn1/p7_evp.c index bf45f44029..4e734fdd28 100644 --- a/crypto/asn1/p7_evp.c +++ b/crypto/asn1/p7_evp.c @@ -114,6 +114,6 @@ void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a) M_ASN1_INTEGER_free(a->version); sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free); PKCS7_ENC_CONTENT_free(a->enc_data); - Free((char *)a); + Free(a); } diff --git a/crypto/asn1/p7_i_s.c b/crypto/asn1/p7_i_s.c |