From: Richard Levitte Date: Mon, 27 Apr 2020 06:36:53 +0000 (+0200) Subject: include/openssl/x509v3.h: restore previous stack definition arrangement X-Git-Tag: openssl-3.0.0-alpha2~142 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=01659135a1d8e042c6777886a74b682b32b28161;p=oweals%2Fopenssl.git include/openssl/x509v3.h: restore previous stack definition arrangement It turned out that configuration options may affect the definition and use of diverse stacks and how they relate to the underlying types. For example, the configuration option 'no-rfc3779' results in a build error around STACK_OF(IPAddressFamily) and related stacks. Previously, STACK_OF definitions were located near the definition of the underlying type, which are also affected by configuration options, which made this easier to maintain. We relocate the new stack definitions back to those locations for that reason. We apply the same type of relocation in other header files as well, following the general rule that it's better to use DEFINE_OR_DECLARE_STACK_OF after the type it defines a stack for has been defined. Reviewed-by: Shane Lontis Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/11655) --- diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c index 8cfdbc9fe6..8a216c49cf 100644 --- a/crypto/x509/x_x509.c +++ b/crypto/x509/x_x509.c @@ -15,7 +15,9 @@ #include #include "crypto/x509.h" +#ifndef OPENSSL_NO_RFC3779 DEFINE_STACK_OF(IPAddressFamily) +#endif ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = { ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index a5b14152a9..c9917492d5 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -120,13 +120,8 @@ extern "C" { # define SMIME_CRLFEOL 0x800 # define SMIME_STREAM 0x1000 -DEFINE_OR_DECLARE_STACK_OF(ASN1_GENERALSTRING) -DEFINE_OR_DECLARE_STACK_OF(ASN1_INTEGER) -DEFINE_OR_DECLARE_STACK_OF(ASN1_OBJECT) -DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING_TABLE) -DEFINE_OR_DECLARE_STACK_OF(ASN1_UTF8STRING) +/* Stacks for types not otherwise defined in this header */ DEFINE_OR_DECLARE_STACK_OF(X509_ALGOR) -DEFINE_OR_DECLARE_STACK_OF(ASN1_TYPE) # define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */ /* @@ -201,6 +196,7 @@ struct asn1_string_table_st { unsigned long flags; }; +DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING_TABLE) /* size limits: this stuff is taken straight from RFC2459 */ @@ -456,6 +452,7 @@ struct asn1_type_st { } value; }; +DEFINE_OR_DECLARE_STACK_OF(ASN1_TYPE) typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; @@ -509,6 +506,8 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); +DEFINE_OR_DECLARE_STACK_OF(ASN1_OBJECT) + DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT) ASN1_STRING *ASN1_STRING_new(void); @@ -543,6 +542,8 @@ int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, BIT_STRING_BITNAME *tbl); +DEFINE_OR_DECLARE_STACK_OF(ASN1_INTEGER) + DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length); @@ -576,6 +577,8 @@ int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); +DEFINE_OR_DECLARE_STACK_OF(ASN1_UTF8STRING) + DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) @@ -585,6 +588,8 @@ DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) int UTF8_getc(const unsigned char *str, int len, unsigned long *val); int UTF8_putc(unsigned char *str, int len, unsigned long value); +DEFINE_OR_DECLARE_STACK_OF(ASN1_GENERALSTRING) + DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) diff --git a/include/openssl/cmp.h b/include/openssl/cmp.h index 76ba0e3bf1..66e3f40860 100644 --- a/include/openssl/cmp.h +++ b/include/openssl/cmp.h @@ -202,12 +202,6 @@ DECLARE_ASN1_ITEM(OSSL_CMP_PKISTATUS) # define OSSL_CMP_CERTORENCCERT_CERTIFICATE 0 # define OSSL_CMP_CERTORENCCERT_ENCRYPTEDCERT 1 -DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTSTATUS) -DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_ITAV) -DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_PKISI) -DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTREPMESSAGE) -DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTRESPONSE) - /* data type declarations */ typedef struct ossl_cmp_ctx_st OSSL_CMP_CTX; typedef struct ossl_cmp_pkiheader_st OSSL_CMP_PKIHEADER; @@ -216,16 +210,21 @@ typedef struct ossl_cmp_msg_st OSSL_CMP_MSG; DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG) DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG) typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS; +DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTSTATUS) typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV; DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV) +DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_ITAV) typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT; typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI; DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI) DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI) +DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_PKISI) typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE; +DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTREPMESSAGE) typedef struct ossl_cmp_pollrep_st OSSL_CMP_POLLREP; typedef STACK_OF(OSSL_CMP_POLLREP) OSSL_CMP_POLLREPCONTENT; typedef struct ossl_cmp_certresponse_st OSSL_CMP_CERTRESPONSE; +DEFINE_OR_DECLARE_STACK_OF(OSSL_CMP_CERTRESPONSE) typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT; /* diff --git a/include/openssl/conf.h b/include/openssl/conf.h index 6a36a85b0f..24cdcbb1cf 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -34,7 +34,6 @@ typedef struct { } CONF_VALUE; DEFINE_OR_DECLARE_STACK_OF(CONF_VALUE) -DEFINE_OR_DECLARE_STACK_OF(CONF_MODULE) DEFINE_LHASH_OF(CONF_VALUE); @@ -60,6 +59,7 @@ struct conf_method_st { typedef struct conf_imodule_st CONF_IMODULE; typedef struct conf_module_st CONF_MODULE; +STACK_OF(CONF_MODULE); STACK_OF(CONF_IMODULE); /* DSO module function typedefs */ diff --git a/include/openssl/crmf.h b/include/openssl/crmf.h index 4908ebd563..28eb68258f 100644 --- a/include/openssl/crmf.h +++ b/include/openssl/crmf.h @@ -30,9 +30,6 @@ extern "C" { # endif -DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_MSG) -DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_CERTID) - # define OSSL_CRMF_POPOPRIVKEY_THISMESSAGE 0 # define OSSL_CRMF_POPOPRIVKEY_SUBSEQUENTMESSAGE 1 # define OSSL_CRMF_POPOPRIVKEY_DHMAC 2 @@ -46,6 +43,7 @@ typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE; DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE) typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG; DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG) +DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_MSG) typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE; typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER; DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER) @@ -53,6 +51,7 @@ typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY; typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST; typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID; DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID) +DEFINE_OR_DECLARE_STACK_OF(OSSL_CRMF_CERTID) typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO; DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO) diff --git a/include/openssl/ess.h b/include/openssl/ess.h index 5a31f678c1..91e1d32e63 100644 --- a/include/openssl/ess.h +++ b/include/openssl/ess.h @@ -19,16 +19,17 @@ extern "C" { # include # include -DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID) -DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID_V2) typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL; typedef struct ESS_cert_id ESS_CERT_ID; typedef struct ESS_signing_cert ESS_SIGNING_CERT; +DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID) + typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2; typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2; +DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID_V2) DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL) DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL) diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h index d40e843e8f..d5ccff0e8b 100644 --- a/include/openssl/ocsp.h +++ b/include/openssl/ocsp.h @@ -102,17 +102,15 @@ extern "C" { # define OCSP_RESPID_KEY 0x400 # define OCSP_NOTIME 0x800 -DEFINE_OR_DECLARE_STACK_OF(OCSP_CERTID) -DEFINE_OR_DECLARE_STACK_OF(OCSP_ONEREQ) -DEFINE_OR_DECLARE_STACK_OF(OCSP_RESPID) -DEFINE_OR_DECLARE_STACK_OF(OCSP_SINGLERESP) - typedef struct ocsp_cert_id_st OCSP_CERTID; typedef struct ocsp_one_request_st OCSP_ONEREQ; typedef struct ocsp_req_info_st OCSP_REQINFO; typedef struct ocsp_signature_st OCSP_SIGNATURE; typedef struct ocsp_request_st OCSP_REQUEST; +DEFINE_OR_DECLARE_STACK_OF(OCSP_CERTID) +DEFINE_OR_DECLARE_STACK_OF(OCSP_ONEREQ) + # define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 # define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 # define OCSP_RESPONSE_STATUS_INTERNALERROR 2 @@ -125,6 +123,7 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_NAME 0 # define V_OCSP_RESPID_KEY 1 +DEFINE_OR_DECLARE_STACK_OF(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -135,6 +134,7 @@ typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; typedef struct ocsp_cert_status_st OCSP_CERTSTATUS; typedef struct ocsp_single_response_st OCSP_SINGLERESP; +DEFINE_OR_DECLARE_STACK_OF(OCSP_SINGLERESP) typedef struct ocsp_response_data_st OCSP_RESPDATA; diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h index 474992e479..72a2dc643b 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h @@ -46,14 +46,14 @@ extern "C" { # define KEY_EX 0x10 # define KEY_SIG 0x80 -DEFINE_OR_DECLARE_STACK_OF(PKCS12_SAFEBAG) - typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA; typedef struct PKCS12_st PKCS12; typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG; +DEFINE_OR_DECLARE_STACK_OF(PKCS12_SAFEBAG) + typedef struct pkcs12_bag_st PKCS12_BAGS; # define PKCS12_ERROR 0 diff --git a/include/openssl/srp.h b/include/openssl/srp.h index dc7bce935e..5c8f5368f8 100644 --- a/include/openssl/srp.h +++ b/include/openssl/srp.h @@ -33,14 +33,11 @@ extern "C" { # endif -DEFINE_OR_DECLARE_STACK_OF(SRP_gN_cache) -DEFINE_OR_DECLARE_STACK_OF(SRP_user_pwd) -DEFINE_OR_DECLARE_STACK_OF(SRP_gN) - typedef struct SRP_gN_cache_st { char *b64_bn; BIGNUM *bn; } SRP_gN_cache; +DEFINE_OR_DECLARE_STACK_OF(SRP_gN_cache) typedef struct SRP_user_pwd_st { /* Owned by us. */ @@ -53,6 +50,7 @@ typedef struct SRP_user_pwd_st { /* Owned by us. */ char *info; } SRP_user_pwd; +DEFINE_OR_DECLARE_STACK_OF(SRP_user_pwd) SRP_user_pwd *SRP_user_pwd_new(void); void SRP_user_pwd_free(SRP_user_pwd *user_pwd); @@ -61,7 +59,6 @@ void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g, const BIGNUM * int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id, const char *info); int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v); - typedef struct SRP_VBASE_st { STACK_OF(SRP_user_pwd) *users_pwd; STACK_OF(SRP_gN_cache) *gN_cache; @@ -79,7 +76,7 @@ typedef struct SRP_gN_st { const BIGNUM *g; const BIGNUM *N; } SRP_gN; - +DEFINE_OR_DECLARE_STACK_OF(SRP_gN) SRP_VBASE *SRP_VBASE_new(char *seed_key); void SRP_VBASE_free(SRP_VBASE *vb); diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 551ba40046..5c2affb690 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -230,16 +230,15 @@ typedef struct tls_sigalgs_st TLS_SIGALGS; typedef struct ssl_conf_ctx_st SSL_CONF_CTX; typedef struct ssl_comp_st SSL_COMP; -DEFINE_OR_DECLARE_STACK_OF(SSL_CIPHER) -DEFINE_OR_DECLARE_STACK_OF(SSL_COMP) -DEFINE_OR_DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) -DEFINE_OR_DECLARE_STACK_OF(SSL_COMP) +STACK_OF(SSL_CIPHER); +STACK_OF(SSL_COMP); /* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/ typedef struct srtp_protection_profile_st { const char *name; unsigned long id; } SRTP_PROTECTION_PROFILE; +DEFINE_OR_DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, @@ -980,6 +979,8 @@ extern "C" { * These need to be after the above set of includes due to a compiler bug * in VisualStudio 2015 */ +DEFINE_OR_DECLARE_STACK_OF(SSL_CIPHER) +DEFINE_OR_DECLARE_STACK_OF(SSL_COMP) /* compatibility */ # define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)(arg))) diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 310980299e..d709c53ced 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -40,6 +40,11 @@ extern "C" { #endif +/* Needed stacks for types defined in other headers */ +DEFINE_OR_DECLARE_STACK_OF(X509_NAME) +DEFINE_OR_DECLARE_STACK_OF(X509) +DEFINE_OR_DECLARE_STACK_OF(X509_REVOKED) +DEFINE_OR_DECLARE_STACK_OF(X509_CRL) /* Flags for X509_get_signature_info() */ /* Signature info is valid */ @@ -77,12 +82,8 @@ typedef struct X509_val_st { typedef struct X509_sig_st X509_SIG; typedef struct X509_name_entry_st X509_NAME_ENTRY; - DEFINE_OR_DECLARE_STACK_OF(X509_NAME_ENTRY) -DEFINE_OR_DECLARE_STACK_OF(X509_NAME) -DEFINE_OR_DECLARE_STACK_OF(X509) -DEFINE_OR_DECLARE_STACK_OF(X509_REVOKED) -DEFINE_OR_DECLARE_STACK_OF(X509_CRL) + # define X509_EX_V_NETSCAPE_HACK 0x8000 # define X509_EX_V_INIT 0x0001 diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index e4f09adfce..e7d36638b2 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -25,25 +25,6 @@ extern "C" { #endif -DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAME) -DEFINE_OR_DECLARE_STACK_OF(X509V3_EXT_METHOD) -DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAMES) -DEFINE_OR_DECLARE_STACK_OF(ACCESS_DESCRIPTION) -DEFINE_OR_DECLARE_STACK_OF(DIST_POINT) -DEFINE_OR_DECLARE_STACK_OF(SXNETID) -DEFINE_OR_DECLARE_STACK_OF(POLICYQUALINFO) -DEFINE_OR_DECLARE_STACK_OF(POLICYINFO) -DEFINE_OR_DECLARE_STACK_OF(POLICY_MAPPING) -DEFINE_OR_DECLARE_STACK_OF(GENERAL_SUBTREE) -DEFINE_OR_DECLARE_STACK_OF(X509_PURPOSE) -DEFINE_OR_DECLARE_STACK_OF(X509_POLICY_NODE) -DEFINE_OR_DECLARE_STACK_OF(ASIdOrRange) -DEFINE_OR_DECLARE_STACK_OF(IPAddressOrRange) -DEFINE_OR_DECLARE_STACK_OF(IPAddressFamily) -DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING) -DEFINE_OR_DECLARE_STACK_OF(ADMISSIONS) -DEFINE_OR_DECLARE_STACK_OF(PROFESSION_INFO) - /* Forward reference */ struct v3_ext_method; struct v3_ext_ctx; @@ -116,6 +97,8 @@ struct v3_ext_ctx { typedef struct v3_ext_method X509V3_EXT_METHOD; +DEFINE_OR_DECLARE_STACK_OF(X509V3_EXT_METHOD) + /* ext_flags values */ # define X509V3_EXT_DYNAMIC 0x1 # define X509V3_EXT_CTX_DEP 0x2 @@ -180,14 +163,16 @@ typedef struct ACCESS_DESCRIPTION_st { GENERAL_NAME *location; } ACCESS_DESCRIPTION; -typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; +DEFINE_OR_DECLARE_STACK_OF(ACCESS_DESCRIPTION) +DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAME) +typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; - typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE; - typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; +DEFINE_OR_DECLARE_STACK_OF(GENERAL_NAMES) + typedef struct DIST_POINT_NAME_st { int type; union { @@ -219,6 +204,8 @@ struct DIST_POINT_st { int dp_reasons; }; +DEFINE_OR_DECLARE_STACK_OF(DIST_POINT) + typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; struct AUTHORITY_KEYID_st { @@ -234,6 +221,8 @@ typedef struct SXNET_ID_st { ASN1_OCTET_STRING *user; } SXNETID; +DEFINE_OR_DECLARE_STACK_OF(SXNETID) + typedef struct SXNET_st { ASN1_INTEGER *version; STACK_OF(SXNETID) *ids; @@ -265,11 +254,15 @@ typedef struct POLICYQUALINFO_st { } d; } POLICYQUALINFO; +DEFINE_OR_DECLARE_STACK_OF(POLICYQUALINFO) + typedef struct POLICYINFO_st { ASN1_OBJECT *policyid; STACK_OF(POLICYQUALINFO) *qualifiers; } POLICYINFO; +DEFINE_OR_DECLARE_STACK_OF(POLICYINFO) + typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; typedef struct POLICY_MAPPING_st { @@ -277,6 +270,8 @@ typedef struct POLICY_MAPPING_st { ASN1_OBJECT *subjectDomainPolicy; } POLICY_MAPPING; +DEFINE_OR_DECLARE_STACK_OF(POLICY_MAPPING) + typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; typedef struct GENERAL_SUBTREE_st { @@ -285,6 +280,8 @@ typedef struct GENERAL_SUBTREE_st { ASN1_INTEGER *maximum; } GENERAL_SUBTREE; +DEFINE_OR_DECLARE_STACK_OF(GENERAL_SUBTREE) + struct NAME_CONSTRAINTS_st { STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; @@ -423,6 +420,8 @@ typedef struct x509_purpose_st { void *usr_data; } X509_PURPOSE; +DEFINE_OR_DECLARE_STACK_OF(X509_PURPOSE) + # define X509_PURPOSE_SSL_CLIENT 1 # define X509_PURPOSE_SSL_SERVER 2 # define X509_PURPOSE_NS_SSL_SERVER 3 @@ -735,6 +734,7 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, unsigned long chtype); void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); +DEFINE_OR_DECLARE_STACK_OF(X509_POLICY_NODE) #ifndef OPENSSL_NO_RFC3779 typedef struct ASRange_st { @@ -752,6 +752,8 @@ typedef struct ASIdOrRange_st { } u; } ASIdOrRange; +DEFINE_OR_DECLARE_STACK_OF(ASIdOrRange) + typedef STACK_OF(ASIdOrRange) ASIdOrRanges; # define ASIdentifierChoice_inherit 0 @@ -789,6 +791,8 @@ typedef struct IPAddressOrRange_st { } u; } IPAddressOrRange; +DEFINE_OR_DECLARE_STACK_OF(IPAddressOrRange) + typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; # define IPAddressChoice_inherit 0 @@ -807,6 +811,8 @@ typedef struct IPAddressFamily_st { IPAddressChoice *ipAddressChoice; } IPAddressFamily; +DEFINE_OR_DECLARE_STACK_OF(IPAddressFamily) + typedef STACK_OF(IPAddressFamily) IPAddrBlocks; DECLARE_ASN1_FUNCTIONS(IPAddressRange) @@ -879,6 +885,7 @@ int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain, #endif /* OPENSSL_NO_RFC3779 */ +DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING) /* * Admission Syntax @@ -891,6 +898,8 @@ DECLARE_ASN1_FUNCTIONS(NAMING_AUTHORITY) DECLARE_ASN1_FUNCTIONS(PROFESSION_INFO) DECLARE_ASN1_FUNCTIONS(ADMISSIONS) DECLARE_ASN1_FUNCTIONS(ADMISSION_SYNTAX) +DEFINE_OR_DECLARE_STACK_OF(PROFESSION_INFO) +DEFINE_OR_DECLARE_STACK_OF(ADMISSIONS) typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS; const ASN1_OBJECT *NAMING_AUTHORITY_get0_authorityId(