Seek out and destroy another evil cast.
authorUlf Möller <ulf@openssl.org>
Sun, 30 Jan 2000 23:33:40 +0000 (23:33 +0000)
committerUlf Möller <ulf@openssl.org>
Sun, 30 Jan 2000 23:33:40 +0000 (23:33 +0000)
69 files changed:
apps/s_server.c
crypto/asn1/a_bitstr.c
crypto/asn1/a_bytes.c
crypto/asn1/a_dup.c
crypto/asn1/a_enum.c
crypto/asn1/a_hdr.c
crypto/asn1/a_i2d_fp.c
crypto/asn1/a_int.c
crypto/asn1/a_object.c
crypto/asn1/a_sign.c
crypto/asn1/a_type.c
crypto/asn1/a_verify.c
crypto/asn1/asn1_lib.c
crypto/asn1/f_enum.c
crypto/asn1/f_int.c
crypto/asn1/f_string.c
crypto/asn1/i2d_dhp.c
crypto/asn1/i2d_dsap.c
crypto/asn1/i2d_r_pr.c
crypto/asn1/i2d_r_pu.c
crypto/asn1/i2d_s_pr.c
crypto/asn1/i2d_s_pu.c
crypto/asn1/n_pkey.c
crypto/asn1/p5_pbe.c
crypto/asn1/p5_pbev2.c
crypto/asn1/p7_dgst.c
crypto/asn1/p7_enc.c
crypto/asn1/p7_enc_c.c
crypto/asn1/p7_evp.c
crypto/asn1/p7_i_s.c
crypto/asn1/p7_lib.c
crypto/asn1/p7_signi.c
crypto/asn1/p8_key.c
crypto/asn1/t_pkey.c
crypto/asn1/t_x509.c
crypto/asn1/x_algor.c
crypto/asn1/x_attrib.c
crypto/asn1/x_exten.c
crypto/asn1/x_info.c
crypto/asn1/x_pkey.c
crypto/asn1/x_pubkey.c
crypto/asn1/x_req.c
crypto/asn1/x_sig.c
crypto/asn1/x_spki.c
crypto/asn1/x_val.c
crypto/asn1/x_x509.c
crypto/asn1/x_x509a.c
crypto/bio/b_sock.c
crypto/bn/bn_prime.c
crypto/evp/p_lib.c
crypto/lhash/lhash.c
crypto/objects/o_names.c
crypto/objects/obj_dat.c
crypto/pkcs12/p12_bags.c
crypto/pkcs12/p12_lib.c
crypto/pkcs12/p12_mac.c
crypto/pkcs7/pk7_mime.c
crypto/rsa/rsa_test.c
crypto/stack/stack.c
crypto/txt_db/txt_db.c
crypto/x509/by_dir.c
crypto/x509v3/v3_akey.c
crypto/x509v3/v3_bcons.c
crypto/x509v3/v3_crld.c
crypto/x509v3/v3_genn.c
crypto/x509v3/v3_info.c
crypto/x509v3/v3_pku.c
crypto/x509v3/v3_utl.c
ssl/ssl_lib.c

index bbb651b6eaa8d370ec787caaeb26d61b175fd9f0..ac86a8ab4dd31b97f6b909c86763bbd98ef4f7ec 100644 (file)
@@ -336,7 +336,7 @@ static int ebcdic_write(BIO *b, char *in, int inl)
                num = num + num;  /* double the size */
                if (num < inl)
                        num = inl;
-               Free((char*)wbuf);
+               Free(wbuf);
                wbuf=(EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + num);
 
                wbuf->alloced = num;
index b36d62079a968c5295e950f9a3c8a0bfdf8d6249..c77456b315b5f1cf886626e03146b1e80e83bec4 100644 (file)
@@ -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;
index c894f5664ce59c6098486186f74c8f11d9f34112..47a88aa952c363b6b695ba55802f15f32427a770 100644 (file)
@@ -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;
index c0a8709f3b4526d10c3b305b7cd750d5a6b7fb0f..3202a816d0adae53b3ebd774a3892a352d48d346 100644 (file)
@@ -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);
        }
index 56ee787a23e0cdbe8fcca1c0e338e3ef3aeb5ecc..ccf62e5a044011e95c6f04be609f6b2517d0ae11 100644 (file)
@@ -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);
                }
