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 bbb651b..ac86a8a 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 b36d620..c77456b 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 c894f56..47a88aa 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 c0a8709..3202a81 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 56ee787..ccf62e5 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 8dc58ed..434610e 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 6bd8454..d9b8035 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 bcbdc7d..8b6794e 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 ab69b95..4812724 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 eed7faa..e9c41e3 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 92efb0b..161ef81 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 2f4892f..d4aede8 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 ddb7869..65eaa96 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 3bcceec..3d0b110 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 55560dd..cd57331 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 5d0cf5a..0883136 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 fdda4ec..61eeb64 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 f36f0da..4021123 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 cf5fd9e..1250fa4 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 142392f..582b92e 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 5d3dcdf..e399cea 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 18f790f..ca7f251 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 7e3d666..d804986 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 8cda4f6..64e9023 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 44d5b5b..2f6a4c4 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 84e4d55..cba90e9 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 8c19b2d..83b0e15 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 180a11d..582cc78 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 bf45f44..4e734fd 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 46fc082..d21f7dd 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 638a04c..86db82c 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 acc38fc..f74658f 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 fd879ef..0b24374 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 0dc6e30..43ff4f7 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 bf6a797..6ee1065 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 b2c20d1..fe02384 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 a1cbebf..a874df7 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 269e1ee..185cbd7 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 22520d0..7fdc6f9 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 b8c30b3..fe58919 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 857b7c8..b96634b 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 030e4ad..c170b02 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 ea64882..3559bd5 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 42493d9..c1d8fce 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 d0a7ea1..1a2f49f 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 ee74bc9..11e564e 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 6d2ade5..77f8588 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 a8610f2..6409f98 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 39b99ea..e2cfef3 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 5dcbbc8..67047a3 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 4d025d7..76d2eec 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 3086b15..08a7323 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 6eeb530..da6df37 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 5a0abd6..c358b06 100644 (file)
@@ -188,5 +188,5 @@ void PKCS12_BAGS_free (PKCS12_BAGS *a)
        }
 
        ASN1_OBJECT_free (a->type);
-       Free ((char *)a);
+       Free (a);
 }
index 014cb52..7ca9c14 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 a427df1..f5ab0d6 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 54d5f42..7146846 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 e5ae0c1..3a51d99 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 8b96713..9636a71 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 ad3527d..33acc81 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 a81b190..14d12c5 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 de2a577..96c04fe 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 9aada0d..1e3edc2 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 3221c19..e459d25 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 bd12603..894afa7 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 df338d1..6e3588a 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 6b61e61..30a62c6 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 40f71c7..4c2c4a9 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 4eabc61..3c71d5b 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)