if (format == FORMAT_PEM)
{
- othercerts = sk_X509_new(NULL);
+ othercerts = sk_X509_new_null();
if(!othercerts)
{
sk_X509_free(othercerts);
else if (strcmp(*argv,"-certfile") == 0)
{
if (--argc < 1) goto bad;
- if(!certflst) certflst = sk_new(NULL);
+ if(!certflst) certflst = sk_new_null();
sk_push(certflst,*(++argv));
}
else
p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data);
if (!ASN1_INTEGER_set(p7s->version,1)) goto end;
- if ((crl_stack=sk_X509_CRL_new(NULL)) == NULL) goto end;
+ if ((crl_stack=sk_X509_CRL_new_null()) == NULL) goto end;
p7s->crl=crl_stack;
if (crl != NULL)
{
crl=NULL; /* now part of p7 for OPENSSL_freeing */
}
- if ((cert_stack=sk_X509_new(NULL)) == NULL) goto end;
+ if ((cert_stack=sk_X509_new_null()) == NULL) goto end;
p7s->cert=cert_stack;
if(certflst) for(i = 0; i < sk_num(certflst); i++) {
if (toseq) {
seq = NETSCAPE_CERT_SEQUENCE_new();
- seq->certs = sk_X509_new(NULL);
+ seq->certs = sk_X509_new_null();
while((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
sk_X509_push(seq->certs,x509);
} else if (!strcmp (*args, "-caname")) {
if (args[1]) {
args++;
- if (!canames) canames = sk_new(NULL);
+ if (!canames) canames = sk_new_null();
sk_push(canames, *args);
} else badarg = 1;
} else if (!strcmp (*args, "-in")) {
CRYPTO_push_info("reading certs from input");
#endif
- certs = sk_X509_new(NULL);
+ certs = sk_X509_new_null();
/* Load in all certs in input file */
if(!cert_load(in, certs)) {
CRYPTO_push_info("reading certs from certfile");
#endif
- bags = sk_PKCS12_SAFEBAG_new (NULL);
+ bags = sk_PKCS12_SAFEBAG_new_null ();
/* Add any more certificates asked for */
if (certsin) {
goto export_end;
}
- safes = sk_PKCS7_new (NULL);
+ safes = sk_PKCS7_new_null ();
sk_PKCS7_push (safes, authsafe);
#ifdef CRYPTO_MDEBUG
p8 = NULL;
if (name) PKCS12_add_friendlyname (bag, name, -1);
PKCS12_add_localkeyid (bag, keyid, keyidlen);
- bags = sk_PKCS12_SAFEBAG_new(NULL);
+ bags = sk_PKCS12_SAFEBAG_new_null();
sk_PKCS12_SAFEBAG_push (bags, bag);
#ifdef CRYPTO_MDEBUG
STACK *ret=NULL;
if ((a == NULL) || ((*a) == NULL))
- { if ((ret=sk_new(NULL)) == NULL) goto err; }
+ { if ((ret=sk_new_null()) == NULL) goto err; }
else
ret=(*a);
return(NULL);
}
memset(ret, 0, sizeof(DSO));
- ret->meth_data = sk_new(NULL);
- if((ret->meth_data = sk_new(NULL)) == NULL)
+ ret->meth_data = sk_new_null();
+ if((ret->meth_data = sk_new_null()) == NULL)
{
/* sk_new doesn't generate any errors so we do */
DSOerr(DSO_F_DSO_NEW_METHOD,ERR_R_MALLOC_FAILURE);
return 0;
}
attrib->object = OBJ_nid2obj(NID_localKeyID);
- if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) {
+ if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
return 0;
}
sk_ASN1_TYPE_push (attrib->value.set,keyid);
attrib->set = 1;
- if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new (NULL))) {
+ if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) {
PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
return 0;
}
return 0;
}
attrib->object = OBJ_nid2obj(NID_key_usage);
- if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) {
+ if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
return 0;
}
sk_ASN1_TYPE_push (attrib->value.set,keyid);
attrib->set = 1;
if (!p8->attributes
- && !(p8->attributes = sk_X509_ATTRIBUTE_new (NULL))) {
+ && !(p8->attributes = sk_X509_ATTRIBUTE_new_null ())) {
PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
return 0;
}
return 0;
}
attrib->object = OBJ_nid2obj(NID_friendlyName);
- if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) {
+ if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME,
ERR_R_MALLOC_FAILURE);
return 0;
}
sk_ASN1_TYPE_push (attrib->value.set,fname);
attrib->set = 1;
- if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new (NULL))) {
+ if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) {
PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI,
ERR_R_MALLOC_FAILURE);
return 0;
if(!X509_check_private_key(cert, pkey)) return NULL;
- if(!(bags = sk_PKCS12_SAFEBAG_new (NULL))) {
+ if(!(bags = sk_PKCS12_SAFEBAG_new_null ())) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL;
}
if (!authsafe) return NULL;
- if(!(safes = sk_PKCS7_new (NULL))
+ if(!(safes = sk_PKCS7_new_null ())
|| !sk_PKCS7_push(safes, authsafe)) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL;
PKCS8_PRIV_KEY_INFO_free(p8);
if (name && !PKCS12_add_friendlyname (bag, name, -1)) return NULL;
if(!PKCS12_add_localkeyid (bag, keyid, keyidlen)) return NULL;
- if(!(bags = sk_PKCS12_SAFEBAG_new(NULL))
+ if(!(bags = sk_PKCS12_SAFEBAG_new_null())
|| !sk_PKCS12_SAFEBAG_push (bags, bag)) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL;
/* Allocate stack for ca certificates if needed */
if ((ca != NULL) && (*ca == NULL)) {
- if (!(*ca = sk_X509_new(NULL))) {
+ if (!(*ca = sk_X509_new_null())) {
PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE);
return 0;
}
unsigned int maclen;
if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0;
- if(!(newsafes = sk_PKCS7_new(NULL))) return 0;
+ if(!(newsafes = sk_PKCS7_new_null())) return 0;
for (i = 0; i < sk_PKCS7_num (asafes); i++) {
p7 = sk_PKCS7_value(asafes, i);
bagnid = OBJ_obj2nid(p7->type);
if (*sk == NULL)
{
- *sk = sk_X509_ATTRIBUTE_new(NULL);
+ *sk = sk_X509_ATTRIBUTE_new_null();
new_attrib:
attr=X509_ATTRIBUTE_create(nid,atrtype,value);
sk_X509_ATTRIBUTE_push(*sk,attr);
part = 0;
state = 0;
first = 1;
- parts = sk_BIO_new(NULL);
+ parts = sk_BIO_new_null();
*ret = parts;
while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
state = mime_bound_check(linebuf, len, bound, blen);
/* Add SMIMECapabilities */
if(!(flags & PKCS7_NOSMIMECAP))
{
- if(!(smcap = sk_X509_ALGOR_new(NULL))) {
+ if(!(smcap = sk_X509_ALGOR_new_null())) {
PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
return NULL;
}
PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE);
return NULL;
}
- if(!(signers = sk_X509_new(NULL))) {
+ if(!(signers = sk_X509_new_null())) {
PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE);
return NULL;
}
if(!(akeyid = AUTHORITY_KEYID_new())) goto err;
if(isname) {
- if(!(gens = sk_GENERAL_NAME_new(NULL)) || !(gen = GENERAL_NAME_new())
+ if(!(gens = sk_GENERAL_NAME_new_null()) || !(gen = GENERAL_NAME_new())
|| !sk_GENERAL_NAME_push(gens, gen)) {
X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE);
goto err;
STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf;
int i;
- if(!(gens = sk_GENERAL_NAME_new(NULL))) {
+ if(!(gens = sk_GENERAL_NAME_new_null())) {
X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL;
}
STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf;
int i;
- if(!(gens = sk_GENERAL_NAME_new(NULL))) {
+ if(!(gens = sk_GENERAL_NAME_new_null())) {
X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL;
}
STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf;
int i;
- if(!(gens = sk_GENERAL_NAME_new(NULL))) {
+ if(!(gens = sk_GENERAL_NAME_new_null())) {
X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL;
}
GENERAL_NAME *gen = NULL;
CONF_VALUE *cnf;
int i;
- if(!(crld = sk_DIST_POINT_new(NULL))) goto merr;
+ if(!(crld = sk_DIST_POINT_new_null())) goto merr;
for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
DIST_POINT *point;
cnf = sk_CONF_VALUE_value(nval, i);
CONF_VALUE *val;
int i;
-if(!(extku = sk_ASN1_OBJECT_new(NULL))) {
+if(!(extku = sk_ASN1_OBJECT_new_null())) {
X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE);
return NULL;
}
STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new()
{
- return sk_GENERAL_NAME_new(NULL);
+ return sk_GENERAL_NAME_new_null();
}
void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a)
ACCESS_DESCRIPTION *acc;
int i, objlen;
char *objtmp, *ptmp;
- if(!(ainfo = sk_ACCESS_DESCRIPTION_new(NULL))) {
+ if(!(ainfo = sk_ACCESS_DESCRIPTION_new_null())) {
X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE);
return NULL;
}
STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void)
{
- return sk_ACCESS_DESCRIPTION_new(NULL);
+ return sk_ACCESS_DESCRIPTION_new_null();
}
void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a)
if(name && !(tname = BUF_strdup(name))) goto err;
if(value && !(tvalue = BUF_strdup(value))) goto err;;
if(!(vtmp = (CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE)))) goto err;
- if(!*extlist && !(*extlist = sk_CONF_VALUE_new(NULL))) goto err;
+ if(!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) goto err;
vtmp->section = NULL;
vtmp->name = tname;
vtmp->value = tvalue;
X509_NAME *xn=NULL;
STACK_OF(X509_NAME) *ret,*sk;
- ret=sk_X509_NAME_new(NULL);
+ ret=sk_X509_NAME_new_null();
sk=sk_X509_NAME_new(xname_cmp);
in=BIO_new(BIO_s_file_internal());
* Allocate new "cipherstack" for the result, return with error
* if we cannot get one.
*/
- if ((cipherstack = sk_SSL_CIPHER_new(NULL)) == NULL)
+ if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL)
{
OPENSSL_free(list);
return(NULL);
return(NULL);
}
if ((skp == NULL) || (*skp == NULL))
- sk=sk_SSL_CIPHER_new(NULL); /* change perhaps later */
+ sk=sk_SSL_CIPHER_new_null(); /* change perhaps later */
else
{
sk= *skp;