index 8dc58ed6d217420437b0a27cbbc1028ced194d1f..434610e8e124cef02ba80f69833405299fe14160 100644 (file)
@@ -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);
        }
index 6bd845443cc02bab3b12b40f154aedc2e73e8943..d9b8035e172c38908c76bece9579db0e2e44ca1a 100644 (file)
@@ -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);
        }
index bcbdc7d4e128cbd995bb1a93c3ca9480b92e221c..8b6794e8c11f5fdea41efafd3923bcea791cf0e7 100644 (file)
@@ -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);
                }
index ab69b955b51f315c924423ac5b1f22dcbd18819d..4812724a1541564976e31487a19b3687a2dc34f2 100644 (file)
@@ -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)
index eed7faaccb12850ff8d9c1a1c94363e97338494d..e9c41e3d2087b764c82daff43910b012d89df9aa 100644 (file)
@@ -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);
        }
index 92efb0ba0265c8029ad3a32ddd1fd1e8a1c1962e..161ef8119737446f4a6cea8d3e4b9a18ffe27eac 100644 (file)
@@ -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)
index 2f4892f669171e1cf452b7b12e1bf78078e703b0..d4aede85c37e11c6a467e21d883a9ca8349bad74 100644 (file)
@@ -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)
index ddb7869958d4d086058ca015984a774c363b9d34..65eaa96c144de706368515d00dd373fe7de8bef5 100644 (file)
@@ -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)
index 3bcceecdb8506a674dd9e67b5216d53f82694c22..3d0b1107cba6b5dc0b3ce19205ec11981e5319a0 100644 (file)
@@ -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;
index 55560dd814ade9dec8fd21e26e3d3cc710f55241..cd57331c3f0a57063f817c687681cc589cef50ac 100644 (file)
@@ -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;
index 5d0cf5a46d4d101755e3a820964d1d28c5a7819c..088313689ab255ae9540874776b0ffa6293fd105 100644 (file)
@@ -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;
index fdda4ec41bcc2270e5eb122847087db3784f8f43..61eeb646f9e2eb59a893a8b280febf9591d5a975 100644 (file)
@@ -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]);
index f36f0da4e2e770978dedbb8dc5581e4667c92006..4021123ba3f34cf3f7cad3f0ee8293740c9622ae 100644 (file)
@@ -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;
index cf5fd9e94e6dd1a4df0713a680832625a302a0bd..1250fa4b2dd83750a11069f88505e7a72aa17dd4 100644 (file)
@@ -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);
        }
index 142392f1ae4057afa6096c8d82440b7621b04def..582b92ee4c19711f7de6df308d71cd145d47f311 100644 (file)
@@ -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);
        }
index 5d3dcdf1979a4d0d263586d99863a59a1abc5756..e399ceaeb91d4b852f1fe691ad067b7ce53a472e 100644 (file)
@@ -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);
        }
index 18f790f746515e9ec3f55cfacbd9df52cf6e7e44..ca7f251b719ec86dcd0ed4ed37f02b46d6200dd0 100644 (file)
@@ -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);
index 7e3d666f6e574daceb36fbdc0076a9b38c942012..d804986b73bf6b9e65c6545871f15968a5839f39 100644 (file)
@@ -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 */
index 8cda4f609a5762717b625834834e2dcf74716845..64e90237cc1e2757a16769d58227f7d1bb0fb6fa 100644 (file)
@@ -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 */
index 44d5b5bc6eca621481ee97c02b7951ee35f143ed..2f6a4c4518ed75068a3c3c3698f2b4a9ddb5ee6d 100644 (file)
@@ -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:
index 84e4d557be14b48ae4582463283f66ef2f4257da..cba90e94a1e0e5313062f679aa8452bc8a90c6b1 100644 (file)
@@ -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);
        }
 
index 8c19b2dc0d77508171778480640abd7bffde2c73..83b0e15faa7e9edfee8b38a287ed118f7cc8bd15 100644 (file)
@@ -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);
        }
 
index 180a11dc9473fa2f8b3182d9e7fae1443e781668..582cc78b069dcdea568944694bfd5588439686ec 100644 (file)
@@ -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);
        }
 
