diff options
author | Ben Laurie <ben@openssl.org> | 1999-05-31 21:00:25 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 1999-05-31 21:00:25 +0000 |
commit | 6d114240b921edc9c1135568392199a652acd0db (patch) | |
tree | 9803be8834ce0ece90db3798ea9cf959c91107ed | |
parent | 426edadf98dfa465329dd1501e83b0cb0be2facb (diff) | |
download | openssl-6d114240b921edc9c1135568392199a652acd0db.tar.gz |
stack.
-rw-r--r-- | apps/crl2p7.c | 6 | ||||
-rw-r--r-- | apps/pkcs7.c | 6 | ||||
-rw-r--r-- | crypto/asn1/p7_s_e.c | 9 | ||||
-rw-r--r-- | crypto/asn1/p7_signd.c | 11 | ||||
-rw-r--r-- | crypto/pkcs7/pk7_lib.c | 6 | ||||
-rw-r--r-- | crypto/pkcs7/pkcs7.h | 4 | ||||
-rw-r--r-- | crypto/x509/x509.h | 3 |
7 files changed, 26 insertions, 19 deletions
diff --git a/apps/crl2p7.c b/apps/crl2p7.c index ba4eba16bf..f4b216f68b 100644 --- a/apps/crl2p7.c +++ b/apps/crl2p7.c @@ -92,7 +92,7 @@ int MAIN(int argc, char **argv) PKCS7_SIGNED *p7s = NULL; X509_CRL *crl=NULL; STACK *certflst=NULL; - STACK *crl_stack=NULL; + STACK_OF(X509_CRL) *crl_stack=NULL; STACK_OF(X509) *cert_stack=NULL; int ret=1,nocrl=0; @@ -213,11 +213,11 @@ bad: p7s->contents->type=OBJ_nid2obj(NID_pkcs7_data); if (!ASN1_INTEGER_set(p7s->version,1)) goto end; - if ((crl_stack=sk_new(NULL)) == NULL) goto end; + if ((crl_stack=sk_X509_CRL_new(NULL)) == NULL) goto end; p7s->crl=crl_stack; if (crl != NULL) { - sk_push(crl_stack,(char *)crl); + sk_X509_CRL_push(crl_stack,crl); crl=NULL; /* now part of p7 for Freeing */ } diff --git a/apps/pkcs7.c b/apps/pkcs7.c index 24b3e57882..9518983d5d 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -222,7 +222,7 @@ bad: if (print_certs) { STACK_OF(X509) *certs=NULL; - STACK *crls=NULL; + STACK_OF(X509_CRL) *crls=NULL; i=OBJ_obj2nid(p7->type); switch (i) @@ -266,9 +266,9 @@ bad: { X509_CRL *crl; - for (i=0; i<sk_num(crls); i++) + for (i=0; i<sk_X509_CRL_num(crls); i++) { - crl=(X509_CRL *)sk_value(crls,i); + crl=sk_X509_CRL_value(crls,i); X509_NAME_oneline(crl->crl->issuer,buf,256); BIO_puts(out,"issuer= "); diff --git a/crypto/asn1/p7_s_e.c b/crypto/asn1/p7_s_e.c index bf20fd0b63..1df66ddbcb 100644 --- a/crypto/asn1/p7_s_e.c +++ b/crypto/asn1/p7_s_e.c @@ -70,7 +70,7 @@ int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp) M_ASN1_I2D_len_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); M_ASN1_I2D_len(a->enc_data,i2d_PKCS7_ENC_CONTENT); M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_len_IMP_SET_opt(a->crl,i2d_X509_CRL,1); + M_ASN1_I2D_len_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); M_ASN1_I2D_len_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO); M_ASN1_I2D_seq_total(); @@ -80,7 +80,7 @@ int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp) M_ASN1_I2D_put_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); M_ASN1_I2D_put(a->enc_data,i2d_PKCS7_ENC_CONTENT); M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_put_IMP_SET_opt(a->crl,i2d_X509_CRL,1); + M_ASN1_I2D_put_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); M_ASN1_I2D_put_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO); M_ASN1_I2D_finish(); @@ -100,7 +100,8 @@ PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a, X509_ALGOR_free); M_ASN1_D2I_get(ret->enc_data,d2i_PKCS7_ENC_CONTENT); M_ASN1_D2I_get_IMP_set_opt_type(X509,ret->cert,d2i_X509,X509_free,0); - M_ASN1_D2I_get_IMP_set_opt(ret->crl,d2i_X509_CRL,X509_CRL_free,1); + M_ASN1_D2I_get_IMP_set_opt_type(X509_CRL,ret->crl,d2i_X509_CRL, + X509_CRL_free,1); M_ASN1_D2I_get_set(ret->signer_info,d2i_PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO_free); @@ -133,7 +134,7 @@ void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a) sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free); PKCS7_ENC_CONTENT_free(a->enc_data); sk_X509_pop_free(a->cert,X509_free); - sk_pop_free(a->crl,X509_CRL_free); + sk_X509_CRL_pop_free(a->crl,X509_CRL_free); sk_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); Free((char *)a); } diff --git a/crypto/asn1/p7_signd.c b/crypto/asn1/p7_signd.c index 1dbde84d4c..f7a15a30f2 100644 --- a/crypto/asn1/p7_signd.c +++ b/crypto/asn1/p7_signd.c @@ -69,7 +69,7 @@ int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp) M_ASN1_I2D_len_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); M_ASN1_I2D_len(a->contents,i2d_PKCS7); M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_len_IMP_SET_opt(a->crl,i2d_X509_CRL,1); + M_ASN1_I2D_len_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); M_ASN1_I2D_len_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO); M_ASN1_I2D_seq_total(); @@ -78,7 +78,7 @@ int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp) M_ASN1_I2D_put_SET_type(X509_ALGOR,a->md_algs,i2d_X509_ALGOR); M_ASN1_I2D_put(a->contents,i2d_PKCS7); M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509,a->cert,i2d_X509,0); - M_ASN1_I2D_put_IMP_SET_opt(a->crl,i2d_X509_CRL,1); + M_ASN1_I2D_put_IMP_SET_opt_type(X509_CRL,a->crl,i2d_X509_CRL,1); M_ASN1_I2D_put_SET(a->signer_info,i2d_PKCS7_SIGNER_INFO); M_ASN1_I2D_finish(); @@ -96,7 +96,8 @@ PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp, X509_ALGOR_free); M_ASN1_D2I_get(ret->contents,d2i_PKCS7); M_ASN1_D2I_get_IMP_set_opt_type(X509,ret->cert,d2i_X509,X509_free,0); - M_ASN1_D2I_get_IMP_set_opt(ret->crl,d2i_X509_CRL,X509_CRL_free,1); + M_ASN1_D2I_get_IMP_set_opt_type(X509_CRL,ret->crl,d2i_X509_CRL, + X509_CRL_free,1); M_ASN1_D2I_get_set(ret->signer_info,d2i_PKCS7_SIGNER_INFO, PKCS7_SIGNER_INFO_free); @@ -126,10 +127,12 @@ void PKCS7_SIGNED_free(PKCS7_SIGNED *a) sk_X509_ALGOR_pop_free(a->md_algs,X509_ALGOR_free); PKCS7_free(a->contents); sk_X509_pop_free(a->cert,X509_free); - sk_pop_free(a->crl,X509_CRL_free); + sk_X509_CRL_pop_free(a->crl,X509_CRL_free); sk_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); Free((char *)a); } IMPLEMENT_STACK_OF(X509_ALGOR) IMPLEMENT_ASN1_SET_OF(X509_ALGOR) +IMPLEMENT_STACK_OF(X509_CRL) +IMPLEMENT_ASN1_SET_OF(X509_CRL) diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index e121ebf003..79f6f612dd 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -262,7 +262,7 @@ int PKCS7_add_certificate(PKCS7 *p7, X509 *x509) int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl) { int i; - STACK **sk; + STACK_OF(X509_CRL) **sk; i=OBJ_obj2nid(p7->type); switch (i) @@ -279,10 +279,10 @@ int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl) } if (*sk == NULL) - *sk=sk_new_null(); + *sk=sk_X509_CRL_new_null(); CRYPTO_add(&crl->references,1,CRYPTO_LOCK_X509_CRL); - sk_push(*sk,(char *)crl); + sk_X509_CRL_push(*sk,crl); return(1); } diff --git a/crypto/pkcs7/pkcs7.h b/crypto/pkcs7/pkcs7.h index 9d6ae038a4..d10a14cf7d 100644 --- a/crypto/pkcs7/pkcs7.h +++ b/crypto/pkcs7/pkcs7.h @@ -112,7 +112,7 @@ typedef struct pkcs7_signed_st ASN1_INTEGER *version; /* version 1 */ STACK_OF(X509_ALGOR) *md_algs; /* md used */ STACK_OF(X509) *cert; /* [ 0 ] */ - STACK /* X509_CRL */ *crl; /* [ 1 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ STACK /* PKCS7_SIGNER_INFO */ *signer_info; struct pkcs7_st *contents; @@ -140,7 +140,7 @@ typedef struct pkcs7_signedandenveloped_st ASN1_INTEGER *version; /* version 1 */ STACK_OF(X509_ALGOR) *md_algs; /* md used */ STACK_OF(X509) *cert; /* [ 0 ] */ - STACK /* X509_CRL */ *crl; /* [ 1 ] */ + STACK_OF(X509_CRL) *crl; /* [ 1 ] */ STACK /* PKCS7_SIGNER_INFO */ *signer_info; PKCS7_ENC_CONTENT *enc_data; diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 125dbcfe2e..d15712c561 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -275,6 +275,9 @@ typedef struct X509_crl_st int references; } X509_CRL; +DECLARE_STACK_OF(X509_CRL) +DECLARE_ASN1_SET_OF(X509_CRL) + typedef struct private_key_st { int version; |