提交 62324627 编写于 作者: R Richard Levitte

Use sk_*_new_null() instead of sk_*_new(NULL), since that takes care

of complaints from the compiler about data pointers and function
pointers not being compatible with each other.
上级 623eea37
...@@ -660,7 +660,7 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format) ...@@ -660,7 +660,7 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
if (format == FORMAT_PEM) if (format == FORMAT_PEM)
{ {
othercerts = sk_X509_new(NULL); othercerts = sk_X509_new_null();
if(!othercerts) if(!othercerts)
{ {
sk_X509_free(othercerts); sk_X509_free(othercerts);
......
...@@ -141,7 +141,7 @@ int MAIN(int argc, char **argv) ...@@ -141,7 +141,7 @@ int MAIN(int argc, char **argv)
else if (strcmp(*argv,"-certfile") == 0) else if (strcmp(*argv,"-certfile") == 0)
{ {
if (--argc < 1) goto bad; if (--argc < 1) goto bad;
if(!certflst) certflst = sk_new(NULL); if(!certflst) certflst = sk_new_null();
sk_push(certflst,*(++argv)); sk_push(certflst,*(++argv));
} }
else else
...@@ -215,7 +215,7 @@ bad: ...@@ -215,7 +215,7 @@ bad:
p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data); p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data);
if (!ASN1_INTEGER_set(p7s->version,1)) goto end; 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; p7s->crl=crl_stack;
if (crl != NULL) if (crl != NULL)
{ {
...@@ -223,7 +223,7 @@ bad: ...@@ -223,7 +223,7 @@ bad:
crl=NULL; /* now part of p7 for OPENSSL_freeing */ 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; p7s->cert=cert_stack;
if(certflst) for(i = 0; i < sk_num(certflst); i++) { if(certflst) for(i = 0; i < sk_num(certflst); i++) {
......
...@@ -123,7 +123,7 @@ int MAIN(int argc, char **argv) ...@@ -123,7 +123,7 @@ int MAIN(int argc, char **argv)
if (toseq) { if (toseq) {
seq = NETSCAPE_CERT_SEQUENCE_new(); 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))) while((x509 = PEM_read_bio_X509(in, NULL, NULL, NULL)))
sk_X509_push(seq->certs,x509); sk_X509_push(seq->certs,x509);
......
...@@ -197,7 +197,7 @@ int MAIN(int argc, char **argv) ...@@ -197,7 +197,7 @@ int MAIN(int argc, char **argv)
} else if (!strcmp (*args, "-caname")) { } else if (!strcmp (*args, "-caname")) {
if (args[1]) { if (args[1]) {
args++; args++;
if (!canames) canames = sk_new(NULL); if (!canames) canames = sk_new_null();
sk_push(canames, *args); sk_push(canames, *args);
} else badarg = 1; } else badarg = 1;
} else if (!strcmp (*args, "-in")) { } else if (!strcmp (*args, "-in")) {
...@@ -404,7 +404,7 @@ int MAIN(int argc, char **argv) ...@@ -404,7 +404,7 @@ int MAIN(int argc, char **argv)
CRYPTO_push_info("reading certs from input"); CRYPTO_push_info("reading certs from input");
#endif #endif
certs = sk_X509_new(NULL); certs = sk_X509_new_null();
/* Load in all certs in input file */ /* Load in all certs in input file */
if(!cert_load(in, certs)) { if(!cert_load(in, certs)) {
...@@ -436,7 +436,7 @@ int MAIN(int argc, char **argv) ...@@ -436,7 +436,7 @@ int MAIN(int argc, char **argv)
CRYPTO_push_info("reading certs from certfile"); CRYPTO_push_info("reading certs from certfile");
#endif #endif
bags = sk_PKCS12_SAFEBAG_new (NULL); bags = sk_PKCS12_SAFEBAG_new_null ();
/* Add any more certificates asked for */ /* Add any more certificates asked for */
if (certsin) { if (certsin) {
...@@ -527,7 +527,7 @@ int MAIN(int argc, char **argv) ...@@ -527,7 +527,7 @@ int MAIN(int argc, char **argv)
goto export_end; goto export_end;
} }
safes = sk_PKCS7_new (NULL); safes = sk_PKCS7_new_null ();
sk_PKCS7_push (safes, authsafe); sk_PKCS7_push (safes, authsafe);
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
...@@ -543,7 +543,7 @@ int MAIN(int argc, char **argv) ...@@ -543,7 +543,7 @@ int MAIN(int argc, char **argv)
p8 = NULL; p8 = NULL;
if (name) PKCS12_add_friendlyname (bag, name, -1); if (name) PKCS12_add_friendlyname (bag, name, -1);
PKCS12_add_localkeyid (bag, keyid, keyidlen); PKCS12_add_localkeyid (bag, keyid, keyidlen);
bags = sk_PKCS12_SAFEBAG_new(NULL); bags = sk_PKCS12_SAFEBAG_new_null();
sk_PKCS12_SAFEBAG_push (bags, bag); sk_PKCS12_SAFEBAG_push (bags, bag);
#ifdef CRYPTO_MDEBUG #ifdef CRYPTO_MDEBUG
......
...@@ -158,7 +158,7 @@ STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, ...@@ -158,7 +158,7 @@ STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
STACK *ret=NULL; STACK *ret=NULL;
if ((a == NULL) || ((*a) == NULL)) if ((a == NULL) || ((*a) == NULL))
{ if ((ret=sk_new(NULL)) == NULL) goto err; } { if ((ret=sk_new_null()) == NULL) goto err; }
else else
ret=(*a); ret=(*a);
......
...@@ -107,8 +107,8 @@ DSO *DSO_new_method(DSO_METHOD *meth) ...@@ -107,8 +107,8 @@ DSO *DSO_new_method(DSO_METHOD *meth)
return(NULL); return(NULL);
} }
memset(ret, 0, sizeof(DSO)); memset(ret, 0, sizeof(DSO));
ret->meth_data = sk_new(NULL); ret->meth_data = sk_new_null();
if((ret->meth_data = sk_new(NULL)) == NULL) if((ret->meth_data = sk_new_null()) == NULL)
{ {
/* sk_new doesn't generate any errors so we do */ /* sk_new doesn't generate any errors so we do */
DSOerr(DSO_F_DSO_NEW_METHOD,ERR_R_MALLOC_FAILURE); DSOerr(DSO_F_DSO_NEW_METHOD,ERR_R_MALLOC_FAILURE);
......
...@@ -87,13 +87,13 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name, ...@@ -87,13 +87,13 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name,
return 0; return 0;
} }
attrib->object = OBJ_nid2obj(NID_localKeyID); 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); PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
sk_ASN1_TYPE_push (attrib->value.set,keyid); sk_ASN1_TYPE_push (attrib->value.set,keyid);
attrib->set = 1; 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); PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
...@@ -129,14 +129,14 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage) ...@@ -129,14 +129,14 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage)
return 0; return 0;
} }
attrib->object = OBJ_nid2obj(NID_key_usage); 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); PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
sk_ASN1_TYPE_push (attrib->value.set,keyid); sk_ASN1_TYPE_push (attrib->value.set,keyid);
attrib->set = 1; attrib->set = 1;
if (!p8->attributes 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); PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
...@@ -195,14 +195,14 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag, ...@@ -195,14 +195,14 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag,
return 0; return 0;
} }
attrib->object = OBJ_nid2obj(NID_friendlyName); 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, PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME,
ERR_R_MALLOC_FAILURE); ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
sk_ASN1_TYPE_push (attrib->value.set,fname); sk_ASN1_TYPE_push (attrib->value.set,fname);
attrib->set = 1; 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, PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI,
ERR_R_MALLOC_FAILURE); ERR_R_MALLOC_FAILURE);
return 0; return 0;
......
...@@ -88,7 +88,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, ...@@ -88,7 +88,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
if(!X509_check_private_key(cert, pkey)) return NULL; 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); PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
...@@ -123,7 +123,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, ...@@ -123,7 +123,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
if (!authsafe) return NULL; if (!authsafe) return NULL;
if(!(safes = sk_PKCS7_new (NULL)) if(!(safes = sk_PKCS7_new_null ())
|| !sk_PKCS7_push(safes, authsafe)) { || !sk_PKCS7_push(safes, authsafe)) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
...@@ -137,7 +137,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, ...@@ -137,7 +137,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
PKCS8_PRIV_KEY_INFO_free(p8); PKCS8_PRIV_KEY_INFO_free(p8);
if (name && !PKCS12_add_friendlyname (bag, name, -1)) return NULL; if (name && !PKCS12_add_friendlyname (bag, name, -1)) return NULL;
if(!PKCS12_add_localkeyid (bag, keyid, keyidlen)) 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)) { || !sk_PKCS12_SAFEBAG_push (bags, bag)) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
......
...@@ -93,7 +93,7 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, ...@@ -93,7 +93,7 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
/* Allocate stack for ca certificates if needed */ /* Allocate stack for ca certificates if needed */
if ((ca != NULL) && (*ca == NULL)) { 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); PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE);
return 0; return 0;
} }
......
...@@ -114,7 +114,7 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) ...@@ -114,7 +114,7 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
unsigned int maclen; unsigned int maclen;
if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0; 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++) { for (i = 0; i < sk_PKCS7_num (asafes); i++) {
p7 = sk_PKCS7_value(asafes, i); p7 = sk_PKCS7_value(asafes, i);
bagnid = OBJ_obj2nid(p7->type); bagnid = OBJ_obj2nid(p7->type);
......
...@@ -909,7 +909,7 @@ static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype, ...@@ -909,7 +909,7 @@ static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
if (*sk == NULL) if (*sk == NULL)
{ {
*sk = sk_X509_ATTRIBUTE_new(NULL); *sk = sk_X509_ATTRIBUTE_new_null();
new_attrib: new_attrib:
attr=X509_ATTRIBUTE_create(nid,atrtype,value); attr=X509_ATTRIBUTE_create(nid,atrtype,value);
sk_X509_ATTRIBUTE_push(*sk,attr); sk_X509_ATTRIBUTE_push(*sk,attr);
......
...@@ -372,7 +372,7 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret) ...@@ -372,7 +372,7 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret)
part = 0; part = 0;
state = 0; state = 0;
first = 1; first = 1;
parts = sk_BIO_new(NULL); parts = sk_BIO_new_null();
*ret = parts; *ret = parts;
while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) { while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
state = mime_bound_check(linebuf, len, bound, blen); state = mime_bound_check(linebuf, len, bound, blen);
......
...@@ -111,7 +111,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, ...@@ -111,7 +111,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
/* Add SMIMECapabilities */ /* Add SMIMECapabilities */
if(!(flags & PKCS7_NOSMIMECAP)) 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); PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
...@@ -285,7 +285,7 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) ...@@ -285,7 +285,7 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags)
PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE); PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE);
return NULL; return NULL;
} }
if(!(signers = sk_X509_new(NULL))) { if(!(signers = sk_X509_new_null())) {
PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE); PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
......
...@@ -224,7 +224,7 @@ if((issuer && !ikeyid) || (issuer == 2)) { ...@@ -224,7 +224,7 @@ if((issuer && !ikeyid) || (issuer == 2)) {
if(!(akeyid = AUTHORITY_KEYID_new())) goto err; if(!(akeyid = AUTHORITY_KEYID_new())) goto err;
if(isname) { 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)) { || !sk_GENERAL_NAME_push(gens, gen)) {
X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE); X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE);
goto err; goto err;
......
...@@ -160,7 +160,7 @@ static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method, ...@@ -160,7 +160,7 @@ static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method,
STACK_OF(GENERAL_NAME) *gens = NULL; STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf; CONF_VALUE *cnf;
int i; 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); X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
...@@ -225,7 +225,7 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method, ...@@ -225,7 +225,7 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
STACK_OF(GENERAL_NAME) *gens = NULL; STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf; CONF_VALUE *cnf;
int i; 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); X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
...@@ -304,7 +304,7 @@ STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, ...@@ -304,7 +304,7 @@ STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
STACK_OF(GENERAL_NAME) *gens = NULL; STACK_OF(GENERAL_NAME) *gens = NULL;
CONF_VALUE *cnf; CONF_VALUE *cnf;
int i; 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); X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
......
...@@ -109,7 +109,7 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method, ...@@ -109,7 +109,7 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
GENERAL_NAME *gen = NULL; GENERAL_NAME *gen = NULL;
CONF_VALUE *cnf; CONF_VALUE *cnf;
int i; 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++) { for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
DIST_POINT *point; DIST_POINT *point;
cnf = sk_CONF_VALUE_value(nval, i); cnf = sk_CONF_VALUE_value(nval, i);
......
...@@ -129,7 +129,7 @@ ASN1_OBJECT *objtmp; ...@@ -129,7 +129,7 @@ ASN1_OBJECT *objtmp;
CONF_VALUE *val; CONF_VALUE *val;
int i; 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); X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
......
...@@ -220,7 +220,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a) ...@@ -220,7 +220,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new() 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) void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a)
......
...@@ -119,7 +119,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD ...@@ -119,7 +119,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
ACCESS_DESCRIPTION *acc; ACCESS_DESCRIPTION *acc;
int i, objlen; int i, objlen;
char *objtmp, *ptmp; 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); X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE);
return NULL; return NULL;
} }
...@@ -209,7 +209,7 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a) ...@@ -209,7 +209,7 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void) 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) void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a)
......
...@@ -80,7 +80,7 @@ int X509V3_add_value(const char *name, const char *value, ...@@ -80,7 +80,7 @@ int X509V3_add_value(const char *name, const char *value,
if(name && !(tname = BUF_strdup(name))) goto err; if(name && !(tname = BUF_strdup(name))) goto err;
if(value && !(tvalue = BUF_strdup(value))) goto err;; if(value && !(tvalue = BUF_strdup(value))) goto err;;
if(!(vtmp = (CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_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->section = NULL;
vtmp->name = tname; vtmp->name = tname;
vtmp->value = tvalue; vtmp->value = tvalue;
......
...@@ -589,7 +589,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) ...@@ -589,7 +589,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file)
X509_NAME *xn=NULL; X509_NAME *xn=NULL;
STACK_OF(X509_NAME) *ret,*sk; 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); sk=sk_X509_NAME_new(xname_cmp);
in=BIO_new(BIO_s_file_internal()); in=BIO_new(BIO_s_file_internal());
......
...@@ -799,7 +799,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, ...@@ -799,7 +799,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
* Allocate new "cipherstack" for the result, return with error * Allocate new "cipherstack" for the result, return with error
* if we cannot get one. * if we cannot get one.
*/ */
if ((cipherstack = sk_SSL_CIPHER_new(NULL)) == NULL) if ((cipherstack = sk_SSL_CIPHER_new_null()) == NULL)
{ {
OPENSSL_free(list); OPENSSL_free(list);
return(NULL); return(NULL);
......
...@@ -1036,7 +1036,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num, ...@@ -1036,7 +1036,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
return(NULL); return(NULL);
} }
if ((skp == NULL) || (*skp == 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 else
{ {
sk= *skp; sk= *skp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册