index bf45f44029612ecce628e4aaba0c2884b40e5546..4e734fdd289e7c97bbd62e72b96f9c27a0987caa 100644 (file)
@@ -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);
        }
 
index 46fc0821b4d2e2e47dcf62595d8a4f52c9309f28..d21f7ddb846a40ae62ef1943845d42eefcc8db96 100644 (file)
@@ -106,6 +106,6 @@ void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a)
        if (a == NULL) return;
        X509_NAME_free(a->issuer);
        M_ASN1_INTEGER_free(a->serial);
-       Free((char *)a);
+       Free(a);
        }
 
index 638a04c966b96d48612950dc061c815898a21b77..86db82cfa1d7141d6272f0af5eb0134864df62a3 100644 (file)
@@ -152,7 +152,7 @@ PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
                {
                if ((*a)->asn1 != NULL)
                        {
-                       Free((char *)(*a)->asn1);
+                       Free((*a)->asn1);
                        (*a)->asn1=NULL;
                        }
                (*a)->length=0;
@@ -251,7 +251,7 @@ void PKCS7_free(PKCS7 *a)
                {
                ASN1_OBJECT_free(a->type);
                }
-       Free((char *)a);
+       Free(a);
        }
 
 void PKCS7_content_free(PKCS7 *a)
@@ -259,7 +259,7 @@ void PKCS7_content_free(PKCS7 *a)
        if(a == NULL)
            return;
 
-       if (a->asn1 != NULL) Free((char *)a->asn1);
+       if (a->asn1 != NULL) Free(a->asn1);
 
        if (a->d.ptr != NULL)
                {
index acc38fc3bf0a91d18ead3ba16ede1dbfe99bf2bd..f74658ffe68907cbd7332dd59536af71ab2154b8 100644 (file)
@@ -143,7 +143,7 @@ void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a)
        sk_X509_ATTRIBUTE_pop_free(a->unauth_attr,X509_ATTRIBUTE_free);
        if (a->pkey != NULL)
                EVP_PKEY_free(a->pkey);
-       Free((char *)a);
+       Free(a);
        }
 
 IMPLEMENT_STACK_OF(PKCS7_SIGNER_INFO)
index fd879ef0ead0e7a1079ad89be29be09f25e3cc87..0b243746279c19b59bb4bb973afe7b1e3d1f6f4c 100644 (file)
@@ -126,6 +126,6 @@ void X509_KEY_free(X509 *a)
        X509_CINF_free(a->cert_info);
        X509_ALGOR_free(a->sig_alg);
        ASN1_BIT_STRING_free(a->signature);
-       Free((char *)a);
+       Free(a);
        }
 
index 0dc6e30c3dd4cb2ea8747bcef7715571fab47b54..43ff4f73c2ad7283ecf5d47342f555328b2b6f64 100644 (file)
@@ -133,7 +133,7 @@ int RSA_print(BIO *bp, RSA *x, int off)
        if (!print(bp,"coefficient:",x->iqmp,m,off)) goto err;
        ret=1;
 err:
-       if (m != NULL) Free((char *)m);
+       if (m != NULL) Free(m);
        return(ret);
        }
 #endif /* NO_RSA */
@@ -204,7 +204,7 @@ int DSA_print(BIO *bp, DSA *x, int off)
        if ((x->g != NULL) && !print(bp,"G:   ",x->g,m,off)) goto err;
        ret=1;
 err:
-       if (m != NULL) Free((char *)m);
+       if (m != NULL) Free(m);
        return(ret);
        }
 #endif /* !NO_DSA */
@@ -307,7 +307,7 @@ int DHparams_print(BIO *bp, DH *x)
 err:
                DHerr(DH_F_DHPARAMS_PRINT,reason);
                }
-       if (m != NULL) Free((char *)m);
+       if (m != NULL) Free(m);
        return(ret);
        }
 #endif
@@ -352,7 +352,7 @@ int DSAparams_print(BIO *bp, DSA *x)
        if (!print(bp,"g:",x->g,m,4)) goto err;
        ret=1;
 err:
-       if (m != NULL) Free((char *)m);
+       if (m != NULL) Free(m);
        DSAerr(DSA_F_DSAPARAMS_PRINT,reason);
        return(ret);
        }
