From 858857157290dd35145b14044ae96be9cd8eb0df Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 28 Dec 2015 00:04:33 +0000 Subject: [PATCH] Rename DECLARE*STACK_OF to DEFINE*STACK_OF Applications wishing to include their own stacks now just need to include DEFINE_STACK_OF(foo) in a header file. Reviewed-by: Richard Levitte --- crypto/asn1/ameth_lib.c | 2 +- crypto/asn1/asn_mime.c | 4 ++-- crypto/async/async_locl.h | 2 +- crypto/cms/cms_lcl.h | 2 +- crypto/engine/eng_int.h | 4 ++-- crypto/evp/evp_pbe.c | 2 +- crypto/evp/pmeth_lib.c | 2 +- crypto/ex_data.c | 2 +- crypto/include/internal/ct_int.h | 2 +- crypto/lock.c | 2 +- crypto/objects/o_names.c | 2 +- crypto/objects/obj_xref.c | 2 +- crypto/store/str_mem.c | 4 ++-- crypto/ts/ts_lcl.h | 2 +- crypto/x509/by_dir.c | 4 ++-- crypto/x509/x_name.c | 2 +- crypto/x509v3/pcy_int.h | 2 +- include/openssl/asn1.h | 12 ++++++------ include/openssl/asn1t.h | 2 +- include/openssl/bio.h | 2 +- include/openssl/cms.h | 8 ++++---- include/openssl/conf.h | 6 +++--- include/openssl/crypto.h | 2 +- include/openssl/ocsp.h | 8 ++++---- include/openssl/pkcs12.h | 2 +- include/openssl/pkcs7.h | 6 +++--- include/openssl/safestack.h | 12 ++++++------ include/openssl/srp.h | 6 +++--- include/openssl/ssl.h | 4 ++-- include/openssl/store.h | 2 +- include/openssl/ts.h | 4 ++-- include/openssl/txt_db.h | 2 +- include/openssl/ui.h | 2 +- include/openssl/x509.h | 18 +++++++++--------- include/openssl/x509_vfy.h | 6 +++--- include/openssl/x509v3.h | 30 +++++++++++++++--------------- ssl/ssl_locl.h | 2 +- util/mkstack.pl | 12 ++++++------ 38 files changed, 95 insertions(+), 95 deletions(-) diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index cca4a79141..1febfe91ba 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -92,7 +92,7 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = { }; typedef int sk_cmp_fn_type(const char *const *a, const char *const *b); -DECLARE_CONST_STACK_OF(EVP_PKEY_ASN1_METHOD) +DEFINE_CONST_STACK_OF(EVP_PKEY_ASN1_METHOD) static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL; #ifdef TEST diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index ed9d8d68b7..f138db9c81 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -78,7 +78,7 @@ typedef struct { char *param_value; /* Param value e.g. "sha1" */ } MIME_PARAM; -DECLARE_STACK_OF(MIME_PARAM) +DEFINE_STACK_OF(MIME_PARAM) typedef struct { char *name; /* Name of line e.g. "content-type" */ @@ -86,7 +86,7 @@ typedef struct { STACK_OF(MIME_PARAM) *params; /* Zero or more parameters */ } MIME_HEADER; -DECLARE_STACK_OF(MIME_HEADER) +DEFINE_STACK_OF(MIME_HEADER) static int asn1_output_data(BIO *out, BIO *data, ASN1_VALUE *val, int flags, const ASN1_ITEM *it); diff --git a/crypto/async/async_locl.h b/crypto/async/async_locl.h index ffb34f82e5..2f84a78e33 100644 --- a/crypto/async/async_locl.h +++ b/crypto/async/async_locl.h @@ -87,7 +87,7 @@ struct async_job_st { OSSL_ASYNC_FD wake_fd; }; -DECLARE_STACK_OF(ASYNC_JOB) +DEFINE_STACK_OF(ASYNC_JOB) struct async_pool_st { STACK_OF(ASYNC_JOB) *jobs; diff --git a/crypto/cms/cms_lcl.h b/crypto/cms/cms_lcl.h index abc2a2741c..e4b96d26eb 100644 --- a/crypto/cms/cms_lcl.h +++ b/crypto/cms/cms_lcl.h @@ -109,7 +109,7 @@ struct CMS_ContentInfo_st { } d; }; -DECLARE_STACK_OF(CMS_CertificateChoices) +DEFINE_STACK_OF(CMS_CertificateChoices) struct CMS_SignedData_st { long version; diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h index 2a0a9d452f..8f775f5de7 100644 --- a/crypto/engine/eng_int.h +++ b/crypto/engine/eng_int.h @@ -106,12 +106,12 @@ typedef void (ENGINE_CLEANUP_CB) (void); typedef struct st_engine_cleanup_item { ENGINE_CLEANUP_CB *cb; } ENGINE_CLEANUP_ITEM; -DECLARE_STACK_OF(ENGINE_CLEANUP_ITEM) +DEFINE_STACK_OF(ENGINE_CLEANUP_ITEM) void engine_cleanup_add_first(ENGINE_CLEANUP_CB *cb); void engine_cleanup_add_last(ENGINE_CLEANUP_CB *cb); /* We need stacks of ENGINEs for use in eng_table.c */ -DECLARE_STACK_OF(ENGINE) +DEFINE_STACK_OF(ENGINE) /* * If this symbol is defined then engine_table_select(), the function that is diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c index dc908f804e..731ae91a7a 100644 --- a/crypto/evp/evp_pbe.c +++ b/crypto/evp/evp_pbe.c @@ -76,7 +76,7 @@ typedef struct { EVP_PBE_KEYGEN *keygen; } EVP_PBE_CTL; -DECLARE_STACK_OF(EVP_PBE_CTL) +DEFINE_STACK_OF(EVP_PBE_CTL) static STACK_OF(EVP_PBE_CTL) *pbe_algs; static const EVP_PBE_CTL builtin_pbe[] = { diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index e880cfa37d..aaba42aa1f 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -69,7 +69,7 @@ typedef int sk_cmp_fn_type(const char *const *a, const char *const *b); -DECLARE_CONST_STACK_OF(EVP_PKEY_METHOD) +DEFINE_CONST_STACK_OF(EVP_PKEY_METHOD) static STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL; static const EVP_PKEY_METHOD *standard_methods[] = { diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 5bf8e1e5cd..76e4b3b6a2 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -125,7 +125,7 @@ typedef struct ex_callback_st { CRYPTO_EX_dup *dup_func; } EX_CALLBACK; -DECLARE_STACK_OF(EX_CALLBACK) +DEFINE_STACK_OF(EX_CALLBACK) /* * The state for each class. This could just be a typedef, but diff --git a/crypto/include/internal/ct_int.h b/crypto/include/internal/ct_int.h index 2d8e045cdf..31411b62be 100644 --- a/crypto/include/internal/ct_int.h +++ b/crypto/include/internal/ct_int.h @@ -114,7 +114,7 @@ typedef struct { log_entry_type_t entry_type; } SCT; -DECLARE_STACK_OF(SCT) +DEFINE_STACK_OF(SCT) /* * Allocate new SCT. diff --git a/crypto/lock.c b/crypto/lock.c index f337c0d8de..ec01a815ba 100644 --- a/crypto/lock.c +++ b/crypto/lock.c @@ -121,7 +121,7 @@ static double OpenSSL_MSVC5_hack = 0.0; /* and for VC1.5 */ #endif -DECLARE_STACK_OF(CRYPTO_dynlock) +DEFINE_STACK_OF(CRYPTO_dynlock) /* real #defines in crypto.h, keep these upto date */ static const char *const lock_names[CRYPTO_NUM_LOCKS] = { diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index d7441cad82..0839feeee6 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -34,7 +34,7 @@ typedef struct name_funcs_st { void (*free_func) (const char *, int, const char *); } NAME_FUNCS; -DECLARE_STACK_OF(NAME_FUNCS) +DEFINE_STACK_OF(NAME_FUNCS) static STACK_OF(NAME_FUNCS) *name_funcs_stack; diff --git a/crypto/objects/obj_xref.c b/crypto/objects/obj_xref.c index 6e35f5746f..15426fe342 100644 --- a/crypto/objects/obj_xref.c +++ b/crypto/objects/obj_xref.c @@ -61,7 +61,7 @@ #include "obj_xref.h" #include "e_os.h" -DECLARE_STACK_OF(nid_triple) +DEFINE_STACK_OF(nid_triple) static STACK_OF(nid_triple) *sig_app, *sigx_app; diff --git a/crypto/store/str_mem.c b/crypto/store/str_mem.c index dd71a1955d..1ffa4b01a4 100644 --- a/crypto/store/str_mem.c +++ b/crypto/store/str_mem.c @@ -83,7 +83,7 @@ typedef struct mem_object_data_st { int references; } MEM_OBJECT_DATA; -DECLARE_STACK_OF(MEM_OBJECT_DATA) +DEFINE_STACK_OF(MEM_OBJECT_DATA) struct mem_data_st { /* * sorted with @@ -98,7 +98,7 @@ struct mem_data_st { unsigned int compute_components:1; }; -DECLARE_STACK_OF(STORE_ATTR_INFO) +DEFINE_STACK_OF(STORE_ATTR_INFO) struct mem_ctx_st { /* The type we're searching for */ int type; diff --git a/crypto/ts/ts_lcl.h b/crypto/ts/ts_lcl.h index da28ef1cb9..e3f915c795 100644 --- a/crypto/ts/ts_lcl.h +++ b/crypto/ts/ts_lcl.h @@ -144,7 +144,7 @@ struct TS_status_info_st { ASN1_BIT_STRING *failure_info; }; -DECLARE_STACK_OF(ASN1_UTF8STRING) +DEFINE_STACK_OF(ASN1_UTF8STRING) /*- * IssuerSerial ::= SEQUENCE { diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 8310bc4701..7e49daadfd 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -90,8 +90,8 @@ typedef struct lookup_dir_st { STACK_OF(BY_DIR_ENTRY) *dirs; } BY_DIR; -DECLARE_STACK_OF(BY_DIR_HASH) -DECLARE_STACK_OF(BY_DIR_ENTRY) +DEFINE_STACK_OF(BY_DIR_HASH) +DEFINE_STACK_OF(BY_DIR_ENTRY) static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, char **ret); diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index 2895734cc1..c12b248f3a 100644 --- a/crypto/x509/x_name.c +++ b/crypto/x509/x_name.c @@ -65,7 +65,7 @@ #include "internal/asn1_int.h" typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY; -DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY) +DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY) static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, diff --git a/crypto/x509v3/pcy_int.h b/crypto/x509v3/pcy_int.h index cbc94c0419..b222557c52 100644 --- a/crypto/x509v3/pcy_int.h +++ b/crypto/x509v3/pcy_int.h @@ -59,7 +59,7 @@ typedef struct X509_POLICY_DATA_st X509_POLICY_DATA; -DECLARE_STACK_OF(X509_POLICY_DATA) +DEFINE_STACK_OF(X509_POLICY_DATA) /* Internal structures */ diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index 076886974f..e80b376e01 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -157,7 +157,7 @@ extern "C" { # define SMIME_CRLFEOL 0x800 # define SMIME_STREAM 0x1000 struct X509_algor_st; -DECLARE_STACK_OF(X509_ALGOR) +DEFINE_STACK_OF(X509_ALGOR) # define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */ /* @@ -230,7 +230,7 @@ typedef struct asn1_string_table_st { unsigned long flags; } ASN1_STRING_TABLE; -DECLARE_STACK_OF(ASN1_STRING_TABLE) +DEFINE_STACK_OF(ASN1_STRING_TABLE) /* size limits: this stuff is taken straight from RFC2459 */ @@ -469,9 +469,9 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void); ASN1_STRFLGS_DUMP_UNKNOWN | \ ASN1_STRFLGS_DUMP_DER) -DECLARE_STACK_OF(ASN1_INTEGER) +DEFINE_STACK_OF(ASN1_INTEGER) -DECLARE_STACK_OF(ASN1_GENERALSTRING) +DEFINE_STACK_OF(ASN1_GENERALSTRING) typedef struct asn1_type_st { int type; @@ -504,7 +504,7 @@ typedef struct asn1_type_st { } value; } ASN1_TYPE; -DECLARE_STACK_OF(ASN1_TYPE) +DEFINE_STACK_OF(ASN1_TYPE) typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; @@ -565,7 +565,7 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, DECLARE_ASN1_ITEM(ASN1_OBJECT) -DECLARE_STACK_OF(ASN1_OBJECT) +DEFINE_STACK_OF(ASN1_OBJECT) ASN1_STRING *ASN1_STRING_new(void); void ASN1_STRING_free(ASN1_STRING *a); diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index f0244dc254..4750b34e0c 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -964,7 +964,7 @@ DECLARE_ASN1_ITEM(BIGNUM) DECLARE_ASN1_ITEM(LONG) DECLARE_ASN1_ITEM(ZLONG) -DECLARE_STACK_OF(ASN1_VALUE) +DEFINE_STACK_OF(ASN1_VALUE) /* Functions used internally by the ASN1 code */ diff --git a/include/openssl/bio.h b/include/openssl/bio.h index a0a799b7dc..6d6fb35f1b 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h @@ -328,7 +328,7 @@ struct bio_st { CRYPTO_EX_DATA ex_data; }; -DECLARE_STACK_OF(BIO) +DEFINE_STACK_OF(BIO) typedef struct bio_f_buffer_ctx_struct { /*- diff --git a/include/openssl/cms.h b/include/openssl/cms.h index 9cbfaf58ce..92c43a22eb 100644 --- a/include/openssl/cms.h +++ b/include/openssl/cms.h @@ -76,10 +76,10 @@ typedef struct CMS_Receipt_st CMS_Receipt; typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey; typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute; -DECLARE_STACK_OF(CMS_SignerInfo) -DECLARE_STACK_OF(CMS_RecipientEncryptedKey) -DECLARE_STACK_OF(CMS_RecipientInfo) -DECLARE_STACK_OF(CMS_RevocationInfoChoice) +DEFINE_STACK_OF(CMS_SignerInfo) +DEFINE_STACK_OF(CMS_RecipientEncryptedKey) +DEFINE_STACK_OF(CMS_RecipientInfo) +DEFINE_STACK_OF(CMS_RevocationInfoChoice) DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest) DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) diff --git a/include/openssl/conf.h b/include/openssl/conf.h index c1114647dc..118307270f 100644 --- a/include/openssl/conf.h +++ b/include/openssl/conf.h @@ -77,7 +77,7 @@ typedef struct { char *value; } CONF_VALUE; -DECLARE_STACK_OF(CONF_VALUE) +DEFINE_STACK_OF(CONF_VALUE) DECLARE_LHASH_OF(CONF_VALUE); struct conf_st; @@ -102,8 +102,8 @@ struct conf_method_st { typedef struct conf_imodule_st CONF_IMODULE; typedef struct conf_module_st CONF_MODULE; -DECLARE_STACK_OF(CONF_MODULE) -DECLARE_STACK_OF(CONF_IMODULE) +DEFINE_STACK_OF(CONF_MODULE) +DEFINE_STACK_OF(CONF_IMODULE) /* DSO module function typedefs */ typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 0d88a06f63..a5e5b1749b 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -257,7 +257,7 @@ typedef struct bio_st BIO_dummy; struct crypto_ex_data_st { STACK_OF(void) *sk; }; -DECLARE_STACK_OF(void) +DEFINE_STACK_OF(void) /* * Per class, we have a STACK of function pointers. diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h index 79b4c375d5..3ccd79f148 100644 --- a/include/openssl/ocsp.h +++ b/include/openssl/ocsp.h @@ -95,11 +95,11 @@ extern "C" { typedef struct ocsp_cert_id_st OCSP_CERTID; -DECLARE_STACK_OF(OCSP_CERTID) +DEFINE_STACK_OF(OCSP_CERTID) typedef struct ocsp_one_request_st OCSP_ONEREQ; -DECLARE_STACK_OF(OCSP_ONEREQ) +DEFINE_STACK_OF(OCSP_ONEREQ) typedef struct ocsp_req_info_st OCSP_REQINFO; typedef struct ocsp_signature_st OCSP_SIGNATURE; @@ -117,7 +117,7 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_NAME 0 # define V_OCSP_RESPID_KEY 1 -DECLARE_STACK_OF(OCSP_RESPID) +DEFINE_STACK_OF(OCSP_RESPID) DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -129,7 +129,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; -DECLARE_STACK_OF(OCSP_SINGLERESP) +DEFINE_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 ba8b9441a9..d49cac7e0d 100644 --- a/include/openssl/pkcs12.h +++ b/include/openssl/pkcs12.h @@ -123,7 +123,7 @@ typedef struct { STACK_OF(X509_ATTRIBUTE) *attrib; } PKCS12_SAFEBAG; -DECLARE_STACK_OF(PKCS12_SAFEBAG) +DEFINE_STACK_OF(PKCS12_SAFEBAG) typedef struct pkcs12_bag_st { ASN1_OBJECT *type; diff --git a/include/openssl/pkcs7.h b/include/openssl/pkcs7.h index 5d5d5c2d07..46fe45eacb 100644 --- a/include/openssl/pkcs7.h +++ b/include/openssl/pkcs7.h @@ -100,7 +100,7 @@ typedef struct pkcs7_signer_info_st { EVP_PKEY *pkey; } PKCS7_SIGNER_INFO; -DECLARE_STACK_OF(PKCS7_SIGNER_INFO) +DEFINE_STACK_OF(PKCS7_SIGNER_INFO) typedef struct pkcs7_recip_info_st { ASN1_INTEGER *version; /* version 0 */ @@ -110,7 +110,7 @@ typedef struct pkcs7_recip_info_st { X509 *cert; /* get the pub-key from this */ } PKCS7_RECIP_INFO; -DECLARE_STACK_OF(PKCS7_RECIP_INFO) +DEFINE_STACK_OF(PKCS7_RECIP_INFO) typedef struct pkcs7_signed_st { ASN1_INTEGER *version; /* version 1 */ @@ -197,7 +197,7 @@ typedef struct pkcs7_st { } d; } PKCS7; -DECLARE_STACK_OF(PKCS7) +DEFINE_STACK_OF(PKCS7) # define PKCS7_OP_SET_DETACHED_SIGNATURE 1 # define PKCS7_OP_GET_DETACHED_SIGNATURE 2 diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h index 9bd424ab28..5a786590ab 100644 --- a/include/openssl/safestack.h +++ b/include/openssl/safestack.h @@ -88,7 +88,7 @@ extern "C" { # define STACK_OF(type) struct stack_st_##type -# define SKM_DECLARE_STACK_OF(t1, t2, t3) \ +# define SKM_DEFINE_STACK_OF(t1, t2, t3) \ STACK_OF(t1); \ static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \ { \ @@ -183,9 +183,9 @@ extern "C" { return (int (*)(const t3 * const *,const t3 * const *))sk_set_cmp_func((_STACK *)sk, (int (*)(const void *a, const void *b))cmpf); \ } -# define DECLARE_SPECIAL_STACK_OF(t1, t2) SKM_DECLARE_STACK_OF(t1, t2, t2) -# define DECLARE_STACK_OF(t) SKM_DECLARE_STACK_OF(t, t, t) -# define DECLARE_CONST_STACK_OF(t) SKM_DECLARE_STACK_OF(t, const t, t) +# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) +# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) +# define DEFINE_CONST_STACK_OF(t) SKM_DEFINE_STACK_OF(t, const t, t) /*- * Strings are special: normally an lhash entry will point to a single @@ -211,14 +211,14 @@ typedef const char *OPENSSL_CSTRING; * chars. So, we have to implement STRING specially for STACK_OF. This is * dealt with in the autogenerated macros below. */ -DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) +DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) /* * Similarly, we sometimes use a block of characters, NOT nul-terminated. * These should also be distinguished from "normal" stacks. */ typedef void *OPENSSL_BLOCK; -DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) +DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) /* * This file is automatically generated by util/mkstack.pl diff --git a/include/openssl/srp.h b/include/openssl/srp.h index 3411fe571e..b7f4519fd3 100644 --- a/include/openssl/srp.h +++ b/include/openssl/srp.h @@ -83,7 +83,7 @@ typedef struct SRP_gN_cache_st { } SRP_gN_cache; -DECLARE_STACK_OF(SRP_gN_cache) +DEFINE_STACK_OF(SRP_gN_cache) typedef struct SRP_user_pwd_st { char *id; @@ -94,7 +94,7 @@ typedef struct SRP_user_pwd_st { char *info; } SRP_user_pwd; -DECLARE_STACK_OF(SRP_user_pwd) +DEFINE_STACK_OF(SRP_user_pwd) typedef struct SRP_VBASE_st { STACK_OF(SRP_user_pwd) *users_pwd; @@ -114,7 +114,7 @@ typedef struct SRP_gN_st { BIGNUM *N; } SRP_gN; -DECLARE_STACK_OF(SRP_gN) +DEFINE_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 b2e9209752..62325c5b35 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -325,7 +325,7 @@ typedef struct ssl_session_st SSL_SESSION; typedef struct tls_sigalgs_st TLS_SIGALGS; typedef struct ssl_conf_ctx_st SSL_CONF_CTX; -DECLARE_CONST_STACK_OF(SSL_CIPHER) +DEFINE_CONST_STACK_OF(SSL_CIPHER) DECLARE_STACK_OF(danetls_record) @@ -335,7 +335,7 @@ typedef struct srtp_protection_profile_st { unsigned long id; } SRTP_PROTECTION_PROFILE; -DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) +DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE) typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s, const unsigned char *data, diff --git a/include/openssl/store.h b/include/openssl/store.h index ffcf9810fb..cc4683e369 100644 --- a/include/openssl/store.h +++ b/include/openssl/store.h @@ -244,7 +244,7 @@ typedef struct STORE_OBJECT_st { BUF_MEM *arbitrary; } data; } STORE_OBJECT; -DECLARE_STACK_OF(STORE_OBJECT) +DEFINE_STACK_OF(STORE_OBJECT) STORE_OBJECT *STORE_OBJECT_new(void); void STORE_OBJECT_free(STORE_OBJECT *data); diff --git a/include/openssl/ts.h b/include/openssl/ts.h index 3d4e4c0633..1c54b4df9b 100644 --- a/include/openssl/ts.h +++ b/include/openssl/ts.h @@ -122,7 +122,7 @@ typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL; typedef struct ESS_cert_id ESS_CERT_ID; typedef struct ESS_signing_cert ESS_SIGNING_CERT; -DECLARE_STACK_OF(ESS_CERT_ID) +DEFINE_STACK_OF(ESS_CERT_ID) typedef struct TS_resp_st TS_RESP; @@ -359,7 +359,7 @@ typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *, typedef struct TS_resp_ctx TS_RESP_CTX; -DECLARE_STACK_OF(EVP_MD) +DEFINE_STACK_OF(EVP_MD) /* Creates a response context that can be used for generating responses. */ TS_RESP_CTX *TS_RESP_CTX_new(void); diff --git a/include/openssl/txt_db.h b/include/openssl/txt_db.h index 0e49a54f3d..948ac3e77f 100644 --- a/include/openssl/txt_db.h +++ b/include/openssl/txt_db.h @@ -77,7 +77,7 @@ extern "C" { #endif typedef OPENSSL_STRING *OPENSSL_PSTRING; -DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) +DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) typedef struct txt_db_st { int num_fields; diff --git a/include/openssl/ui.h b/include/openssl/ui.h index 5cf7672a70..3b4b372d74 100644 --- a/include/openssl/ui.h +++ b/include/openssl/ui.h @@ -303,7 +303,7 @@ UI_METHOD *UI_OpenSSL(void); * about a string or a prompt, including test data for a verification prompt. */ typedef struct ui_string_st UI_STRING; -DECLARE_STACK_OF(UI_STRING) +DEFINE_STACK_OF(UI_STRING) /* * The different types of strings that are currently supported. This is only diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 4133fc1e74..0b00abfc2a 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -142,9 +142,9 @@ typedef struct X509_sig_st { typedef struct X509_name_entry_st X509_NAME_ENTRY; -DECLARE_STACK_OF(X509_NAME_ENTRY) +DEFINE_STACK_OF(X509_NAME_ENTRY) -DECLARE_STACK_OF(X509_NAME) +DEFINE_STACK_OF(X509_NAME) # define X509_EX_V_NETSCAPE_HACK 0x8000 # define X509_EX_V_INIT 0x0001 @@ -152,11 +152,11 @@ typedef struct X509_extension_st X509_EXTENSION; typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; -DECLARE_STACK_OF(X509_EXTENSION) +DEFINE_STACK_OF(X509_EXTENSION) typedef struct x509_attributes_st X509_ATTRIBUTE; -DECLARE_STACK_OF(X509_ATTRIBUTE) +DEFINE_STACK_OF(X509_ATTRIBUTE) typedef struct X509_req_info_st X509_REQ_INFO; @@ -166,7 +166,7 @@ typedef struct x509_cert_aux_st X509_CERT_AUX; typedef struct x509_cinf_st X509_CINF; -DECLARE_STACK_OF(X509) +DEFINE_STACK_OF(X509) /* This is used for a table of trust checking functions */ @@ -179,7 +179,7 @@ typedef struct x509_trust_st { void *arg2; } X509_TRUST; -DECLARE_STACK_OF(X509_TRUST) +DEFINE_STACK_OF(X509_TRUST) /* standard trust ids */ @@ -285,11 +285,11 @@ DECLARE_STACK_OF(X509_TRUST) XN_FLAG_FN_LN | \ XN_FLAG_FN_ALIGN) -DECLARE_STACK_OF(X509_REVOKED) +DEFINE_STACK_OF(X509_REVOKED) typedef struct X509_crl_info_st X509_CRL_INFO; -DECLARE_STACK_OF(X509_CRL) +DEFINE_STACK_OF(X509_CRL) typedef struct private_key_st { int version; @@ -317,7 +317,7 @@ typedef struct X509_info_st { int references; } X509_INFO; -DECLARE_STACK_OF(X509_INFO) +DEFINE_STACK_OF(X509_INFO) /* * The next 2 structures and their 8 routines were sent to me by Pat Richard diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index e37c2f7f60..c96ab6862b 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -120,8 +120,8 @@ typedef struct x509_object_st { typedef struct x509_lookup_st X509_LOOKUP; -DECLARE_STACK_OF(X509_LOOKUP) -DECLARE_STACK_OF(X509_OBJECT) +DEFINE_STACK_OF(X509_LOOKUP) +DEFINE_STACK_OF(X509_OBJECT) /* This is a static that defines the function interface */ typedef struct x509_lookup_method_st { @@ -145,7 +145,7 @@ typedef struct x509_lookup_method_st { typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; -DECLARE_STACK_OF(X509_VERIFY_PARAM) +DEFINE_STACK_OF(X509_VERIFY_PARAM) /* * This is used to hold everything. It is used for all certificate diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index 76d3c1f57e..b5ea84af9b 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -145,7 +145,7 @@ struct v3_ext_ctx { typedef struct v3_ext_method X509V3_EXT_METHOD; -DECLARE_STACK_OF(X509V3_EXT_METHOD) +DEFINE_STACK_OF(X509V3_EXT_METHOD) /* ext_flags values */ # define X509V3_EXT_DYNAMIC 0x1 @@ -217,11 +217,11 @@ typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE; -DECLARE_STACK_OF(GENERAL_NAME) +DEFINE_STACK_OF(GENERAL_NAME) typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; -DECLARE_STACK_OF(GENERAL_NAMES) +DEFINE_STACK_OF(GENERAL_NAMES) -DECLARE_STACK_OF(ACCESS_DESCRIPTION) +DEFINE_STACK_OF(ACCESS_DESCRIPTION) typedef struct DIST_POINT_NAME_st { int type; @@ -256,7 +256,7 @@ struct DIST_POINT_st { typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; -DECLARE_STACK_OF(DIST_POINT) +DEFINE_STACK_OF(DIST_POINT) struct AUTHORITY_KEYID_st { ASN1_OCTET_STRING *keyid; @@ -271,7 +271,7 @@ typedef struct SXNET_ID_st { ASN1_OCTET_STRING *user; } SXNETID; -DECLARE_STACK_OF(SXNETID) +DEFINE_STACK_OF(SXNETID) typedef struct SXNET_st { ASN1_INTEGER *version; @@ -297,7 +297,7 @@ typedef struct POLICYQUALINFO_st { } d; } POLICYQUALINFO; -DECLARE_STACK_OF(POLICYQUALINFO) +DEFINE_STACK_OF(POLICYQUALINFO) typedef struct POLICYINFO_st { ASN1_OBJECT *policyid; @@ -306,14 +306,14 @@ typedef struct POLICYINFO_st { typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; -DECLARE_STACK_OF(POLICYINFO) +DEFINE_STACK_OF(POLICYINFO) typedef struct POLICY_MAPPING_st { ASN1_OBJECT *issuerDomainPolicy; ASN1_OBJECT *subjectDomainPolicy; } POLICY_MAPPING; -DECLARE_STACK_OF(POLICY_MAPPING) +DEFINE_STACK_OF(POLICY_MAPPING) typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; @@ -323,7 +323,7 @@ typedef struct GENERAL_SUBTREE_st { ASN1_INTEGER *maximum; } GENERAL_SUBTREE; -DECLARE_STACK_OF(GENERAL_SUBTREE) +DEFINE_STACK_OF(GENERAL_SUBTREE) struct NAME_CONSTRAINTS_st { STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; @@ -497,7 +497,7 @@ typedef struct x509_purpose_st { # define X509V3_ADD_DELETE 5L # define X509V3_ADD_SILENT 0x10 -DECLARE_STACK_OF(X509_PURPOSE) +DEFINE_STACK_OF(X509_PURPOSE) DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) @@ -760,7 +760,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); -DECLARE_STACK_OF(X509_POLICY_NODE) +DEFINE_STACK_OF(X509_POLICY_NODE) #ifndef OPENSSL_NO_RFC3779 typedef struct ASRange_st { @@ -779,7 +779,7 @@ typedef struct ASIdOrRange_st { } ASIdOrRange; typedef STACK_OF(ASIdOrRange) ASIdOrRanges; -DECLARE_STACK_OF(ASIdOrRange) +DEFINE_STACK_OF(ASIdOrRange) # define ASIdentifierChoice_inherit 0 # define ASIdentifierChoice_asIdsOrRanges 1 @@ -817,7 +817,7 @@ typedef struct IPAddressOrRange_st { } IPAddressOrRange; typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; -DECLARE_STACK_OF(IPAddressOrRange) +DEFINE_STACK_OF(IPAddressOrRange) # define IPAddressChoice_inherit 0 # define IPAddressChoice_addressesOrRanges 1 @@ -836,7 +836,7 @@ typedef struct IPAddressFamily_st { } IPAddressFamily; typedef STACK_OF(IPAddressFamily) IPAddrBlocks; -DECLARE_STACK_OF(IPAddressFamily) +DEFINE_STACK_OF(IPAddressFamily) DECLARE_ASN1_FUNCTIONS(IPAddressRange) DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 6734c4df83..a9d4f54ef1 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -693,7 +693,7 @@ struct ssl_comp_st { COMP_METHOD *method; }; -DECLARE_STACK_OF(SSL_COMP) +DEFINE_STACK_OF(SSL_COMP) DECLARE_LHASH_OF(SSL_SESSION); diff --git a/util/mkstack.pl b/util/mkstack.pl index 6fb577dba7..c2a7ee43ea 100755 --- a/util/mkstack.pl +++ b/util/mkstack.pl @@ -117,7 +117,7 @@ extern "C" { # define STACK_OF(type) struct stack_st_##type -# define SKM_DECLARE_STACK_OF(t1, t2, t3) \ +# define SKM_DEFINE_STACK_OF(t1, t2, t3) \ STACK_OF(t1); \ static ossl_inline int sk_##t1##_num(const STACK_OF(t1) *sk) \ { \ @@ -212,9 +212,9 @@ extern "C" { return (int (*)(const t3 * const *,const t3 * const *))sk_set_cmp_func((_STACK *)sk, (int (*)(const void *a, const void *b))cmpf); \ } -# define DECLARE_SPECIAL_STACK_OF(t1, t2) SKM_DECLARE_STACK_OF(t1, t2, t2) -# define DECLARE_STACK_OF(t) SKM_DECLARE_STACK_OF(t, t, t) -# define DECLARE_CONST_STACK_OF(t) SKM_DECLARE_STACK_OF(t, const t, t) +# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2) +# define DEFINE_STACK_OF(t) SKM_DEFINE_STACK_OF(t, t, t) +# define DEFINE_CONST_STACK_OF(t) SKM_DEFINE_STACK_OF(t, const t, t) /*- * Strings are special: normally an lhash entry will point to a single @@ -240,14 +240,14 @@ typedef const char *OPENSSL_CSTRING; * chars. So, we have to implement STRING specially for STACK_OF. This is * dealt with in the autogenerated macros below. */ -DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) +DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char) /* * Similarly, we sometimes use a block of characters, NOT nul-terminated. * These should also be distinguished from "normal" stacks. */ typedef void *OPENSSL_BLOCK; -DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) +DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) /* * This file is automatically generated by util/mkstack.pl -- 2.25.1