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;
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;
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;
{
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)
{
else
{
s=NULL;
- if (ret->data != NULL) Free((char *)ret->data);
+ if (ret->data != NULL) Free(ret->data);
}
ret->length=(int)len;
i=i2d(x,&p);
p= b;
ret=d2i(NULL,&p,i);
- Free((char *)b);
+ Free(b);
return(ret);
}
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;
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);
}
M_ASN1_OCTET_STRING_free(a->header);
if (a->meth != NULL)
a->meth->destroy(a->data);
- Free((char *)a);
+ Free(a);
}
j+=i;
n-=i;
}
- Free((char *)b);
+ Free(b);
return(ret);
}
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;
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;
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);
}
}
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)
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;
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);
}
{
if (a == NULL) return;
ASN1_TYPE_component_free(a);
- Free((char *)a);
+ Free(a);
}
int ASN1_TYPE_get(ASN1_TYPE *a)
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)
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)
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;
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;
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;
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]);
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;
bs.length=BN_bn2bin(num[i],bs.data);
i2d_ASN1_INTEGER(&bs,&p);
}
- Free((char *)bs.data);
+ Free(bs.data);
*pp=p;
return(t);
}
bs.length=BN_bn2bin(num[i],bs.data);
i2d_ASN1_INTEGER(&bs,&p);
}
- Free((char *)bs.data);
+ Free(bs.data);
*pp=p;
return(t);
}
bs.length=BN_bn2bin(num[i],bs.data);
i2d_ASN1_INTEGER(&bs,&p);
}
- Free((char *)bs.data);
+ Free(bs.data);
*pp=p;
return(t);
}
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);
}
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);
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 */
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 */
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)
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:
X509_ALGOR_free(a->md);
PKCS7_free(a->contents);
M_ASN1_OCTET_STRING_free(a->digest);
- Free((char *)a);
+ Free(a);
}
if (a == NULL) return;
M_ASN1_INTEGER_free(a->version);
PKCS7_ENC_CONTENT_free(a->enc_data);
- Free((char *)a);
+ Free(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);
}
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);
}
if (a == NULL) return;
X509_NAME_free(a->issuer);
M_ASN1_INTEGER_free(a->serial);
- Free((char *)a);
+ Free(a);
}
{
if ((*a)->asn1 != NULL)
{
- Free((char *)(*a)->asn1);
+ Free((*a)->asn1);
(*a)->asn1=NULL;
}
(*a)->length=0;
{
ASN1_OBJECT_free(a->type);
}
- Free((char *)a);
+ Free(a);
}
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)
{
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)
X509_CINF_free(a->cert_info);
X509_ALGOR_free(a->sig_alg);
ASN1_BIT_STRING_free(a->signature);
- Free((char *)a);
+ Free(a);
}
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 */
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 */
err:
DHerr(DH_F_DHPARAMS_PRINT,reason);
}
- if (m != NULL) Free((char *)m);
+ if (m != NULL) Free(m);
return(ret);
}
#endif
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);
}
ret=1;
err:
if (str != NULL) ASN1_STRING_free(str);
- if (m != NULL) Free((char *)m);
+ if (m != NULL) Free(m);
return(ret);
}
if (a == NULL) return;
ASN1_OBJECT_free(a->algorithm);
ASN1_TYPE_free(a->parameter);
- Free((char *)a);
+ Free(a);
}
IMPLEMENT_STACK_OF(X509_ALGOR)
sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free);
else
ASN1_TYPE_free(a->value.single);
- Free((char *)a);
+ Free(a);
}
if (a == NULL) return;
ASN1_OBJECT_free(a->object);
M_ASN1_OCTET_STRING_free(a->value);
- Free((char *)a);
+ Free(a);
}
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)
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);
}
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)
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)
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);
}
if (a == NULL) return;
X509_ALGOR_free(a->algor);
M_ASN1_OCTET_STRING_free(a->digest);
- Free((char *)a);
+ Free(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)
NETSCAPE_SPKAC_free(a->spkac);
X509_ALGOR_free(a->sig_algor);
M_ASN1_BIT_STRING_free(a->signature);
- Free((char *)a);
+ Free(a);
}
if (a == NULL) return;
M_ASN1_TIME_free(a->notBefore);
M_ASN1_TIME_free(a->notAfter);
- Free((char *)a);
+ Free(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,
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)
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);
}
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;
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;
}
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;
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);
}
}
#endif
EVP_PKEY_free_it(x);
- Free((char *)x);
+ Free(x);
}
static void EVP_PKEY_free_it(EVP_PKEY *x)
ret->error=0;
return(ret);
err1:
- Free((char *)ret);
+ Free(ret);
err0:
return(NULL);
}
n=nn;
}
}
- Free((char *)lh->b);
- Free((char *)lh);
+ Free(lh->b);
+ Free(lh);
}
void *lh_insert(LHASH *lh, void *data)
nn= *rn;
*rn=nn->next;
ret=nn->data;
- Free((char *)nn);
+ Free(nn);
lh->num_delete++;
}
sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
->free_func(ret->name,ret->type,ret->data);
}
- Free((char *)ret);
+ Free(ret);
}
else
{
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
ok=OBJ_add_object(op);
err:
ASN1_OBJECT_free(op);
- Free((char *)buf);
+ Free(buf);
return(ok);
}
}
ASN1_OBJECT_free (a->type);
- Free ((char *)a);
+ Free (a);
}
M_ASN1_INTEGER_free(a->version);
PKCS12_MAC_DATA_free (a->mac);
PKCS7_free (a->authsafes);
- Free ((char *)a);
+ Free (a);
}
X509_SIG_free (a->dinfo);
M_ASN1_OCTET_STRING_free(a->salt);
M_ASN1_INTEGER_free(a->iter);
- Free ((char *)a);
+ Free (a);
}
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:
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:
clen = key3(key, ctext_ex);
break;
}
+#endif
num = RSA_public_encrypt(plen, ptext_ex, ctext, key,
RSA_PKCS1_PADDING);
ret->sorted=0;
return(ret);
err1:
- Free((char *)ret);
+ Free(ret);
err0:
return(NULL);
}
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)
#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);
}
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;
}
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,
{
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,
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)
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,
break;
}
- Free ((char *)a);
+ Free (a);
}
/* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as
if (a == NULL) return;
ASN1_OBJECT_free(a->type_id);
ASN1_TYPE_free(a->value);
- Free ((char *)a);
+ Free (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()
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,
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,
if (s->method != NULL) s->method->ssl_free(s);
- Free((char *)s);
+ Free(s);
}
void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
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)