index bf6a797d681c9b493644a4e37a621faaa61842ec..6ee1065ce9468c081f087d24dc3d2ecdf65c6e4f 100644 (file)
@@ -223,7 +223,7 @@ int X509_print(BIO *bp, X509 *x)
        ret=1;
 err:
        if (str != NULL) ASN1_STRING_free(str);
-       if (m != NULL) Free((char *)m);
+       if (m != NULL) Free(m);
        return(ret);
        }
 
index b2c20d139fc656b37c8ba32b9903fedc035e88a9..fe023842f84a302715e03431beb5e253a3cc29b2 100644 (file)
@@ -111,7 +111,7 @@ void X509_ALGOR_free(X509_ALGOR *a)
        if (a == NULL) return;
        ASN1_OBJECT_free(a->algorithm);
        ASN1_TYPE_free(a->parameter);
-       Free((char *)a);
+       Free(a);
        }
 
 IMPLEMENT_STACK_OF(X509_ALGOR)
index a1cbebf5a50e37f2363f9588afb651e5831aefd0..a874df79db60d3a3f5751921234234d2646ea96d 100644 (file)
@@ -160,6 +160,6 @@ void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a)
                sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free);
        else
                ASN1_TYPE_free(a->value.single);
-       Free((char *)a);
+       Free(a);
        }
 
index 269e1ee721cd3a16f2494d57b1d23035a3f15f5c..185cbd78a0fa2641889458629cad366a531614c6 100644 (file)
@@ -134,6 +134,6 @@ void X509_EXTENSION_free(X509_EXTENSION *a)
        if (a == NULL) return;
        ASN1_OBJECT_free(a->object);
        M_ASN1_OCTET_STRING_free(a->value);
-       Free((char *)a);
+       Free(a);
        }
 
index 22520d03dd60adde4a182d838c3cd7eef77e5794..7fdc6f9dc81c7e63d84d94469eaf67a05725c0da 100644 (file)
@@ -107,7 +107,7 @@ void X509_INFO_free(X509_INFO *x)
        if (x->crl != NULL) X509_CRL_free(x->crl);
        if (x->x_pkey != NULL) X509_PKEY_free(x->x_pkey);
        if (x->enc_data != NULL) Free(x->enc_data);
-       Free((char *)x);
+       Free(x);
        }
 
 IMPLEMENT_STACK_OF(X509_INFO)
index b8c30b3cd5cb15c6463bb811b80b6247f707a1b0..fe58919dbbaeddd3bfc7d11f4cbd89ea5065ac68 100644 (file)
@@ -146,6 +146,6 @@ void X509_PKEY_free(X509_PKEY *x)
        if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
        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 *)x);
+       if ((x->key_data != NULL) && (x->key_free)) Free(x->key_data);
+       Free(x);
        }
index 857b7c885865868349e6bd9a07fba9955ee4696d..b96634b34ca4fb91bac8985ac940df7368544d1c 100644 (file)
@@ -112,7 +112,7 @@ void X509_PUBKEY_free(X509_PUBKEY *a)
        X509_ALGOR_free(a->algor);
        M_ASN1_BIT_STRING_free(a->public_key);
        if (a->pkey != NULL) EVP_PKEY_free(a->pkey);
-       Free((char *)a);
+       Free(a);
        }
 
 int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
index 030e4ad846d9742a0851e98d4afeb8db4ff0957b..c170b022744b4e87204decb050897bd0c924599e 100644 (file)
@@ -163,7 +163,7 @@ void X509_REQ_INFO_free(X509_REQ_INFO *a)
        X509_NAME_free(a->subject);
        X509_PUBKEY_free(a->pubkey);
        sk_X509_ATTRIBUTE_pop_free(a->attributes,X509_ATTRIBUTE_free);
-       Free((char *)a);
+       Free(a);
        }
 
 int i2d_X509_REQ(X509_REQ *a, unsigned char **pp)
@@ -230,7 +230,7 @@ void X509_REQ_free(X509_REQ *a)
        X509_REQ_INFO_free(a->req_info);
        X509_ALGOR_free(a->sig_alg);
        M_ASN1_BIT_STRING_free(a->signature);
