Browse Source

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.
master
Richard Levitte 22 years ago
parent
commit
62324627aa
23 changed files with 41 additions and 41 deletions
  1. +1
    -1
      apps/apps.c
  2. +3
    -3
      apps/crl2p7.c
  3. +1
    -1
      apps/nseq.c
  4. +5
    -5
      apps/pkcs12.c
  5. +1
    -1
      crypto/asn1/a_set.c
  6. +2
    -2
      crypto/dso/dso_lib.c
  7. +6
    -6
      crypto/pkcs12/p12_attr.c
  8. +3
    -3
      crypto/pkcs12/p12_crt.c
  9. +1
    -1
      crypto/pkcs12/p12_kiss.c
  10. +1
    -1
      crypto/pkcs12/p12_npas.c
  11. +1
    -1
      crypto/pkcs7/pk7_doit.c
  12. +1
    -1
      crypto/pkcs7/pk7_mime.c
  13. +2
    -2
      crypto/pkcs7/pk7_smime.c
  14. +1
    -1
      crypto/x509v3/v3_akey.c
  15. +3
    -3
      crypto/x509v3/v3_alt.c
  16. +1
    -1
      crypto/x509v3/v3_crld.c
  17. +1
    -1
      crypto/x509v3/v3_extku.c
  18. +1
    -1
      crypto/x509v3/v3_genn.c
  19. +2
    -2
      crypto/x509v3/v3_info.c
  20. +1
    -1
      crypto/x509v3/v3_utl.c
  21. +1
    -1
      ssl/ssl_cert.c
  22. +1
    -1
      ssl/ssl_ciph.c
  23. +1
    -1
      ssl/ssl_lib.c

+ 1
- 1
apps/apps.c View File

@ -660,7 +660,7 @@ STACK_OF(X509) *load_certs(BIO *err, char *file, int format)
if (format == FORMAT_PEM)
{
othercerts = sk_X509_new(NULL);
othercerts = sk_X509_new_null();
if(!othercerts)
{
sk_X509_free(othercerts);


+ 3
- 3
apps/crl2p7.c View File

@ -141,7 +141,7 @@ int MAIN(int argc, char **argv)
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
@ -215,7 +215,7 @@ bad:
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)
{
@ -223,7 +223,7 @@ bad:
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++) {


+ 1
- 1
apps/nseq.c View File

@ -123,7 +123,7 @@ int MAIN(int argc, char **argv)
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);


+ 5
- 5
apps/pkcs12.c View File

@ -197,7 +197,7 @@ int MAIN(int argc, char **argv)
} 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")) {
@ -404,7 +404,7 @@ int MAIN(int argc, char **argv)
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)) {
@ -436,7 +436,7 @@ int MAIN(int argc, char **argv)
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) {
@ -527,7 +527,7 @@ int MAIN(int argc, char **argv)
goto export_end;
}
safes = sk_PKCS7_new (NULL);
safes = sk_PKCS7_new_null ();
sk_PKCS7_push (safes, authsafe);
#ifdef CRYPTO_MDEBUG
@ -543,7 +543,7 @@ int MAIN(int argc, char **argv)
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


+ 1
- 1
crypto/asn1/a_set.c View File

@ -158,7 +158,7 @@ STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
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);


+ 2
- 2
crypto/dso/dso_lib.c View File

@ -107,8 +107,8 @@ DSO *DSO_new_method(DSO_METHOD *meth)
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);


+ 6
- 6
crypto/pkcs12/p12_attr.c View File

@ -87,13 +87,13 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name,
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;
}
@ -129,14 +129,14 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage)
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;
}
@ -195,14 +195,14 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag,
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;


+ 3
- 3
crypto/pkcs12/p12_crt.c View File

@ -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(!(bags = sk_PKCS12_SAFEBAG_new (NULL))) {
if(!(bags = sk_PKCS12_SAFEBAG_new_null ())) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
return NULL;
}
@ -123,7 +123,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
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;
@ -137,7 +137,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
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;


+ 1
- 1
crypto/pkcs12/p12_kiss.c View File

@ -93,7 +93,7 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
/* 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;
}


+ 1
- 1
crypto/pkcs12/p12_npas.c View File

@ -114,7 +114,7 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
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);


+ 1
- 1
crypto/pkcs7/pk7_doit.c View File

@ -909,7 +909,7 @@ static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
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);


+ 1
- 1
crypto/pkcs7/pk7_mime.c View File

@ -372,7 +372,7 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret)
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);


+ 2
- 2
crypto/pkcs7/pk7_smime.c View File

@ -111,7 +111,7 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
/* 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;
}
@ -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);
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;
}


+ 1
- 1
crypto/x509v3/v3_akey.c View File

@ -224,7 +224,7 @@ if((issuer && !ikeyid) || (issuer == 2)) {
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;


+ 3
- 3
crypto/x509v3/v3_alt.c View File

@ -160,7 +160,7 @@ static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method,
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;
}
@ -225,7 +225,7 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
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;
}
@ -304,7 +304,7 @@ STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
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;
}


+ 1
- 1
crypto/x509v3/v3_crld.c View File

@ -109,7 +109,7 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
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);


+ 1
- 1
crypto/x509v3/v3_extku.c View File

@ -129,7 +129,7 @@ ASN1_OBJECT *objtmp;
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;
}


+ 1
- 1
crypto/x509v3/v3_genn.c View File

@ -220,7 +220,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
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)


+ 2
- 2
crypto/x509v3/v3_info.c View File

@ -119,7 +119,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
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;
}
@ -209,7 +209,7 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
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)


+ 1
- 1
crypto/x509v3/v3_utl.c View File

@ -80,7 +80,7 @@ int X509V3_add_value(const char *name, const char *value,
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;


+ 1
- 1
ssl/ssl_cert.c View File

@ -589,7 +589,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file)
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());


+ 1
- 1
ssl/ssl_ciph.c View File

@ -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
* 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);


+ 1
- 1
ssl/ssl_lib.c View File

@ -1036,7 +1036,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
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;


Loading…
Cancel
Save