-       Free((char *)a);
+       Free(a);
        }
 
 
index ea6488274cb0909a00f900a7e223935782dcb1ad..3559bd536853dbdc7e1c1d357c68c8e27da25e42 100644 (file)
@@ -104,7 +104,7 @@ void X509_SIG_free(X509_SIG *a)
        if (a == NULL) return;
        X509_ALGOR_free(a->algor);
        M_ASN1_OCTET_STRING_free(a->digest);
-       Free((char *)a);
+       Free(a);
        }
 
 
index 42493d955ac56c11276273cfea1d8093d7c75dbf..c1d8fce71caacf18b853deaf97fdcf0bb924e44f 100644 (file)
@@ -109,7 +109,7 @@ void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a)
        if (a == NULL) return;
        X509_PUBKEY_free(a->pubkey);
        M_ASN1_IA5STRING_free(a->challenge);
-       Free((char *)a);
+       Free(a);
        }
 
 int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **pp)
@@ -161,6 +161,6 @@ void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a)
        NETSCAPE_SPKAC_free(a->spkac);
        X509_ALGOR_free(a->sig_algor);
        M_ASN1_BIT_STRING_free(a->signature);
-       Free((char *)a);
+       Free(a);
        }
 
index d0a7ea1cf1a50c3b4c3e9b290efba4662eb2e959..1a2f49ffdfd2e227d876912232e0560f18f40f55 100644 (file)
@@ -104,6 +104,6 @@ void X509_VAL_free(X509_VAL *a)
        if (a == NULL) return;
        M_ASN1_TIME_free(a->notBefore);
        M_ASN1_TIME_free(a->notAfter);
-       Free((char *)a);
+       Free(a);
        }
 
index ee74bc9a2da7c202d00675900e0b01259fca2d84..11e564ea30a8ca30157fab3ac5ef2228fa203810 100644 (file)
@@ -153,7 +153,7 @@ void X509_free(X509 *a)
        X509_CERT_AUX_free(a->aux);
 
        if (a->name != NULL) Free(a->name);
-       Free((char *)a);
+       Free(a);
        }
 
 int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
index 6d2ade521cb15fa1fcb00029f003fef922147544..77f8588e1cc35357d223ecfb1102cdac698b8450 100644 (file)
@@ -111,7 +111,7 @@ void X509_CERT_AUX_free(X509_CERT_AUX *a)
        ASN1_UTF8STRING_free(a->alias);
        ASN1_OCTET_STRING_free(a->keyid);
        ASN1_TYPE_free(a->other);
-       Free((char *)a);
+       Free(a);
 }
 
 int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp)
index a8610f2021d2f89748e875177f3dc6e5890436c5..6409f98f570071b6e5a3501b5e98ec7cceda2ebe 100644 (file)
@@ -334,7 +334,7 @@ static void ghbn_free(struct hostent *a)
                        Free(a->h_addr_list[i]);
                Free(a->h_addr_list);
                }
-       if (a->h_name != NULL) Free((char *)a->h_name);
+       if (a->h_name != NULL) Free(a->h_name);
        Free(a);
        }
 
index 39b99ea6c3317aa64711cf4c1b58d3cf88d8fb88..e2cfef37259eaad2612b0b874ca56367d19f0bcd 100644 (file)
@@ -83,11 +83,13 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, BIGNUM *add,
        BIGNUM t;
        int found=0;
        int i,j,c1=0;
-       BN_CTX *ctx;
+       BN_CTX *ctx,*ctx2=NULL;
        int checks = BN_prime_checks_for_size(bits);
 
        ctx=BN_CTX_new();
        if (ctx == NULL) goto err;
+       ctx2=BN_CTX_new();
+       if (ctx2 == NULL) goto err;
        if (ret == NULL)
                {
                if ((rnd=BN_new()) == NULL) goto err;
@@ -119,7 +121,7 @@ loop:
 
        if (!safe)
                {
-               i=BN_is_prime(rnd,checks,callback,ctx,cb_arg);
+               i=BN_is_prime_fasttest(rnd,checks,callback,ctx,ctx2,cb_arg,0);
                if (i == -1) goto err;
                if (i == 0) goto loop;
                }
@@ -133,11 +135,11 @@ loop:
 
                for (i=0; i<checks; i++)
                        {
-                       j=BN_is_prime(rnd,1,callback,ctx,cb_arg);
+                       j=BN_is_prime_fasttest(rnd,1,callback,ctx,ctx2,cb_arg,0);
                        if (j == -1) goto err;
                        if (j == 0) goto loop;
 
-                       j=BN_is_prime(&t,1,callback,ctx,cb_arg);
+                       j=BN_is_prime_fasttest(&t,1,callback,ctx,ctx2,cb_arg,0);
                        if (j == -1) goto err;
                        if (j == 0) goto loop;
 
@@ -151,6 +153,7 @@ err:
        if (!found && (ret == NULL) && (rnd != NULL)) BN_free(rnd);
        BN_free(&t);
        if (ctx != NULL) BN_CTX_free(ctx);
+       if (ctx2 != NULL) BN_CTX_free(ctx2);
        return(found ? rnd : NULL);
        }
 
index 5dcbbc84a5d150b6ea63f927a42a24946991b8f7..67047a36300ade6aa75db92de30601934d641e1b 100644 (file)
@@ -302,7 +302,7 @@ void EVP_PKEY_free(EVP_PKEY *x)
                }
 #endif
        EVP_PKEY_free_it(x);
-       Free((char *)x);
+       Free(x);
        }
 
 static void EVP_PKEY_free_it(EVP_PKEY *x)
index 4d025d7ee737910683125a3b16d55a0663d9dc8a..76d2eec9b2018858cd246ded00fac48eeb5e0aee 100644 (file)
@@ -149,7 +149,7 @@ LHASH *lh_new(unsigned long (*h)(), int (*c)())
        ret->error=0;
        return(ret);
 err1:
-       Free((char *)ret);
+       Free(ret);
 err0:
        return(NULL);
        }
@@ -172,8 +172,8 @@ void lh_free(LHASH *lh)
                        n=nn;
                        }
                }
-       Free((char *)lh->b);
-       Free((char *)lh);
+       Free(lh->b);
+       Free(lh);
        }
 
 void *lh_insert(LHASH *lh, void *data)
@@ -233,7 +233,7 @@ void *lh_delete(LHASH *lh, void *data)
                nn= *rn;
                *rn=nn->next;
                ret=nn->data;
-               Free((char *)nn);
+               Free(nn);
                lh->num_delete++;
                }
 
index 3086b15161775f0bb610aac518db5d31e2dcd237..08a7323acb84734edce514cc8f7c2470274d5d48 100644 (file)
@@ -181,7 +181,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
                        sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
                                ->free_func(ret->name,ret->type,ret->data);
                        }
-               Free((char *)ret);
+               Free(ret);
                }
        else
                {
@@ -216,7 +216,7 @@ int OBJ_NAME_remove(const char *name, int type)
                        sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
                                ->free_func(ret->name,ret->type,ret->data);
                        }
-               Free((char *)ret);
+               Free(ret);
                return(1);
                }
        else
index 6eeb530802c23b77bb9a9483cd8ff4260e6c8742..da6df3762ad56e2a91b4a053a1f81dfde7654b32 100644 (file)
@@ -643,7 +643,7 @@ int OBJ_create(char *oid, char *sn, char *ln)
        ok=OBJ_add_object(op);
 err:
        ASN1_OBJECT_free(op);
-       Free((char *)buf);
+       Free(buf);
        return(ok);
        }
 
index 5a0abd6bae80eb078bf7ddb669a76cfcfea1d95f..c358b0673553abb327c3919a42b8daf9bdc867d5 100644 (file)
@@ -188,5 +188,5 @@ void PKCS12_BAGS_free (PKCS12_BAGS *a)
        }
 
        ASN1_OBJECT_free (a->type);
-       Free ((char *)a);
+       Free (a);
 }
index 014cb525a01ae0d3572a0a83e0cefdd2e7fa4232..7ca9c14908a234f569ca4c415dce3bf5bb3c9bc7 100644 (file)
@@ -107,5 +107,5 @@ void PKCS12_free (PKCS12 *a)
        M_ASN1_INTEGER_free(a->version);
        PKCS12_MAC_DATA_free (a->mac);
        PKCS7_free (a->authsafes);
-       Free ((char *)a);
+       Free (a);
 }
index a427df105c692dcf0ebac3990304cb8c2eccac4c..f5ab0d6464a0461467c6a8f0fc3725f8ea88c971 100644 (file)
@@ -106,5 +106,5 @@ void PKCS12_MAC_DATA_free (PKCS12_MAC_DATA *a)
        X509_SIG_free (a->dinfo);
        M_ASN1_OCTET_STRING_free(a->salt);
        M_ASN1_INTEGER_free(a->iter);
-       Free ((char *)a);
+       Free (a);
 }
index 54d5f422ad7d1482ae46c219246b25dbc5e22fc3..71468468d85860bfe8f6fb40118b71147e211c7a 100644 (file)
@@ -643,14 +643,14 @@ static void mime_hdr_free(MIME_HEADER *hdr)
        if(hdr->name) Free(hdr->name);
        if(hdr->value) Free(hdr->value);
        if(hdr->params) sk_pop_free(hdr->params, mime_param_free);
-       Free((char *)hdr);
+       Free(hdr);
 }
 
 static void mime_param_free(MIME_PARAM *param)
 {
        if(param->param_name) Free(param->param_name);
        if(param->param_value) Free(param->param_value);
-       Free((char *)param);
+       Free(param);
 }
 
 /* Check for a multipart boundary. Returns:
index e5ae0c1f698bc3a2ff0e6e9b6ca2870e5f4709ee..3a51d99435aaeee66f9a819bb4ca343484147c84 100644 (file)
@@ -227,6 +227,10 @@ int main(int argc, char *argv[])
 
     for (v = 0; v < 3; v++)
        {
+#if 1
+       key = RSA_generate_key(512*(v+1),3,0,0);
+       clen=RSA_size(key);
+#else
        key = RSA_new();
        switch (v) {
     case 0:
@@ -239,6 +243,7 @@ int main(int argc, char *argv[])
        clen = key3(key, ctext_ex);
        break;
        }
+#endif
 
        num = RSA_public_encrypt(plen, ptext_ex, ctext, key,
                                 RSA_PKCS1_PADDING);
index 8b9671388484d767f49f9691b80b261cc598b219..9636a71a55194fa8c3698e0decd9df3c1899abfe 100644 (file)
@@ -126,7 +126,7 @@ STACK *sk_new(int (*c)())
        ret->sorted=0;
        return(ret);
 err1:
-       Free((char *)ret);
+       Free(ret);
 err0:
        return(NULL);
        }
@@ -276,8 +276,8 @@ void sk_pop_free(STACK *st, void (*func)())
 void sk_free(STACK *st)
        {
        if (st == NULL) return;
-       if (st->data != NULL) Free((char *)st->data);
-       Free((char *)st);
+       if (st->data != NULL) Free(st->data);
+       Free(st);
        }
 
 int sk_num(STACK *st)
index ad3527df53b917a195562e4a2ad4c3a3269d2808..33acc81f3fa7c0e82ca0041571f48508baf5560e 100644 (file)
@@ -181,7 +181,7 @@ err:
 #endif
                if (ret->data != NULL) sk_free(ret->data);
                if (ret->index != NULL) Free(ret->index);
-               if (ret->qual != NULL) Free((char *)ret->qual);
+               if (ret->qual != NULL) Free(ret->qual);
                if (ret != NULL) Free(ret);
                return(NULL);
                }
index a81b1900d1e4ad1060b7d21b9b04327faca6d8ae..14d12c56bd709e47198ecb8b73547624c7f08a3a 100644 (file)
@@ -218,9 +218,9 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
                                memcpy(ip,ctx->dirs_type,(ctx->num_dirs_alloced-10)*
                                        sizeof(int));
                                if (ctx->dirs != NULL)
-                                       Free((char *)ctx->dirs);
+                                       Free(ctx->dirs);
                                if (ctx->dirs_type != NULL)
-                                       Free((char *)ctx->dirs_type);
+                                       Free(ctx->dirs_type);
                                ctx->dirs=pp;
                                ctx->dirs_type=ip;
                                }
index de2a577ac10244aa21626b138bf8f48f48cc5e80..96c04fe4f57c52017b07bef7e171cad7ec79f8dc 100644 (file)
@@ -132,7 +132,7 @@ void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a)
        M_ASN1_OCTET_STRING_free(a->keyid);
        sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free);
        M_ASN1_INTEGER_free (a->serial);
-       Free ((char *)a);
+       Free (a);
 }
 
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
index 9aada0d8808206a01ce36c740c60280efdcee8d6..1e3edc205f8dcdb278194e755b2279a5b6c88ceb 100644 (file)
@@ -123,7 +123,7 @@ void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a)
 {
        if (a == NULL) return;
        M_ASN1_INTEGER_free (a->pathlen);
-       Free ((char *)a);
+       Free (a);
 }
 
 static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
index 3221c19754f78ac4c5c9ba188456b76ee8a92432..e459d2595ac5230a1eea2d621d923c8bdb13c049 100644 (file)
@@ -213,7 +213,7 @@ void DIST_POINT_free(DIST_POINT *a)
        DIST_POINT_NAME_free(a->distpoint);
        M_ASN1_BIT_STRING_free(a->reasons);
        sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free);
-       Free ((char *)a);
+       Free (a);
 }
 
 int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp)
@@ -256,7 +256,7 @@ void DIST_POINT_NAME_free(DIST_POINT_NAME *a)
        if (a == NULL) return;
        sk_X509_NAME_ENTRY_pop_free(a->relativename, X509_NAME_ENTRY_free);
        sk_GENERAL_NAME_pop_free(a->fullname, GENERAL_NAME_free);
-       Free ((char *)a);
+       Free (a);
 }
 
 DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp,
index bd126033ac87e80cd6e825e81cbc5aacee93e93d..894afa7e036b4f585c630c3edea0d2043ef60849 100644 (file)
@@ -211,7 +211,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
                break;
 
        }
-       Free ((char *)a);
+       Free (a);
 }
 
 /* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as
@@ -286,6 +286,6 @@ void OTHERNAME_free(OTHERNAME *a)
        if (a == NULL) return;
        ASN1_OBJECT_free(a->type_id);
        ASN1_TYPE_free(a->value);
-       Free ((char *)a);
+       Free (a);
 }
 
index df338d1429502d3ccfe54504613d0f536a704111..6e3588aab813c8e544e3529eb6f905c3c5c4975a 100644 (file)
@@ -204,7 +204,7 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
        if (a == NULL) return;
        ASN1_OBJECT_free(a->method);
        GENERAL_NAME_free(a->location);
-       Free ((char *)a);
+       Free (a);
 }
 
 STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new()
index 6b61e61a1404e34c8795369772482767dc78481b..30a62c6090f7203a59245bfd7f28586deb523911 100644 (file)
@@ -121,7 +121,7 @@ void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
        if (a == NULL) return;
        M_ASN1_GENERALIZEDTIME_free(a->notBefore);
        M_ASN1_GENERALIZEDTIME_free(a->notAfter);
-       Free ((char *)a);
+       Free (a);
 }
 
 static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
index 40f71c71b4fd070445db2db45102aa25ce3f9d7b..4c2c4a9483913aa01302b59f3c32add2f478b2b6 100644 (file)
@@ -104,7 +104,7 @@ void X509V3_conf_free(CONF_VALUE *conf)
        if(conf->name) Free(conf->name);
        if(conf->value) Free(conf->value);
        if(conf->section) Free(conf->section);
-       Free((char *)conf);
+       Free(conf);
 }
 
 int X509V3_add_value_bool(const char *name, int asn1_bool,
index 4eabc612ef21590550e86a4cfa182f7e122fae47..3c71d5b367967c18e332a72bdac1a8a894c6d071 100644 (file)
@@ -380,7 +380,7 @@ void SSL_free(SSL *s)
 
        if (s->method != NULL) s->method->ssl_free(s);
 
-       Free((char *)s);
+       Free(s);
        }
 
 void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
@@ -1215,7 +1215,7 @@ void SSL_CTX_free(SSL_CTX *a)
                sk_X509_pop_free(a->extra_certs,X509_free);
        if (a->comp_methods != NULL)
                sk_SSL_COMP_pop_free(a->comp_methods,SSL_COMP_free);
-       Free((char *)a);
+       Free(a);
        }
 
 void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb)