In OpenSSL builds, declare STACK for datatypes ...
authorRich Salz <rsalz@akamai.com>
Thu, 19 Dec 2019 22:30:24 +0000 (17:30 -0500)
committerTomas Mraz <tmraz@fedoraproject.org>
Fri, 24 Apr 2020 14:42:46 +0000 (16:42 +0200)
... and only *define* them in the source files that need them.
Use DEFINE_OR_DECLARE which is set appropriately for internal builds
and not non-deprecated builds.

Deprecate stack-of-block

Better documentation

Move some ASN1 struct typedefs to types.h

Update ParseC to handle this.  Most of all, ParseC needed to be more
consistent.  The handlers are "recursive", in so far that they are called
again and again until they terminate, which depends entirely on what the
"massager" returns.  There's a comment at the beginning of ParseC that
explains how that works. {Richard Levtte}

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10669)

227 files changed:
CHANGES.md
Configurations/00-base-templates.conf
apps/asn1pars.c
apps/ca.c
apps/ciphers.c
apps/cmp_mock_srv.c
apps/cms.c
apps/crl2p7.c
apps/dgst.c
apps/engine.c
apps/fipsinstall.c
apps/kdf.c
apps/lib/apps.c
apps/lib/names.c
apps/lib/s_cb.c
apps/list.c
apps/mac.c
apps/nseq.c
apps/ocsp.c
apps/pkcs12.c
apps/pkcs7.c
apps/pkeyutl.c
apps/provider.c
apps/rehash.c
apps/req.c
apps/s_client.c
apps/s_server.c
apps/smime.c
apps/verify.c
apps/x509.c
crypto/asn1/a_strnid.c
crypto/asn1/asn1_gen.c
crypto/asn1/asn1_lib.c
crypto/asn1/asn_mime.c
crypto/asn1/asn_moid.c
crypto/asn1/asn_mstbl.c
crypto/asn1/d2i_pr.c
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c
crypto/cmp/cmp_asn.c
crypto/cmp/cmp_client.c
crypto/cmp/cmp_ctx.c
crypto/cmp/cmp_hdr.c
crypto/cmp/cmp_http.c
crypto/cmp/cmp_msg.c
crypto/cmp/cmp_protect.c
crypto/cmp/cmp_server.c
crypto/cmp/cmp_status.c
crypto/cmp/cmp_util.c
crypto/cmp/cmp_vfy.c
crypto/cms/cms_env.c
crypto/cms/cms_ess.c
crypto/cms/cms_kari.c
crypto/cms/cms_lib.c
crypto/cms/cms_pwri.c
crypto/cms/cms_sd.c
crypto/cms/cms_smime.c
crypto/conf/conf_api.c
crypto/conf/conf_def.c
crypto/conf/conf_mod.c
crypto/conf/conf_ssl.c
crypto/crmf/crmf_lib.c
crypto/ct/ct_log.c
crypto/ct/ct_oct.c
crypto/ct/ct_prn.c
crypto/ct/ct_sct.c
crypto/ct/ct_x509v3.c
crypto/dso/dso_dlfcn.c
crypto/dso/dso_lib.c
crypto/dso/dso_win32.c
crypto/engine/eng_cnf.c
crypto/engine/eng_dyn.c
crypto/ess/ess_lib.c
crypto/evp/evp_cnf.c
crypto/evp/p_lib.c
crypto/ex_data.c
crypto/http/http_client.c
crypto/ocsp/ocsp_cl.c
crypto/ocsp/ocsp_ext.c
crypto/ocsp/ocsp_prn.c
crypto/ocsp/ocsp_srv.c
crypto/ocsp/ocsp_vfy.c
crypto/ocsp/v3_ocsp.c
crypto/pem/pem_info.c
crypto/pkcs12/p12_crt.c
crypto/pkcs12/p12_kiss.c
crypto/pkcs12/p12_npas.c
crypto/pkcs7/pk7_attr.c
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_lib.c
crypto/pkcs7/pk7_smime.c
crypto/provider_conf.c
crypto/srp/srp_vfy.c
crypto/store/loader_file.c
crypto/ts/ts_conf.c
crypto/ts/ts_req_utils.c
crypto/ts/ts_rsp_print.c
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_utils.c
crypto/ts/ts_rsp_verify.c
crypto/ts/ts_verify_ctx.c
crypto/ui/ui_lib.c
crypto/x509/by_dir.c
crypto/x509/by_file.c
crypto/x509/by_store.c
crypto/x509/pcy_cache.c
crypto/x509/pcy_data.c
crypto/x509/pcy_lib.c
crypto/x509/pcy_map.c
crypto/x509/pcy_node.c
crypto/x509/pcy_tree.c
crypto/x509/t_crl.c
crypto/x509/t_req.c
crypto/x509/t_x509.c
crypto/x509/v3_addr.c
crypto/x509/v3_admis.c
crypto/x509/v3_akey.c
crypto/x509/v3_alt.c
crypto/x509/v3_asid.c
crypto/x509/v3_bcons.c
crypto/x509/v3_bitst.c
crypto/x509/v3_conf.c
crypto/x509/v3_cpols.c
crypto/x509/v3_crld.c
crypto/x509/v3_extku.c
crypto/x509/v3_info.c
crypto/x509/v3_ist.c
crypto/x509/v3_lib.c
crypto/x509/v3_ncons.c
crypto/x509/v3_pci.c
crypto/x509/v3_pcons.c
crypto/x509/v3_pmaps.c
crypto/x509/v3_prn.c
crypto/x509/v3_purp.c
crypto/x509/v3_sxnet.c
crypto/x509/v3_tlsf.c
crypto/x509/v3_utl.c
crypto/x509/x509_att.c
crypto/x509/x509_cmp.c
crypto/x509/x509_lu.c
crypto/x509/x509_obj.c
crypto/x509/x509_r2x.c
crypto/x509/x509_trs.c
crypto/x509/x509_v3.c
crypto/x509/x509_vfy.c
crypto/x509/x509_vpm.c
crypto/x509/x509cset.c
crypto/x509/x509name.c
crypto/x509/x_attrib.c
crypto/x509/x_crl.c
crypto/x509/x_name.c
crypto/x509/x_req.c
crypto/x509/x_x509.c
crypto/x509/x_x509a.c
doc/man3/DEFINE_STACK_OF.pod
engines/e_capi.c
fuzz/client.c
fuzz/cmp.c
fuzz/server.c
include/openssl/asn1.h
include/openssl/asn1t.h
include/openssl/bio.h
include/openssl/cmp.h
include/openssl/cms.h
include/openssl/conf.h
include/openssl/crmf.h
include/openssl/crypto.h
include/openssl/ct.h
include/openssl/ess.h
include/openssl/ocsp.h
include/openssl/pkcs12.h
include/openssl/pkcs7.h
include/openssl/safestack.h
include/openssl/srp.h
include/openssl/ssl.h
include/openssl/ts.h
include/openssl/types.h
include/openssl/ui.h
include/openssl/x509.h
include/openssl/x509_vfy.h
include/openssl/x509v3.h
ssl/d1_srtp.c
ssl/s3_lib.c
ssl/ssl_cert.c
ssl/ssl_ciph.c
ssl/ssl_conf.c
ssl/ssl_lib.c
ssl/ssl_rsa.c
ssl/ssl_sess.c
ssl/statem/extensions.c
ssl/statem/extensions_clnt.c
ssl/statem/extensions_srvr.c
ssl/statem/statem_clnt.c
ssl/statem/statem_lib.c
ssl/statem/statem_srvr.c
ssl/t1_lib.c
test/cipherbytes_test.c
test/cipherlist_test.c
test/ciphername_test.c
test/cmp_client_test.c
test/cmp_ctx_test.c
test/cmp_hdr_test.c
test/cmp_msg_test.c
test/cmp_protect_test.c
test/cmp_status_test.c
test/cmp_testlib.c
test/cmp_vfy_test.c
test/cmsapitest.c
test/confdump.c
test/crltest.c
test/ct_test.c
test/danetest.c
test/dtls_mtu_test.c
test/evp_test.c
test/handshake_helper.c
test/http_test.c
test/ocspapitest.c
test/ssl_test.c
test/ssl_test_ctx.c
test/sslapitest.c
test/sslcorrupttest.c
test/ssltest_old.c
test/v3nametest.c
test/verify_extra_test.c
util/missingmacro.txt
util/perl/OpenSSL/ParseC.pm

index 78e8f88c6247091a9d7f2668c0e9d56d5c48fbf8..45789ed612450c4ac36b854dceb53af057537738 100644 (file)
@@ -417,6 +417,11 @@ OpenSSL 3.0
    replaced with no-ops.
 
    *Rich Salz*
+ * Added documentation for the STACK API. OpenSSL only defines the STACK
+   functions where they are used.
+  
+   *Rich Salz*
 
  * Introduced a new method type and API, OSSL_SERIALIZER, to
    represent generic serializers.  An implementation is expected to
index 451a808f1ee457df6ba17a180860516da05474d1..821a211cc873b824e066f4d92f1a07f90914c0b0 100644 (file)
@@ -10,7 +10,7 @@ my %targets=(
        includes        => [],
        lib_cflags      => "",
        lib_cppflags    => "",
-       lib_defines     => [ 'OPENSSL_BUILDING_OPENSSL' ],
+       lib_defines     => [],
        thread_scheme   => "(unknown)", # Assume we don't know
        thread_defines  => [],
 
@@ -47,7 +47,7 @@ my %targets=(
 
        defines         =>
            sub {
-                my @defs = ();
+                my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
                 push @defs, "ZLIB" unless $disabled{zlib};
                 push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
                 return [ @defs ];
index 342e12d9b256583fb29b9c71db591ccd8742f57f..4b34e7e62226bb93a7cee75bbcaa399f0b3535e4 100644 (file)
@@ -18,6 +18,9 @@
 #include <openssl/pem.h>
 #include <openssl/asn1t.h>
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF_STRING()
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,
index a3f2c6887acfe3d78fa771a712cf64e6fa2f1bd5..e2fb43fd7ed9ceede3b8e8bd65ce5eb7f5c30ea9 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
 #include "apps.h"
 #include "progs.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF_STRING()
+
 #ifndef W_OK
 # define F_OK 0
 # define W_OK 2
index 500b416046141e424e0aca5c620b0fae614b08f8..380091f16f1b83b3c65e6d95ef5c322909678d7e 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/err.h>
 #include <openssl/ssl.h>
 
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_STDNAME,
index 8ffe4ca5a816e11777b8f1ebe73c960eacb423e0..b45f98551c6def1ac7b5fb966b6e42b1b875c086 100644 (file)
 #include <openssl/err.h>
 #include <openssl/cmperr.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
 /* the context for the CMP mock server */
 typedef struct
 {
index 0d89085cc73f77bd35f6f2556ef20b78f87fd1d5..0c8af3dab7c687cc79d5878708cda08080b306b0 100644 (file)
 # include <openssl/x509v3.h>
 # include <openssl/cms.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(CMS_SignerInfo)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(GENERAL_NAMES)
+DEFINE_STACK_OF_STRING()
+
 static int save_certs(char *signerfile, STACK_OF(X509) *signers);
 static int cms_cb(int ok, X509_STORE_CTX *ctx);
 static void receipt_request_print(CMS_ContentInfo *cms);
index 9137f8723959ff89d2f5c430be18ebea09c279a8..e0de95a12a72f333bb3b9b5cae5ea2bb34068af5 100644 (file)
 #include <openssl/pem.h>
 #include <openssl/objects.h>
 
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_INFO)
+DEFINE_STACK_OF_STRING()
+
 static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
 
 typedef enum OPTION_choice {
index 23faa340b26e24c74bf696cf9a1d1b737133e75a..90aaf982ae019c5facbcf5fba54843914c5445b7 100644 (file)
@@ -21,6 +21,8 @@
 #include <openssl/hmac.h>
 #include <ctype.h>
 
+DEFINE_STACK_OF_STRING()
+
 #undef BUFSIZE
 #define BUFSIZE 1024*8
 
index 2b295fde679b8e5075e10b33e34ab1a2b56d064a..6d788ac85246d91900ab0a1d19aadbb9adac15d1 100644 (file)
@@ -19,6 +19,9 @@
 #include <openssl/ssl.h>
 #include <openssl/store.h>
 
+DEFINE_STACK_OF_STRING()
+DEFINE_STACK_OF_CSTRING()
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_C, OPT_T, OPT_TT, OPT_PRE, OPT_POST,
index 157f08b11f182378a70fac7ffb20ed9fe4fdc59d..1eb183f361e756ed0ff76966eb0c4d5c3ad6c65e 100644 (file)
@@ -18,6 +18,8 @@
 #include "apps.h"
 #include "progs.h"
 
+DEFINE_STACK_OF_STRING()
+
 #define BUFSIZE 4096
 #define DEFAULT_MAC_NAME "HMAC"
 #define DEFAULT_FIPS_SECTION "fips_check_section"
index 0b577b2bcddfa9d422fe322b475750557f060ca6..9a69682b575db004bc1e040e71a4e4a55752a0a4 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/kdf.h>
 #include <openssl/params.h>
 
+DEFINE_STACK_OF_STRING()
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_KDFOPT, OPT_BIN, OPT_KEYLEN, OPT_OUT,
index 13ca7a12f1e1a141f13e159b0ba384b2c5d38c0d..5395d842eba5dbd6b834b5ac2ed6026f388ac393 100644 (file)
@@ -57,6 +57,17 @@ static int WIN32_rename(const char *from, const char *to);
 
 #define PASS_SOURCE_SIZE_MAX 4
 
+DEFINE_STACK_OF(CONF)
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509_INFO)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(X509_POLICY_NODE)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(DIST_POINT)
+DEFINE_STACK_OF_STRING()
+
 typedef struct {
     const char *name;
     unsigned long flag;
index 09ee16fd3788757ba42f025199092686f3a40124..a1116d68f870926d3b563d8158ae51b54bafdd83 100644 (file)
@@ -12,6 +12,8 @@
 #include <openssl/safestack.h>
 #include "names.h"
 
+DEFINE_STACK_OF_CSTRING()
+
 #ifdef _WIN32
 # define strcasecmp _stricmp
 #endif
index 16ce65d448eb32af643b33bd15e6dc1bbdb1a3c8..5f2f2792fa67353ea2cbf6045907d19bc72c500f 100644 (file)
 
 #define COOKIE_SECRET_LENGTH    16
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF_STRING()
+
 VERIFY_CB_ARGS verify_args = { -1, 0, X509_V_OK, 0 };
 
 #ifndef OPENSSL_NO_SOCK
index b30632a65ac09d4415b21dba817d22eb2633733e..a28f6b673ed42627ac2c5bd9b2fb66f76179b07b 100644 (file)
@@ -19,6 +19,8 @@
 #include "opt.h"
 #include "names.h"
 
+DEFINE_STACK_OF_CSTRING()
+
 static int verbose = 0;
 
 static void legacy_cipher_fn(const EVP_CIPHER *c,
index 6e322fd2fee4b79af0db23f7d13a4f64de02fdd6..07a6e915e3ede15f6d3776e1831d3f10670c8f34 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/evp.h>
 #include <openssl/params.h>
 
+DEFINE_STACK_OF_STRING()
+
 #undef BUFSIZE
 #define BUFSIZE 1024*8
 
index 92ae7bd34dac2b49a56c639ef54130f7a8600ad1..de189632b24abb6bf9173aa0d8cc0c27766f69d7 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/pem.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(X509)
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_TOSEQ, OPT_IN, OPT_OUT,
index 7bd1765b302bd61d20db19ded41414e1e68b4cca..d85892202abe19f933068f73f4b670897a1c320b 100644 (file)
 #include <openssl/x509v3.h>
 #include <openssl/rand.h>
 
+DEFINE_STACK_OF(OCSP_CERTID)
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF_STRING()
+
 #ifndef HAVE_FORK
 # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
 #  define HAVE_FORK 0
index 69bbe94cf910653c4435a784029fde80bec209fc..18f9550dedab4b4d84e4e5650bd0d936bea9ae27 100644 (file)
 #include <openssl/pem.h>
 #include <openssl/pkcs12.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(PKCS7)
+DEFINE_STACK_OF(PKCS12_SAFEBAG)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+DEFINE_STACK_OF_STRING()
+
 #define NOKEYS          0x1
 #define NOCERTS         0x2
 #define INFO            0x4
index dba9751e9b95fefba0653d1bfc04edfc6b90ed12..2416584dd6c655d21807305ce8e71f2cc3d45f25 100644 (file)
@@ -20,6 +20,9 @@
 #include <openssl/pkcs7.h>
 #include <openssl/pem.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOOUT,
index 34251d5aeb5624a973043a1153cc2d255a1d8658..1e3802045faafbc17a741ad3136e994a38e49eee 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/evp.h>
 #include <sys/stat.h>
 
+DEFINE_STACK_OF_STRING()
+
 #define KEY_NONE        0
 #define KEY_PRIVKEY     1
 #define KEY_PUBKEY      2
index 87231cd2df9bfffdb667812fb69d4b982eb31c59..de8fd34cf3fe6287254a0170654aea6002d88acc 100644 (file)
@@ -20,6 +20,8 @@
 #include <openssl/core.h>
 #include <openssl/core_numbers.h>
 
+DEFINE_STACK_OF_CSTRING()
+
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_V = 100, OPT_VV, OPT_VVV
index e21b1b84ae27cd90f5cd9e8fc8db41eb7921832f..866b8cfe206d5ba501a075bd3f6e67d03b01b764 100644 (file)
@@ -42,6 +42,8 @@
 # include <openssl/pem.h>
 # include <openssl/x509.h>
 
+DEFINE_STACK_OF(X509_INFO)
+DEFINE_STACK_OF_STRING()
 
 # ifndef PATH_MAX
 #  define PATH_MAX 4096
index 3d40f0c80b50f6199d7b153574db795f0c0c098d..9ab120c34f1096d1e401296e822ab37c2727c3a6 100644 (file)
@@ -32,6 +32,8 @@
 # include <openssl/dsa.h>
 #endif
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF_STRING()
 
 #define BITS            "default_bits"
 #define KEYFILE         "default_keyfile"
index ff06f4ee4c14960784da5c83920b4a6173b9f7cd..a28b2867a3272e619c301adf939c2764ff694557 100644 (file)
@@ -56,6 +56,12 @@ typedef unsigned int u_int;
 # endif
 #endif
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF(SCT)
+DEFINE_STACK_OF_STRING()
+
 #undef BUFSIZZ
 #define BUFSIZZ 1024*8
 #define S_CLIENT_IRC_READ_TIMEOUT 8
index dd661ee4eb0a49f54c890433a149832761597fb1..14550aebc29b8f43229cb51c106c00f1b4e3b39f 100644 (file)
@@ -60,6 +60,12 @@ typedef unsigned int u_int;
 #endif
 #include "internal/sockets.h"
 
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(SSL_CIPHER)
+DEFINE_STACK_OF_STRING()
+
 static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
 static int sv_body(int s, int stype, int prot, unsigned char *context);
 static int www_body(int s, int stype, int prot, unsigned char *context);
index 27fc7905c04b03631082c327235d9e19748695ae..50f03fdc0451b117b0c8fc72981f4e7ad3f63844 100644 (file)
@@ -19,6 +19,9 @@
 #include <openssl/x509_vfy.h>
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF_STRING()
+
 static int save_certs(char *signerfile, STACK_OF(X509) *signers);
 static int smime_cb(int ok, X509_STORE_CTX *ctx);
 
index 0e423ca80b920dd6d24e115064da00b37229bc32..558866806fc19c6379f99325bf03becf43ce5ac0 100644 (file)
 #include <openssl/x509v3.h>
 #include <openssl/pem.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF_STRING()
+
 static int cb(int ok, X509_STORE_CTX *ctx);
 static int check(X509_STORE *ctx, const char *file,
                  STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
index bff698f97dbe3ab33e7c24deed962577b03e47a6..16c1f9575453da0b32dbecc3a05ee5ebc5472c8d 100644 (file)
 # include <openssl/dsa.h>
 #endif
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF_STRING()
+
 #undef POSTFIX
 #define POSTFIX ".srl"
 #define DEF_DAYS        30
index ab54739714f8fe0b0efe15c0442a571a3804e268..518d4089373b733d86200ce5386339c5f019b711 100644 (file)
@@ -12,6 +12,8 @@
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 
+DEFINE_STACK_OF(ASN1_STRING_TABLE)
+
 static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
 static void st_free(ASN1_STRING_TABLE *tbl);
 static int sk_table_cmp(const ASN1_STRING_TABLE *const *a,
index 7b50a0ce6394d57f81980ddaa8c0a318547bb9ec..c5fb8f91b1b5c81bfd38aa460e2c3faea531ca96 100644 (file)
@@ -23,6 +23,9 @@
 
 #define ASN1_GEN_STR(str,val)   {str, sizeof(str) - 1, val}
 
+DEFINE_STACK_OF(ASN1_TYPE)
+DEFINE_STACK_OF(CONF_VALUE)
+
 #define ASN1_FLAG_EXP_MAX       20
 /* Maximum number of nested sequences */
 #define ASN1_GEN_SEQ_MAX_DEPTH  50
index 1331f608f42bd8fe671b5522375bcd304714e72f..47ae801b94ebf73593d1b5a496525d65a3e96668 100644 (file)
@@ -13,6 +13,8 @@
 #include <openssl/asn1.h>
 #include "asn1_local.h"
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
                            long max);
 static void asn1_put_length(unsigned char **pp, int length);
index 30da0298c0de93ac3466f2364e217bc3024121e3..4eb92d68441cf6ae68fa53adb96bf48ff2178cec 100644 (file)
@@ -18,6 +18,9 @@
 #include "internal/bio.h"
 #include "asn1_local.h"
 
+DEFINE_STACK_OF(BIO)
+DEFINE_STACK_OF(X509_ALGOR)
+
 /*
  * Generalised MIME like utilities for streaming ASN1. Although many have a
  * PKCS7/CMS like flavour others are more general purpose.
index 90f807604819a47c239ccdd8e2f44129a12c5c2c..02ca99db791a47f6e02b504b76827755cabadca9 100644 (file)
@@ -16,6 +16,8 @@
 #include "crypto/asn1.h"
 #include "crypto/objects.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* Simple ASN1 OID module: add all objects in a given section */
 
 static int do_create(const char *value, const char *name);
index 3139ab07ccb886c9c57a5047709b1a2f8bc254b5..dedf1c32405a63251b4bceec8d2e1a326b2dbc21 100644 (file)
@@ -13,6 +13,7 @@
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
 /* Multi string module: add table entries from a given section */
 
 static int do_tcreate(const char *value, const char *name);
index a4f3dd5359d7bb04034b4e4a0dfa3508c00cd3ea..c7346f542407a09e86c14b006e3e0e75a7834c5f 100644 (file)
@@ -18,6 +18,7 @@
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
 
+DEFINE_STACK_OF(ASN1_TYPE)
 EVP_PKEY *d2i_PrivateKey_ex(int type, EVP_PKEY **a, const unsigned char **pp,
                             long length, OPENSSL_CTX *libctx, const char *propq)
 {
index f720c6020abde8ab64e3f9d3a0353b82140a23a3..421991146d56cbf3f9017ffed3b8c2370034d5fe 100644 (file)
@@ -17,6 +17,7 @@
 #include "internal/numbers.h"
 #include "asn1_local.h"
 
+DEFINE_STACK_OF(ASN1_VALUE)
 
 /*
  * Constructed types with a recursive definition (such as can be found in PKCS7)
index e8d57bdaad7d93cc2ddb7d1fd5b5beea3bc7a19d..a8cd914f4eaccd3d79093b880329b6769dd8ae60 100644 (file)
@@ -13,6 +13,8 @@
 #include <openssl/objects.h>
 #include "asn1_local.h"
 
+DEFINE_STACK_OF(ASN1_VALUE)
+
 /* Free up an ASN1 structure */
 
 void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
index 155080dda1242c1a194780e4c534e4157f4cd2e1..a6335691a0a76f78a0047d5f31185d922ac38d66 100644 (file)
@@ -15,6 +15,8 @@
 #include <string.h>
 #include "asn1_local.h"
 
+DEFINE_STACK_OF(ASN1_VALUE)
+
 static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
                                int embed);
 static int asn1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it,
index ae318db6cac7c6ac71677029a58252944f88db3a..703bd8cded94d6ee21ae11153921227630cf787e 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/cmp.h>
 #include <openssl/crmf.h>
 
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+
 /* ASN.1 declarations from RFC4210 */
 ASN1_SEQUENCE(OSSL_CMP_REVANNCONTENT) = {
     /* OSSL_CMP_PKISTATUS is effectively ASN1_INTEGER so it is used directly */
index 6e9929028b103d953e3175c0441b68e6f24a1af4..f561f72eb19b2d74e59f0c44b6f724c02db51c60 100644 (file)
 
 #include "openssl/cmp_util.h"
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
+DEFINE_STACK_OF(OSSL_CMP_PKISI)
+DEFINE_STACK_OF(OSSL_CRMF_CERTID)
+
 #define IS_CREP(t) ((t) == OSSL_CMP_PKIBODY_IP || (t) == OSSL_CMP_PKIBODY_CP \
                         || (t) == OSSL_CMP_PKIBODY_KUP)
 
index e34ad84797246eb49da27cc842cd456c44b5a27c..aa18338db5ed6c9c627a2adf183306a93e4b28de 100644 (file)
 #include <openssl/crmf.h>
 #include <openssl/err.h>
 
-/* Get current certificate store containing trusted root CA certs */
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(POLICYINFO)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+
+/*
+ * Get current certificate store containing trusted root CA certs
+ */
 X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx)
 {
     if (ctx == NULL) {
index 99953d9c1e4ca265c065c497c85c52abd160c144..c2493420f8df3270ef467b17a3e0ec5f4fcaf9df 100644 (file)
@@ -20,6 +20,9 @@
 #include <openssl/cmp.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+
 int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno)
 {
     if (!ossl_assert(hdr != NULL))
index 6b3849fcc149289a46d96c3f74e6fd6ad6872c78..4c9f542b49bde94a404bc2e714544de795d44de0 100644 (file)
@@ -28,6 +28,8 @@
 #include <openssl/cmp.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /*
  * Send the PKIMessage req and on success return the response, else NULL.
  * Any previous error queue entries will likely be removed by ERR_clear_error().
index d98cefe7d3da95e7347a5bb09092b3f291fdfed5..dc11b54d2bb19b4cc768e7f02757be2008045653 100644 (file)
 #include <openssl/err.h>
 #include <openssl/x509.h>
 
+DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(OSSL_CMP_PKISI)
+DEFINE_STACK_OF(OSSL_CRMF_MSG)
+DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
+DEFINE_STACK_OF(OSSL_CRMF_CERTID)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg)
 {
     if (msg == NULL) {
index e1dc8e5fa1efbbad1def72bb304e1163e32e817c..3e0c22bb80ac05855bcb3d147ea40adf48718711 100644 (file)
@@ -18,6 +18,8 @@
 #include <openssl/err.h>
 #include <openssl/x509.h>
 
+DEFINE_STACK_OF(X509)
+
 /*
  * This function is also used for verification from cmp_vfy.
  *
index 2cb264a0043252ac28eaf9141899fa8437c683f1..4da9a4436f3db696c1331de7addbe462f04756e9 100644 (file)
 #include <openssl/cmp.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(OSSL_CRMF_MSG)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+DEFINE_STACK_OF(OSSL_CMP_CERTSTATUS)
+
 /* the context for the generic CMP server */
 struct ossl_cmp_srv_ctx_st
 {
index c9809c5a3a7c9a80ad482707de0c2c0a1fd39516..8f10a42fb95cdd5f5d1b169d1fe02b9917c0fca7 100644 (file)
@@ -26,6 +26,8 @@
 #include <openssl/x509.h>
 #include <openssl/asn1err.h> /* for ASN1_R_TOO_SMALL and ASN1_R_TOO_LARGE */
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 /* CMP functions related to PKIStatus */
 
 int ossl_cmp_pkisi_get_status(const OSSL_CMP_PKISI *si)
index 785a1bea5f0402fae4cd80c7e94fa15c937e5f64..570e14cd2496b53373338aeae51600866001e79d 100644 (file)
 #include <openssl/err.h> /* should be implied by cmperr.h */
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_OBJECT)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 /*
  * use trace API for CMP-specific logging, prefixed by "CMP " and severity
  */
index 137b65b06b04d787d8fa95ae69da40d58f612c80..c124b0636fd0c31e10d7e05eb5ac00f6a7b8c2d2 100644 (file)
@@ -22,6 +22,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509)
+
 /*
  * Verify a message protected by signature according to section 5.1.3.3
  * (sha1+RSA/DSA or any other algorithm supported by OpenSSL).
index af53fc82bb170cacdee5a831ddf28c3a4ffcd9ad..a5ef2ddee5acec955b1e4c161ef0dd3887dcd0a1 100644 (file)
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
 
+DEFINE_STACK_OF(CMS_RecipientInfo)
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
 /* CMS EnvelopedData Utilities */
 
 static void cms_env_set_version(CMS_EnvelopedData *env);
index 00a08aafeac499eed8b812adc1eb86d17acefbec..12243dd869ecc23ec5a54ea02800e42fbed02f74 100644 (file)
@@ -19,6 +19,9 @@
 #include "crypto/ess.h"
 #include "crypto/cms.h"
 
+DEFINE_STACK_OF(GENERAL_NAMES)
+DEFINE_STACK_OF(CMS_SignerInfo)
+
 IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest)
 
 /* ESS services */
index 14a884caeb6997269a796f7e8d6c35269e27e995..4e837718dcb4c91bd360e31de455d623bc44407e 100644 (file)
@@ -17,6 +17,8 @@
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
+DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
+
 /* Key Agreement Recipient Info (KARI) routines */
 
 int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
index 835e34887d7b3c221b387a9b0e8f5fc90f97374d..89dfc1508148c2e657d2baf4492275ab14074724 100644 (file)
 #include <openssl/cms.h>
 #include "cms_local.h"
 
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+
 IMPLEMENT_ASN1_FUNCTIONS(CMS_ContentInfo)
 IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
 
index a4c32dcdc920d6f2a453fb4e9c29b12112dd68ec..dee4a53ca15f1926d21724c92b10b6f364882d14 100644 (file)
@@ -18,6 +18,8 @@
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
+DEFINE_STACK_OF(CMS_RecipientInfo)
+
 int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
                                     unsigned char *pass, ossl_ssize_t passlen)
 {
index 4a40226cf53439a8e8bd1988421656af27c91004..a5342c4a00bc432750a48662289b83fdc3e8806d 100644 (file)
 #include "crypto/cms.h"
 #include "crypto/ess.h"
 
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(CMS_SignerInfo)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_ALGOR)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
 /* CMS SignedData Utilities */
 
 static CMS_SignedData *cms_get0_signed(CMS_ContentInfo *cms)
index f07064ea61c358bf3bcb0fdf6f737cc5bb2ef286..dbdc815e9729b75459491fcb08a3a40797657a99 100644 (file)
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
+DEFINE_STACK_OF(CMS_SignerInfo)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
+DEFINE_STACK_OF(CMS_RecipientInfo)
+
 static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
 {
     BIO *rbio;
index 4c7349a3057ece19609eb7b053840facd9c574c3..827b4032c76a31bce5ebf8671cd337813c375f44 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/conf.h>
 #include <openssl/conf_api.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static void value_free_hash(const CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf);
 static void value_free_stack_doall(CONF_VALUE *a);
 
index 9718b73a18a6c9fca60ecf70bd2d3cfb98d9ebb7..9dbda10edfd8f864b36fca9f73d1e501a43502cd 100644 (file)
@@ -27,6 +27,8 @@
 # endif
 #endif
 
+DEFINE_STACK_OF(BIO)
+
 #ifndef S_ISDIR
 # define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
 #endif
index 2bbf43b90829ba8d9eb604c533775d67924776e5..504d9b181acfbd0aa1571ef6b0ed9dd942f1c9c7 100644 (file)
 #include <openssl/trace.h>
 #include <openssl/engine.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(CONF_MODULE)
+DEFINE_STACK_OF(CONF_IMODULE)
+
 #define DSO_mod_init_name "OPENSSL_init"
 #define DSO_mod_finish_name "OPENSSL_finish"
 
index 5855c50c7b078579d771edcc2686742e551b0958..14d5dc1d5bb877c3ef6d3faca12cbb516a4bc5c7 100644 (file)
@@ -14,6 +14,8 @@
 #include "internal/sslconf.h"
 #include "conf_local.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /*
  * SSL library configuration module placeholder. We load it here but defer
  * all decisions about its contents to libssl.
index 8c59e3d0d9c032f121d38ae17b874f79d815a191..89eb2c3775eb939bf14a5f679228893ca0c88c67 100644 (file)
@@ -36,6 +36,9 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>
 
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(OSSL_CRMF_MSG)
+
 /*-
  * atyp = Attribute Type
  * valt = Value Type
index 32a29ed6995ad0c77a0442e4904219315b627334..73eeee9d7d0b8a61878bfe70878283ee24eec9f4 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "internal/cryptlib.h"
 
+DEFINE_STACK_OF(CTLOG)
+
 /*
  * Information about a CT log server.
  */
index bd8d1bb1dfa24929bd439fd887738d26121dabf3..dfc6e99e2aba0b3765eb34359482fbaa1477f555 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "ct_local.h"
 
+DEFINE_STACK_OF(SCT)
+
 int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len)
 {
     size_t siglen;
index 4c5760d694ad5bc1f863e6cdb99b8863a1757080..e2ab6b2fd5baf07a1fcf115a0950c1815f0408f9 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "ct_local.h"
 
+DEFINE_STACK_OF(SCT)
+
 static void SCT_signature_algorithms_print(const SCT *sct, BIO *out)
 {
     int nid = SCT_get_signature_nid(sct);
index 1b8e1dc61ef70adfd60e40d0a4d5f30bb0059b16..f6c262c967687b4c0be1411c4a7eae9b5a0b289a 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "ct_local.h"
 
+DEFINE_STACK_OF(SCT)
+
 SCT *SCT_new(void)
 {
     SCT *sct = OPENSSL_zalloc(sizeof(*sct));
index 1665b985eb470b58a45b74b7193276ccf38ab745..55190debc19046002419e0587ac23a9f2c5c3f30 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "ct_local.h"
 
+DEFINE_STACK_OF(SCT)
+
 static char *i2s_poison(const X509V3_EXT_METHOD *method, void *val)
 {
     return OPENSSL_strdup("NULL");
index b01c2f6ac59c1cf38e4217e08b86124497f1371a..57fa43fa4104a4c7dfe302a3ddfd73c111461ab7 100644 (file)
@@ -19,6 +19,8 @@
 #include "dso_local.h"
 #include "e_os.h"
 
+DEFINE_STACK_OF(void)
+
 #ifdef DSO_DLFCN
 
 # ifdef HAVE_DLFCN_H
index a464c391be877def346758c36d25153b8ede0b2c..82215dde7d2665d2f0d38b553bb3489e6bb01ed7 100644 (file)
@@ -10,6 +10,8 @@
 #include "dso_local.h"
 #include "internal/refcount.h"
 
+DEFINE_STACK_OF(void)
+
 static DSO_METHOD *default_DSO_meth = NULL;
 
 static DSO *DSO_new_method(DSO_METHOD *meth)
index adf2e63688494cc9fb6ce07e20a52e19a4ff4210..5826d410b566ca2b532de0fe1857dcadb3dfbcb8 100644 (file)
@@ -69,6 +69,8 @@ static void *win32_globallookup(const char *name);
 
 static const char *openssl_strnchr(const char *string, int c, size_t len);
 
+DEFINE_STACK_OF(void)
+
 static DSO_METHOD dso_meth_win32 = {
     "OpenSSL 'win32' shared library method",
     win32_load,
index 221981942c29748c26fb8b623b00183f27552617..de215952abf34207a0627bf0e59ee16b94f685df 100644 (file)
@@ -11,6 +11,8 @@
 #include <openssl/conf.h>
 #include <openssl/trace.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* ENGINE config module */
 
 static const char *skip_dot(const char *name)
index 15504410d95fd96310bff2f82375528dc81060cd..f7595b74200d57d83e70d257c6566861800b4ebc 100644 (file)
@@ -17,6 +17,8 @@
  * prototypes.
  */
 
+DEFINE_STACK_OF_STRING()
+
 /* Our ENGINE handlers */
 static int dynamic_init(ENGINE *e);
 static int dynamic_finish(ENGINE *e);
index a2d6bfe7a9fd4d4f6c5fe31940b8b68d5cacad1c..9d9defa9d7746ba1b001e2ebc8cd078f9e639207 100644 (file)
 #include <openssl/ess.h>
 #include "crypto/ess.h"
 
+DEFINE_STACK_OF(ESS_CERT_ID)
+DEFINE_STACK_OF(ESS_CERT_ID_V2)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(GENERAL_NAME)
+
 static ESS_CERT_ID *ESS_CERT_ID_new_init(X509 *cert, int issuer_needed);
 static ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new_init(const EVP_MD *hash_alg,
                                                X509 *cert, int issuer_needed);
index 7cfa0a27fe70ed42ff694140d90ac8bad599efd7..fa35fd168c3499b56b0b199d03be652e3385358d 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/trace.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* Algorithm configuration module. */
 
 /* TODO(3.0): the config module functions should be passed a library context */
index 277f808f600c8064a05b5e23d30bb185cc40596a..fcf369ad5d3f2fa0260d43eb3580ad62357872ea 100644 (file)
@@ -36,6 +36,7 @@
 #include "internal/evp.h"
 #include "internal/provider.h"
 #include "evp_local.h"
+DEFINE_STACK_OF(X509_ATTRIBUTE)
 
 #include "crypto/ec.h"
 
index d672b464a6dec20f5432203450a251b899f9240a..6200d05529a9970555b908add7ca2d26e9cacaf0 100644 (file)
@@ -10,6 +10,8 @@
 #include "crypto/cryptlib.h"
 #include "internal/thread_once.h"
 
+DEFINE_STACK_OF(void)
+
 int do_ex_data_init(OPENSSL_CTX *ctx)
 {
     OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
index 4c123f81d3fa5a50032cecaae716110a09db6f0e..98be2c49471f6728abe2d905f4340035710d8686 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "http_local.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 #define HTTP_PREFIX "HTTP/"
 #define HTTP_VERSION_PATT "1." /* allow 1.x */
 #define HTTP_VERSION_STR_LEN 3
index ec657900a546bb24bf409301996a5c140ccbdc33..95b16dce55af7c81bbb130f67d23c5f6d7bb54f9 100644 (file)
 #include <openssl/ocsp.h>
 #include "ocsp_local.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OCSP_ONEREQ)
+DEFINE_STACK_OF(OCSP_SINGLERESP)
+
 /*
  * Utility functions related to sending OCSP requests and extracting relevant
  * information from the response.
index c2b61bd4f2c43a738541104667b221f395339cb6..77e67840b8e59e620eb3e1bd0ac95f52d44e1574 100644 (file)
@@ -16,6 +16,9 @@
 #include <openssl/rand.h>
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(ACCESS_DESCRIPTION)
+
 /* Standard wrapper functions for extensions */
 
 /* OCSP request extensions */
index 6d527dfcc8e4001d241f17cd0d78a9e3e3a74548..170fb275a61551d8d215dd649303a1cb56bed08f 100644 (file)
 #include "internal/cryptlib.h"
 #include <openssl/pem.h>
 
+DEFINE_STACK_OF(OCSP_ONEREQ)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OCSP_SINGLERESP)
+
 static int ocsp_certid_print(BIO *bp, OCSP_CERTID *a, int indent)
 {
     BIO_printf(bp, "%*sCertificate ID:\n", indent, "");
index b9253b36d980fc35f1644a933560110229dff790..3cfe3649ccb12fc4cf3679b79b9fbb9afa2c92eb 100644 (file)
 #include <openssl/ocsp.h>
 #include "ocsp_local.h"
 
+DEFINE_STACK_OF(OCSP_ONEREQ)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OCSP_SINGLERESP)
+
 /*
  * Utility functions related to sending OCSP responses and extracting
  * relevant information from the request.
index c7a22a1f97a4c27c07aa164c9267f2f586a9f7d3..0dccb24eb502532a0a15202f7d46a036284da16a 100644 (file)
 #include <openssl/err.h>
 #include <string.h>
 
+DEFINE_STACK_OF(OCSP_ONEREQ)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OCSP_SINGLERESP)
+
 static int ocsp_find_signer(X509 **psigner, OCSP_BASICRESP *bs,
                             STACK_OF(X509) *certs, unsigned long flags);
 static X509 *ocsp_find_signer_sk(STACK_OF(X509) *certs, OCSP_RESPID *id);
index 9648ba941261a57138fceec06be8fb8fa037fead..33451ec4a559d72958c6bcb0ee0288ca00a296ce 100644 (file)
@@ -16,6 +16,8 @@
 # include <openssl/x509v3.h>
 # include "../x509/ext_dat.h"
 
+DEFINE_STACK_OF(ACCESS_DESCRIPTION)
+
 /*
  * OCSP extensions and a couple of CRL entry extensions
  */
index 90162d7ddb3930129a78a00b2aa946b4ddfa20e3..f6a5dedc482bbe57413f33ede6f360cebbe18c87 100644 (file)
@@ -23,6 +23,8 @@
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
 
+DEFINE_STACK_OF(X509_INFO)
+
 #ifndef OPENSSL_NO_STDIO
 STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
                                         pem_password_cb *cb, void *u)
index 0e8b419d0f57a404128d07c98fe037f40564a663..f75b2437c9c73f8b7f7861df2877f8c8deaeb12b 100644 (file)
 #include <openssl/pkcs12.h>
 #include "p12_local.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(PKCS7)
+DEFINE_STACK_OF(PKCS12_SAFEBAG)
+
 static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
                           PKCS12_SAFEBAG *bag);
 
index a9a3ff54f3acc28d513b23779c060df3f55f986a..9a12ef103534fbe7d6efb9cd65054806459764ef 100644 (file)
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(PKCS7)
+DEFINE_STACK_OF(PKCS12_SAFEBAG)
+
 /* Simplified PKCS#12 routines */
 
 static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,
index 7c916d46cd457339f07c1c4df5c91675ff81aa9d..838abe352a0ebb84ed5c5c34c949620a66d205d4 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/pkcs12.h>
 #include "p12_local.h"
 
+DEFINE_STACK_OF(PKCS7)
+DEFINE_STACK_OF(PKCS12_SAFEBAG)
+
 /* PKCS#12 password change routine */
 
 static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass);
index e7bc808cc4f721e6927f4637fba3f084057cd3e9..1c95a3cfced36f23a31479f55aea44518ca06735 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/x509.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(X509_ALGOR)
+
 int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
                               STACK_OF(X509_ALGOR) *cap)
 {
index 2cf62b62cd5553133564ea6fc1ff041bc36a56ef..9fb3ffc1a2af77ecc1525f932518d980cf31faeb 100644 (file)
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(X509_ALGOR)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+DEFINE_STACK_OF(PKCS7_RECIP_INFO)
+DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
+
 static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
                          void *value);
 static ASN1_TYPE *get_attribute(STACK_OF(X509_ATTRIBUTE) *sk, int nid);
index ca039656f08b1c478655d3b316cc7bb63ab708f2..0eb140e6ae8a031835b5413ccdeda2015926cd73 100644 (file)
 #include "crypto/asn1.h"
 #include "crypto/evp.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509_ALGOR)
+DEFINE_STACK_OF(PKCS7_RECIP_INFO)
+DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
+
 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
 {
     int nid;
index 43ad266a6c445fb90f1226e59ea62b7d87fcc256..3ef59c57bab4f0ae46954ce65d72a4903926cb2c 100644 (file)
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
-
 #define BUFFERSIZE 4096
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+DEFINE_STACK_OF(X509_ALGOR)
+DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
+
 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
 
 PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
index 1dd5b1d1d4c57d7a63883855981b6ad03a6db4d0..ce09fae7d3ab64c0f06f8f632f943cc7612705ca 100644 (file)
 #include <openssl/safestack.h>
 #include "internal/provider.h"
 
+DEFINE_STACK_OF(OSSL_PROVIDER)
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* PROVIDER config module */
 
-DEFINE_STACK_OF(OSSL_PROVIDER)
 static STACK_OF(OSSL_PROVIDER) *activated_providers = NULL;
 
 static const char *skip_dot(const char *name)
index 6c50d064578cd0bad0f20e9046b04beb77b850a8..f0ed6da6f6fd7c203aab490bc915fb25ab8d7069 100644 (file)
 # define SRP_RANDOM_SALT_LEN 20
 # define MAX_LEN 2500
 
+DEFINE_STACK_OF(SRP_user_pwd)
+DEFINE_STACK_OF(SRP_gN_cache)
+DEFINE_STACK_OF(SRP_gN)
+
 /*
  * Note that SRP uses its own variant of base 64 encoding. A different base64
  * alphabet is used and no padding '=' characters are added. Instead we pad to
index 9b7f8fb8aec839f1476f212e81e86fbee5c0da7d..02178b29a8dec80e632d3728d72cc195a7415e68 100644 (file)
@@ -32,6 +32,8 @@
 #include "crypto/evp.h"
 #include "store_local.h"
 
+DEFINE_STACK_OF(X509)
+
 #ifdef _WIN32
 # define stat    _stat
 #endif
index 4117ccdd87b1b99415fbd8f18798d700640cd1e5..8d2d7129f9c5601bea642cc44fb51009ad148103 100644 (file)
 #include <openssl/engine.h>
 #include <openssl/ts.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_INFO)
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* Macro definitions for the configuration file. */
 #define BASE_SECTION                    "tsa"
 #define ENV_DEFAULT_TSA                 "default_tsa"
index 8b95097935c41b4797ea5a0edc8104ef5d2e2a85..ec36868d887ed435730bbdb5e8b5defb26d8b7fb 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/ts.h>
 #include "ts_local.h"
 
+DEFINE_STACK_OF(X509_EXTENSION)
+
 int TS_REQ_set_version(TS_REQ *a, long version)
 {
     return ASN1_INTEGER_set(a->version, version);
index 8593e2d9e3ec95b9e15d73afd8dee3b6ea91e6f7..5334cea534812cba241718c54d0af354e34aebaa 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/ts.h>
 #include "ts_local.h"
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(CONF_VALUE)
+
 struct status_map_st {
     int bit;
     const char *text;
index ed0979e584374475ecf837f295eeadceb639314d..ba69cbece29234fdaf146a1daa24aab1b0e89885 100644 (file)
 #include "ts_local.h"
 #include "crypto/ess.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF_CONST(EVP_MD)
+
 static ASN1_INTEGER *def_serial_cb(struct TS_resp_ctx *, void *);
 static int def_time_cb(struct TS_resp_ctx *, void *, long *sec, long *usec);
 static int def_extension_cb(struct TS_resp_ctx *, X509_EXTENSION *, void *);
index 6017e8d16dfb9ae8199cefc3d1f0f71a2379dfd3..b9ec82a2e602fbc31bc32857e7d8417bf63e27ba 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/pkcs7.h>
 #include "ts_local.h"
 
+DEFINE_STACK_OF(X509_EXTENSION)
+
 int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info)
 {
     TS_STATUS_INFO *new_status_info;
index 1f20fb9c0ecac8c4a3873c513fd706fb1ba63660..b872f75bea7f1832580e565cc7c76df0868dd845 100644 (file)
 #include "ts_local.h"
 #include "crypto/ess.h"
 
+DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(ESS_CERT_ID)
+DEFINE_STACK_OF(ESS_CERT_ID_V2)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(GENERAL_NAME)
+
 static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
                           X509 *signer, STACK_OF(X509) **chain);
 static int ts_check_signing_certs(PKCS7_SIGNER_INFO *si,
index 3c8340137fe4781a38d0a58ca618515203dfc87d..2205345b0f0b38ba1b6b8e72317213e3dbbbc1a5 100644 (file)
@@ -12,6 +12,8 @@
 #include <openssl/ts.h>
 #include "ts_local.h"
 
+DEFINE_STACK_OF(X509)
+
 TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
 {
     TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
index 97a75eab66b805d0526ee684b76e65e38db13548..85bf8c1f80b615be7f4b0baae58f58f8a19e7fed 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/err.h>
 #include "ui_local.h"
 
+DEFINE_STACK_OF(UI_STRING)
+
 UI *UI_new(void)
 {
     return UI_new_method(NULL);
index 4479d6ad980cce9baa4d28f2302d743edce23365..43b175e2dc2d2c028c44b91b1bf1220ba547ba05 100644 (file)
@@ -22,6 +22,8 @@
 #include "crypto/x509.h"
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_OBJECT)
+
 struct lookup_dir_hashes_st {
     unsigned long hash;
     int suffix;
index 93a1af87c62901f68686287adbda68d1b5773519..178ec2aeb58f1a870e20ce5cf8458c7c94870548 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/pem.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_INFO)
+
 static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
                         long argl, char **ret);
 static X509_LOOKUP_METHOD x509_file_lookup = {
index 8a8c50b6531d2c5355fe22bf31f6b8f66257a988..7141c1bd2fead42a22af11c6279bc474cba2a724 100644 (file)
@@ -12,6 +12,8 @@
 #include "crypto/x509.h"
 #include "x509_local.h"
 
+DEFINE_STACK_OF_STRING()
+
 /* Generic object loader, given expected type and criterion */
 static int cache_objects(X509_LOOKUP *lctx, const char *uri,
                          const OSSL_STORE_SEARCH *criterion,
index e65931e456783b588fb99f7686968bdce955af68..a7bcfe601395ca6b613078eacdf2960ea1d55eb8 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(POLICYINFO)
+
 static int policy_data_cmp(const X509_POLICY_DATA *const *a,
                            const X509_POLICY_DATA *const *b);
 static int policy_cache_set_int(long *out, ASN1_INTEGER *value);
index cc3fc201f9ddd553a6700a16c547b1f27003a827..0a98a11169c132e724f15a69e6416037839c2a03 100644 (file)
@@ -13,6 +13,9 @@
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(POLICYQUALINFO)
+
 /* Policy Node routines */
 
 void policy_data_free(X509_POLICY_DATA *data)
index c4740a0a30c57d6fdcb16e7c6aee0a95da7ca7a0..23baa2db1bb1f985a1a48313de2b9ae8f9d7fa87 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(X509_POLICY_NODE)
+
 /* accessor functions */
 
 /* X509_POLICY_TREE stuff */
index 258792be6f559267115da52b22d306c537630965..76cca2f842438153fc8e820555d4ed0efc42faac 100644 (file)
@@ -14,6 +14,9 @@
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(POLICY_MAPPING)
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 /*
  * Set policy mapping entries in cache. Note: this modifies the passed
  * POLICY_MAPPINGS structure
index fc06a31c511fa9d127d7d8d95dce79bc547588b9..5afd08121a74a521a8ab1d9c15cca661e1211bf7 100644 (file)
@@ -14,6 +14,9 @@
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(X509_POLICY_NODE)
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 static int node_cmp(const X509_POLICY_NODE *const *a,
                     const X509_POLICY_NODE *const *b)
 {
index fa11e5e47a866f9732fb1077d9684aff63662479..f9519d3a199e313816ea9521e8f41a40e008917f 100644 (file)
 
 #include "pcy_local.h"
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_POLICY_NODE)
+
 static void expected_print(BIO *channel,
                            X509_POLICY_LEVEL *lev, X509_POLICY_NODE *node,
                            int indent)
index 33b871eb308b427c1cba34576dcc083bd8f2aeb3..f6705286f22f05fe32cfe6eb929f5534a510f4e8 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(X509_REVOKED)
+
 #ifndef OPENSSL_NO_STDIO
 int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
 {
index 8af6510bf56b912556ab658a8d5a030a9a9e9f20..4cf6493b793ae6369a9080ddf0dd451872340f81 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
 
+DEFINE_STACK_OF(X509_EXTENSION)
+
 #ifndef OPENSSL_NO_STDIO
 int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
 {
index 5e95395438082604671ba1ae345025edcbedac00..e3c21b084df3ed06773efcef8e142c66d1988175 100644 (file)
@@ -17,6 +17,9 @@
 #include "crypto/asn1.h"
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 #ifndef OPENSSL_NO_STDIO
 int X509_print_fp(FILE *fp, X509 *x)
 {
index 766c5bc106b82180a8b078629f14abe235d1c2d8..51f5cd8fa9bbfff2836db2661a528850ef871aff 100644 (file)
 
 #ifndef OPENSSL_NO_RFC3779
 
+DEFINE_STACK_OF(IPAddressOrRange)
+DEFINE_STACK_OF(IPAddressFamily)
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509)
+
 /*
  * OpenSSL ASN.1 template translation of RFC 3779 2.2.3.
  */
index 104b58f25992ab717e012f43ff04808ac1d6de62..4cccaf644fc32c32900dcad1ca6a1a849caf56a3 100644 (file)
 #include "v3_admis.h"
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(ADMISSIONS)
+DEFINE_STACK_OF(PROFESSION_INFO)
+DEFINE_STACK_OF(ASN1_STRING)
+DEFINE_STACK_OF(ASN1_OBJECT)
 
 ASN1_SEQUENCE(NAMING_AUTHORITY) = {
     ASN1_OPT(NAMING_AUTHORITY, namingAuthorityId, ASN1_OBJECT),
index 4898869b0b498ea372294de1691c2d6c9dfeeeee..bd231f65a06c93aa5c01c91eba5668eb1fe03d56 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(GENERAL_NAME)
+
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
                                                  AUTHORITY_KEYID *akeyid,
                                                  STACK_OF(CONF_VALUE)
index a910d5d718d06eb98942bd055c121e66654deeba..67d8acc81bb6be3e6acabe59f6e842731c4fcfbb 100644 (file)
@@ -13,6 +13,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(GENERAL_NAME)
+
 static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method,
                                       X509V3_CTX *ctx,
                                       STACK_OF(CONF_VALUE) *nval);
index 6cb5cd55468993377bd52c0970e84b6624e659dc..798185a7b4f0f50082ed7da7a8629ce837536e25 100644 (file)
@@ -55,6 +55,10 @@ IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange)
 IMPLEMENT_ASN1_FUNCTIONS(ASIdentifierChoice)
 IMPLEMENT_ASN1_FUNCTIONS(ASIdentifiers)
 
+DEFINE_STACK_OF(ASIdOrRange)
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509)
+
 /*
  * i2r method for an ASIdentifierChoice.
  */
index 02e300229c15b82dacacba806c50acf3068379ae..0ba3c0cc1b49e23e5041ea86e89a2bddb28ea08d 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
                                                    BASIC_CONSTRAINTS *bcons,
                                                    STACK_OF(CONF_VALUE)
index 81cdcfb6cf2e3769479fe28bbca941b2130767a2..b0a807d35a82d6acf1b5daa394eddd2617a9e09a 100644 (file)
@@ -13,6 +13,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static BIT_STRING_BITNAME ns_cert_type_table[] = {
     {0, "SSL Client", "client"},
     {1, "SSL Server", "server"},
index 47b1cfc90b44ba01ad133dc417397bb9fa610a27..38e364709a0bc284c321ae0be9831a9afdf98da7 100644 (file)
@@ -17,6 +17,9 @@
 #include "crypto/x509.h"
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509_EXTENSION)
+
 static int v3_check_critical(const char **value);
 static int v3_check_generic(const char **value);
 static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid,
index 470088c90a680a2a882b2cd88e7f907c67df32d6..a5f1453492a1f5d8728270cc638c8b2d5b832c4c 100644 (file)
 #include "pcy_local.h"
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(POLICYINFO)
+DEFINE_STACK_OF(POLICYQUALINFO)
+DEFINE_STACK_OF(ASN1_INTEGER)
+
 /* Certificate policies extension support: this one is a bit complex... */
 
 static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol,
index b23a9619e165d199c7b81f6243d889cab39d0817..21a1bfcd7d933ddddac61f0d642a86bf361e9bbd 100644 (file)
 #include "crypto/x509.h"
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(DIST_POINT)
+DEFINE_STACK_OF(X509_NAME_ENTRY)
+
 static void *v2i_crld(const X509V3_EXT_METHOD *method,
                       X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
 static int i2r_crldp(const X509V3_EXT_METHOD *method, void *pcrldp, BIO *out,
index 8d0dfcf300ced54b2553b9c20da0cf9b9c951b62..b60d999402d7b08636bc9d6102e386c12bc514cd 100644 (file)
@@ -14,6 +14,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(CONF_VALUE)
+
 static void *v2i_EXTENDED_KEY_USAGE(const X509V3_EXT_METHOD *method,
                                     X509V3_CTX *ctx,
                                     STACK_OF(CONF_VALUE) *nval);
index c50cfd1f34a22d9b3703fef88cf9a0aa5607e2f4..4acc514af2e365924f0a9e3759e7d8e40f0a974f 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(ACCESS_DESCRIPTION)
+DEFINE_STACK_OF(CONF_VALUE)
+
 static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
                                                        *method, AUTHORITY_INFO_ACCESS
                                                        *ainfo, STACK_OF(CONF_VALUE)
index 6db4f19913d713c70eaecef84b62bbfe3e3b49e3..ceb127f63777e16103261e40e14ba1a09429efd4 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 /*
  * Issuer Sign Tool (1.2.643.100.112) The name of the tool used to signs the subject (ASN1_SEQUENCE)
  * This extention is required to obtain the status of a qualified certificate at Russian Federation.
index 71ba7a3282ccb800343eed6b3a0eb202e9ec0a69..a3bb8be8ecca632d823c7e10230158ab68aa0404 100644 (file)
@@ -16,6 +16,9 @@
 
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(X509V3_EXT_METHOD)
+DEFINE_STACK_OF(X509_EXTENSION)
+
 static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;
 
 static int ext_cmp(const X509V3_EXT_METHOD *const *a,
index d6a286c094ee75efe02541baae8ace875c1a7c5e..88ad8ba74f065a078fee6e60638542ecf14dca39 100644 (file)
 #include "crypto/x509.h"
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(GENERAL_SUBTREE)
+
 static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
                                   X509V3_CTX *ctx,
                                   STACK_OF(CONF_VALUE) *nval);
index fb5f35a5ab1108c0c4c9f5958455ba05d6d70a63..4e02f9c54626753a09a965715efd160eed263d54 100644 (file)
@@ -49,6 +49,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext,
                    BIO *out, int indent);
 static PROXY_CERT_INFO_EXTENSION *r2i_pci(X509V3_EXT_METHOD *method,
index 33c08cfdaae8811206ca4f7ee65662d2f12f6316..43e5bc555be9ff270f16ba8980bf53f5eca36657 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static STACK_OF(CONF_VALUE) *i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD
                                                     *method, void *bcons, STACK_OF(CONF_VALUE)
                                                     *extlist);
index 2b4784027c123f75cb82068f34a799c80ceaabfa..9dcd459852daf3070f0b773a780856a1776e766f 100644 (file)
@@ -14,6 +14,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(POLICY_MAPPING)
+DEFINE_STACK_OF(CONF_VALUE)
+
 static void *v2i_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method,
                                  X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
 static STACK_OF(CONF_VALUE) *i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD
index 2ef76c1b5b50a3abfb37adfb20765e1484dc483f..e5f062b66803771846d01c6b255eb6ecc1a269ed 100644 (file)
@@ -14,6 +14,9 @@
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509_EXTENSION)
+
 /* Extension printing routines */
 
 static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen,
index 687d065303c56fb8b7d6ee9ca2dd9e2e7d6d65d4..b3401035f1a31d7040aa7005a47ac48beaaa7612 100644 (file)
 #include "crypto/x509.h"
 #include "internal/tsan_assist.h"
 
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(DIST_POINT)
+DEFINE_STACK_OF(X509_PURPOSE)
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 static int check_ssl_ca(const X509 *x);
 static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x,
                                     int ca);
index 072b8efe82520ac97b6e30e9938b3c96f9f7839a..364348d9dcc13c22fb65278672112c60a2e7bf6c 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(SXNETID)
+DEFINE_STACK_OF(CONF_VALUE)
+
 /* Support for Thawte strong extranet extension */
 
 #define SXNET_TEST
index 28e83bb2aea277ca839728818a53dce2e6928964..597e8eda5e0c515e798886e487d1c95372955d18 100644 (file)
@@ -15,6 +15,9 @@
 #include <openssl/x509v3.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(ASN1_INTEGER)
+DEFINE_STACK_OF(CONF_VALUE)
+
 static STACK_OF(CONF_VALUE) *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method,
                                              TLS_FEATURE *tls_feature,
                                              STACK_OF(CONF_VALUE) *ext_list);
index c7f54aa0d49e23367610b4660ec7c1d4b395a6e4..4be395397cd38e2e20d7310cf1ab7d30e95367b7 100644 (file)
 #include <openssl/bn.h>
 #include "ext_dat.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(ACCESS_DESCRIPTION)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF_STRING()
+
 static char *strip_spaces(char *name);
 static int sk_strcmp(const char *const *a, const char *const *b);
 static STACK_OF(OPENSSL_STRING) *get_email(const X509_NAME *name,
index c8b2d0f8a8157df278da36515c6f30f620afa2e3..03b90262eeaa480f6d8237ed2aa88c7e12518792 100644 (file)
@@ -17,6 +17,9 @@
 #include <openssl/x509v3.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+DEFINE_STACK_OF(ASN1_TYPE)
+
 int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
 {
     return sk_X509_ATTRIBUTE_num(x);
index 654b7b5a68673231e4e27cd0ceff0754a33fcbce..05615c1e19cac5a9a099503d9d345ff8fdfda53d 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/core_names.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509)
+
 int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
 {
     int i;
index 64791f24a5278e3be308fce9f492b01e837a9eb0..421f26ba1693adee9349284b47bfec7bb7e3f7d8 100644 (file)
 #include <openssl/x509v3.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_LOOKUP)
+DEFINE_STACK_OF(X509_OBJECT)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(X509)
+
 X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
 {
     X509_LOOKUP *ret = OPENSSL_zalloc(sizeof(*ret));
index 9d8f48d2ee19850e6a74039385d97920c742f604..1229c01b6b4909d855145e58d95851cebe4c8e79 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/buffer.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509_NAME_ENTRY)
+
 /*
  * Limit to ensure we don't overflow: much greater than
  * anything encountered in practice.
index a03ba24926478c86b5dea3950c4bf0bf8ae373d1..a284bf72cabc432f51623e5702dc76a14e7d73ad 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
 X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey)
 {
     X509 *ret = NULL;
index 10718c347dda7ac98078ac1110e99dd24d7969aa..ebd45b68b030e586edea7f90e72c259403027906 100644 (file)
@@ -12,6 +12,9 @@
 #include <openssl/x509v3.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509_TRUST)
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b);
 static void trtable_free(X509_TRUST *p);
 
index 715c3594d4afff95707479faf519a84f30eb7a33..31438d201705ba74378e643330879b06b52a2d65 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/x509v3.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_EXTENSION)
+
 int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x)
 {
     if (x == NULL)
index 99479444e6c156922015e95560ed65cc24ac613f..e5fbd2afd16e9b1134100fe6e8626d70edc8fa08 100644 (file)
 #include "crypto/x509.h"
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_REVOKED)
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(DIST_POINT)
+DEFINE_STACK_OF_STRING()
+
 /* CRL score values */
 
 /* No unhandled critical extensions */
index f6555dd20cd96b27b5d4e2d7589ea35108fc2d24..c3af2d3d78f87bd58e90ded7e0df44d822e22704 100644 (file)
 
 #include "x509_local.h"
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+DEFINE_STACK_OF(X509_VERIFY_PARAM)
+DEFINE_STACK_OF_STRING()
+
 /* X509_VERIFY_PARAM functions */
 
 #define SET_HOST 0
index 22143da65e1f62f04586c99a7188209a657f91d3..d5b37780355748696db0fb65e6fe157ca2162025 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509_REVOKED)
+
 int X509_CRL_set_version(X509_CRL *x, long version)
 {
     if (x == NULL)
index b00e5f5b380691dd53912d1e89388c7a9bdf0dd7..7e2704fb68aff15ebfcbbbe92c11e88126747a5e 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509_NAME_ENTRY)
+
 int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
                               char *buf, int len)
 {
index b30234112f61f1a9403b6adb61ada3f9f5a11b55..99609cfca60caa34a2b5b14537a83b22d44e47a2 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/x509.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(ASN1_TYPE)
+
 /*-
  * X509_ATTRIBUTE: this has the following form:
  *
index 0f53be710f3c85df67ee2b38e7def979fee1e1e6..0d3e1fedb454d920c0273038d6a3f877c9b3adcb 100644 (file)
 #include <openssl/x509v3.h>
 #include "x509_local.h"
 
+DEFINE_STACK_OF(GENERAL_NAME)
+DEFINE_STACK_OF(GENERAL_NAMES)
+DEFINE_STACK_OF(X509_REVOKED)
+DEFINE_STACK_OF(X509_EXTENSION)
+
 static int X509_REVOKED_cmp(const X509_REVOKED *const *a,
                             const X509_REVOKED *const *b);
 static int setup_idp(X509_CRL *crl, ISSUING_DIST_POINT *idp);
index 692bd6566a2648293f5b041293b02a563c6f552c..2db9aa34caac596c45a934e297afc14d67d272b2 100644 (file)
@@ -16,6 +16,9 @@
 #include "crypto/asn1.h"
 #include "x509_local.h"
 
+DEFINE_STACK_OF(X509_NAME_ENTRY)
+DEFINE_STACK_OF(ASN1_VALUE)
+
 /*
  * Maximum length of X509_NAME: much larger than anything we should
  * ever see in practice.
index 21215b4778001712152acc4eefe7eff41118dfd5..10b82df5599129e2e58e3c51b7f511ff63369340 100644 (file)
@@ -13,6 +13,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
 /*-
  * X509_REQ_INFO is handled in an unusual way to get round
  * invalid encodings. Some broken certificate requests don't
index e9317dc1d91ee1e42752ac37458245aa908472ca..8cfdbc9fe67065c5c4b0a91e4111fc1a8d5f335d 100644 (file)
@@ -15,6 +15,8 @@
 #include <openssl/x509v3.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(IPAddressFamily)
+
 ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
         ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
         ASN1_EMBED(X509_CINF, serialNumber, ASN1_INTEGER),
index 18d09e300e871869613ea69a798a23fe517dec67..957386b8e2d447f2b6261460790863e95a980878 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/x509.h>
 #include "crypto/x509.h"
 
+DEFINE_STACK_OF(ASN1_OBJECT)
+
 /*
  * X509_CERT_AUX routines. These are used to encode additional user
  * modifiable data about a certificate. This data is appended to the X509
index 4dd3de843f80dbf481936a48a4ba3d1b8276140d..6c165c00435e8d6471cc7b197916d04be1983c46 100644 (file)
@@ -64,27 +64,31 @@ functions that wrap around the utility B<OPENSSL_sk_> API.
 In the description here, B<I<TYPE>> is used
 as a placeholder for any of the OpenSSL datatypes, such as B<X509>.
 
-STACK_OF() returns the name for a stack of the specified B<I<TYPE>>.
-DEFINE_STACK_OF() creates set of functions for a stack of B<I<TYPE>>. This
-will mean that type B<I<TYPE>> is stored in each stack, the type is referenced by
+The STACK_OF() macro returns the name for a stack of the specified B<I<TYPE>>.
+This is an opaque pointer to a structure declaration.
+This can be used in every header file that references the stack.
+There are several B<DEFINE...> macros that create static inline functions
+for all of the functions described on this page.
+This should normally be used in one source file, and the stack manipulation
+is wrapped with application-specific functions.
+
+DEFINE_STACK_OF() creates set of functions for a stack of B<I<TYPE>> elements.
+The type is referenced by
 B<STACK_OF>(B<I<TYPE>>) and each function name begins with B<sk_I<TYPE>_>.
-For example:
-
- TYPE *sk_TYPE_value(STACK_OF(TYPE) *sk, int idx);
-
 DEFINE_STACK_OF_CONST() is identical to DEFINE_STACK_OF() except
-each element is constant. For example:
+each element is constant.
 
+ /* DEFINE_STACK_OF(TYPE) */
+ TYPE *sk_TYPE_value(STACK_OF(TYPE) *sk, int idx);
+ /* DEFINE_STACK_OF_CONST(TYPE) */
  const TYPE *sk_TYPE_value(STACK_OF(TYPE) *sk, int idx);
 
-DEFINE_SPECIAL_STACK_OF() defines a stack of B<I<TYPE>> but
-each function uses B<FUNCNAME> in the function name. For example:
+DEFINE_SPECIAL_STACK_OF() and DEFINE_SPECIAL_STACK_OF_CONST() are similar
+except B<FUNCNAME> is used in the function names:
 
+ /* DEFINE_SPECIAL_STACK_OF(TYPE, FUNCNAME) */
  TYPE *sk_FUNCNAME_value(STACK_OF(TYPE) *sk, int idx);
-
-DEFINE_SPECIAL_STACK_OF_CONST() is similar except that each element is
-constant:
-
+ /* DEFINE_SPECIAL_STACK_OF(TYPE, FUNCNAME) */
  const TYPE *sk_FUNCNAME_value(STACK_OF(TYPE) *sk, int idx);
 
 B<sk_I<TYPE>_num>() returns the number of elements in I<sk> or -1 if I<sk> is
index 74b79e31c674939341464427c9734bc87bf2fbfe..c8d181c93ab5d4e9422d64fdaa13306be326eda0 100644 (file)
@@ -31,6 +31,9 @@
 #  include <openssl/rsa.h>
 #  include <openssl/dsa.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+
 /*
  * This module uses several "new" interfaces, among which is
  * CertGetCertificateContextProperty. CERT_KEY_PROV_INFO_PROP_ID is
index 451989773ad7b5c5a49984114adbb5c0f0b03b63..f80e8a0a48297c7404cda36e3a504054b21a40c1 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "rand.inc"
 
+DEFINE_STACK_OF(SSL_COMP)
+
 /* unused, to avoid warning. */
 static int idx;
 
index 0088dd947834d87c168c737455a5c191df420c3b..6883a286ff56c2b835e6d94dc23a23a460d7f813 100644 (file)
@@ -18,6 +18,8 @@
 #include "fuzzer.h"
 #include "rand.inc"
 
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+
 int FuzzerInitialize(int *argc, char ***argv)
 {
     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
index 335f1f165df51937c55b1608f20ab3bb1af6414b..fe4fa5c70be00741f8abfacbc6337747584fa375 100644 (file)
@@ -24,6 +24,8 @@
 
 #include "rand.inc"
 
+DEFINE_STACK_OF(SSL_COMP)
+
 static const uint8_t kCertificateDER[] = {
     0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01,
     0x02, 0x02, 0x11, 0x00, 0xb1, 0x84, 0xee, 0x34, 0x99, 0x98, 0x76, 0xfb,
index f58781272de6e3f290cdd3a498084d699f527574..a5b14152a9620cf05b49825c46955d3f8f169797 100644 (file)
@@ -119,8 +119,14 @@ extern "C" {
 # define SMIME_OLDMIME           0x400
 # define SMIME_CRLFEOL           0x800
 # define SMIME_STREAM            0x1000
-    struct X509_algor_st;
-DEFINE_STACK_OF(X509_ALGOR)
+
+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)
+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 */
 /*
@@ -187,15 +193,14 @@ typedef struct ASN1_ENCODING_st {
  (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
 # define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
 
-typedef struct asn1_string_table_st {
+struct asn1_string_table_st {
     int nid;
     long minsize;
     long maxsize;
     unsigned long mask;
     unsigned long flags;
-} ASN1_STRING_TABLE;
+};
 
-DEFINE_STACK_OF(ASN1_STRING_TABLE)
 
 /* size limits: this stuff is taken straight from RFC2459 */
 
@@ -419,13 +424,8 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
                                 ASN1_STRFLGS_DUMP_UNKNOWN | \
                                 ASN1_STRFLGS_DUMP_DER)
 
-DEFINE_STACK_OF(ASN1_INTEGER)
-
-DEFINE_STACK_OF(ASN1_GENERALSTRING)
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
-
-typedef struct asn1_type_st {
+struct asn1_type_st {
     int type;
     union {
         char *ptr;
@@ -454,9 +454,8 @@ typedef struct asn1_type_st {
         ASN1_STRING *sequence;
         ASN1_VALUE *asn1_value;
     } value;
-} ASN1_TYPE;
+};
 
-DEFINE_STACK_OF(ASN1_TYPE)
 
 typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
 
@@ -511,7 +510,6 @@ 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);
 
 DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
-DEFINE_STACK_OF(ASN1_OBJECT)
 
 ASN1_STRING *ASN1_STRING_new(void);
 void ASN1_STRING_free(ASN1_STRING *a);
index 837fd427b089f50e8a508042ddac5168c2f47d1b..286db9e2eb4b5c732ef469eca03b9cc62981016e 100644 (file)
@@ -880,7 +880,7 @@ DECLARE_ASN1_ITEM(LONG)
 DECLARE_ASN1_ITEM(ZLONG)
 # endif
 
-DEFINE_STACK_OF(ASN1_VALUE)
+DEFINE_OR_DECLARE_STACK_OF(ASN1_VALUE)
 
 /* Functions used internally by the ASN1 code */
 
index edc9fbd6b47c979bb96fdd85eb8b856a94d8016d..b4047d55b9b1ce317880d10dc61a4a5314edb267 100644 (file)
@@ -286,7 +286,7 @@ int BIO_method_type(const BIO *b);
 typedef int BIO_info_cb(BIO *, int, int);
 typedef BIO_info_cb bio_info_cb;  /* backward compatibility */
 
-DEFINE_STACK_OF(BIO)
+DEFINE_OR_DECLARE_STACK_OF(BIO)
 
 /* Prefix and suffix callback in ASN1 BIO */
 typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,
index 6a5da278d1ae6fba57c420e108c8a0fcccc061d6..76ba0e3bf14848e859803bf2ab547740d08e2417 100644 (file)
@@ -202,6 +202,12 @@ 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;
@@ -210,21 +216,16 @@ 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_STACK_OF(OSSL_CMP_CERTSTATUS)
 typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV;
 DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV)
-DEFINE_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_STACK_OF(OSSL_CMP_PKISI)
 typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE;
-DEFINE_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_STACK_OF(OSSL_CMP_CERTRESPONSE)
 typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT;
 
 /*
index c7e5abcf51d368aa736da5e24f7889fd70240341..a0f4b6a0ec3ddbbcdc3ae4e2dac71d328cb1c65b 100644 (file)
@@ -36,10 +36,11 @@ typedef struct CMS_Receipt_st CMS_Receipt;
 typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
 typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
 
-DEFINE_STACK_OF(CMS_SignerInfo)
-DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
-DEFINE_STACK_OF(CMS_RecipientInfo)
-DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_OR_DECLARE_STACK_OF(CMS_SignerInfo)
+DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
+DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientInfo)
+DEFINE_OR_DECLARE_STACK_OF(CMS_RevocationInfoChoice)
+
 DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
 DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
 DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
index d15d47873f2f01676d302432057d0e8bdab5f6d3..6a36a85b0f2237c641301d0dd212f447e3fc97c2 100644 (file)
@@ -33,7 +33,9 @@ typedef struct {
     char *value;
 } CONF_VALUE;
 
-DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_OR_DECLARE_STACK_OF(CONF_VALUE)
+DEFINE_OR_DECLARE_STACK_OF(CONF_MODULE)
+
 DEFINE_LHASH_OF(CONF_VALUE);
 
 struct conf_st;
@@ -58,8 +60,7 @@ struct conf_method_st {
 typedef struct conf_imodule_st CONF_IMODULE;
 typedef struct conf_module_st CONF_MODULE;
 
-DEFINE_STACK_OF(CONF_MODULE)
-DEFINE_STACK_OF(CONF_IMODULE)
+STACK_OF(CONF_IMODULE);
 
 /* DSO module function typedefs */
 typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);
index 02ed3af761b84363dd0dfe8b16e31594f8ac0ce2..4908ebd563649b55e54a098ba46feedf1bd84f53 100644 (file)
@@ -30,6 +30,9 @@
 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
@@ -43,7 +46,6 @@ 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_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)
@@ -51,7 +53,6 @@ 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_STACK_OF(OSSL_CRMF_CERTID)
 
 typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
 DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
index e20d17b5d9843bfff3a4e71d62f25523a8d5324f..0b3a20dfd27faae7425dea115af5c2867c8f563c 100644 (file)
@@ -169,7 +169,8 @@ struct crypto_ex_data_st {
     OPENSSL_CTX *ctx;
     STACK_OF(void) *sk;
 };
-DEFINE_STACK_OF(void)
+
+DEFINE_OR_DECLARE_STACK_OF(void)
 
 /*
  * Per class, we have a STACK of function pointers.
index c3447004e61caef29501ab11c7dbb9a0e21773ed..280f7ceecf794b60ebb9b1d31917a06c157be9a4 100644 (file)
@@ -34,6 +34,9 @@ extern "C" {
 /* All hashes are SHA256 in v1 of Certificate Transparency */
 # define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
 
+DEFINE_OR_DECLARE_STACK_OF(SCT)
+DEFINE_OR_DECLARE_STACK_OF(CTLOG)
+
 typedef enum {
     CT_LOG_ENTRY_TYPE_NOT_SET = -1,
     CT_LOG_ENTRY_TYPE_X509 = 0,
@@ -61,9 +64,6 @@ typedef enum {
     SCT_VALIDATION_STATUS_UNKNOWN_VERSION
 } sct_validation_status_t;
 
-DEFINE_STACK_OF(SCT)
-DEFINE_STACK_OF(CTLOG)
-
 /******************************************
  * CT policy evaluation context functions *
  ******************************************/
index c20bf8201db946a91e30620feb7d03879c238bef..5a31f678c1848d8db98065bf9bb4ddd3ca7bc050 100644 (file)
@@ -19,16 +19,16 @@ extern "C" {
 # include <openssl/x509.h>
 # include <openssl/esserr.h>
 
+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_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_STACK_OF(ESS_CERT_ID_V2)
 
 DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL)
 DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL)
index b9f55c0123e80934e9bb6697278bd9bb593e8581..d40e843e8f75fd62b205d5e08c28bd20e0cb5bff 100644 (file)
@@ -102,14 +102,13 @@ extern "C" {
 #  define OCSP_RESPID_KEY                 0x400
 #  define OCSP_NOTIME                     0x800
 
-typedef struct ocsp_cert_id_st OCSP_CERTID;
-
-DEFINE_STACK_OF(OCSP_CERTID)
+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;
-
-DEFINE_STACK_OF(OCSP_ONEREQ)
-
 typedef struct ocsp_req_info_st OCSP_REQINFO;
 typedef struct ocsp_signature_st OCSP_SIGNATURE;
 typedef struct ocsp_request_st OCSP_REQUEST;
@@ -126,7 +125,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
 #  define V_OCSP_RESPID_NAME 0
 #  define V_OCSP_RESPID_KEY  1
 
-DEFINE_STACK_OF(OCSP_RESPID)
 
 typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO;
 
@@ -137,7 +135,6 @@ 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_STACK_OF(OCSP_SINGLERESP)
 
 typedef struct ocsp_response_data_st OCSP_RESPDATA;
 
index 51d6e8a4851d85a40758d0210522856054831c59..474992e479fb48f21578b127a7ac7217bf75da7d 100644 (file)
@@ -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_STACK_OF(PKCS12_SAFEBAG)
-
 typedef struct pkcs12_bag_st PKCS12_BAGS;
 
 # define PKCS12_ERROR    0
index 7c079a2ec54db07d577f6e3f28d3d274c7412444..4d114d75e77137691732ba42318374d2aaeb423c 100644 (file)
@@ -28,6 +28,7 @@
 extern "C" {
 #endif
 
+
 /*-
 Encryption_ID           DES-CBC
 Digest_ID               MD5
@@ -51,8 +52,7 @@ typedef struct pkcs7_signer_info_st {
     /* The private key to sign with */
     EVP_PKEY *pkey;
 } PKCS7_SIGNER_INFO;
-
-DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
+DEFINE_OR_DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
 
 typedef struct pkcs7_recip_info_st {
     ASN1_INTEGER *version;      /* version 0 */
@@ -61,8 +61,8 @@ typedef struct pkcs7_recip_info_st {
     ASN1_OCTET_STRING *enc_key;
     X509 *cert;                 /* get the pub-key from this */
 } PKCS7_RECIP_INFO;
+DEFINE_OR_DECLARE_STACK_OF(PKCS7_RECIP_INFO)
 
-DEFINE_STACK_OF(PKCS7_RECIP_INFO)
 
 typedef struct pkcs7_signed_st {
     ASN1_INTEGER *version;      /* version 1 */
@@ -148,8 +148,8 @@ typedef struct pkcs7_st {
         ASN1_TYPE *other;
     } d;
 } PKCS7;
+DEFINE_OR_DECLARE_STACK_OF(PKCS7)
 
-DEFINE_STACK_OF(PKCS7)
 
 # define PKCS7_OP_SET_DETACHED_SIGNATURE 1
 # define PKCS7_OP_GET_DETACHED_SIGNATURE 2
index b8de23cf3ad8c0c38927e69ba08c98b7a61afd8a..5d099e6246ad9ea53348ff47ade068dee3038be8 100644 (file)
@@ -132,11 +132,11 @@ extern "C" {
         return (sk_##t1##_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); \
     }
 
-# 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_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
+# define DEFINE_SPECIAL_STACK_OF(t1, t2) SKM_DEFINE_STACK_OF(t1, t2, t2)
 # define DEFINE_SPECIAL_STACK_OF_CONST(t1, t2) \
             SKM_DEFINE_STACK_OF(t1, const t2, t2)
-# define DEFINE_STACK_OF_CONST(t) SKM_DEFINE_STACK_OF(t, const t, t)
 
 /*-
  * Strings are special: normally an lhash entry will point to a single
@@ -155,6 +155,28 @@ extern "C" {
 typedef char *OPENSSL_STRING;
 typedef const char *OPENSSL_CSTRING;
 
+# define DEFINE_STACK_OF_STRING() \
+        DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
+# define DEFINE_STACK_OF_CSTRING() \
+        DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
+
+/*
+ * If we're building OpenSSL, or we have no-deprecated configured,
+ * then we don't define the inline functions (see |SKM_DEFINE_STACK_OF|,
+ * above), we just declare the stack datatypes. Otherwise, for compatibility
+ * and to not remove the API's, we define the functions.  We have the
+ * trailing semicolon so that uses of this never need it.
+ */
+#if defined(OPENSSL_BUILDING_OPENSSL) || defined(OPENSSL_NO_DEPRECATED_3_0)
+# define DEFINE_OR_DECLARE_STACK_OF(s) STACK_OF(s);
+# define DEFINE_OR_DECLARE_STACK_OF_STRING() STACK_OF(OPENSSL_STRING);
+# define DEFINE_OR_DECLARE_STACK_OF_CSTRING() STACK_OF(OPENSSL_CSTRING);
+#else
+# define DEFINE_OR_DECLARE_STACK_OF(s) DEFINE_STACK_OF(s)
+# define DEFINE_OR_DECLARE_STACK_OF_STRING() DEFINE_STACK_OF_STRING()
+# define DEFINE_OR_DECLARE_STACK_OF_CSTRING() DEFINE_STACK_OF_CSTRING()
+#endif
+
 /*-
  * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but
  * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned
@@ -162,15 +184,17 @@ 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.
  */
-DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
-DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
+DEFINE_OR_DECLARE_STACK_OF_STRING()
+DEFINE_OR_DECLARE_STACK_OF_CSTRING()
 
+#if !defined(OPENSSL_NO_DEPRECATED_3_0)
 /*
- * Similarly, we sometimes use a block of characters, NOT nul-terminated.
+ * This is not used by OpenSSL.  A block of bytes,  NOT nul-terminated.
  * These should also be distinguished from "normal" stacks.
  */
 typedef void *OPENSSL_BLOCK;
 DEFINE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
+#endif
 
 /*
  * If called without higher optimization (min. -xO3) the Oracle Developer
index 56d294b77a765a8d81cd8144481a6aa204dc0eb9..dc7bce935e40469d705f5f722244f97552be69ab 100644 (file)
 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_STACK_OF(SRP_gN_cache)
-
 typedef struct SRP_user_pwd_st {
     /* Owned by us. */
     char *id;
@@ -60,7 +61,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);
 
-DEFINE_STACK_OF(SRP_user_pwd)
 
 typedef struct SRP_VBASE_st {
     STACK_OF(SRP_user_pwd) *users_pwd;
@@ -80,7 +80,6 @@ typedef struct SRP_gN_st {
     const BIGNUM *N;
 } SRP_gN;
 
-DEFINE_STACK_OF(SRP_gN)
 
 SRP_VBASE *SRP_VBASE_new(char *seed_key);
 void SRP_VBASE_free(SRP_VBASE *vb);
index e75394676fc97d299408a164558d24a42e3087ab..7a2b418bf706a5a75da9d1363aac8a49e01629fc 100644 (file)
@@ -230,8 +230,10 @@ typedef struct tls_sigalgs_st TLS_SIGALGS;
 typedef struct ssl_conf_ctx_st SSL_CONF_CTX;
 typedef struct ssl_comp_st SSL_COMP;
 
-STACK_OF(SSL_CIPHER);
-STACK_OF(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)
 
 /* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
 typedef struct srtp_protection_profile_st {
@@ -239,7 +241,6 @@ typedef struct srtp_protection_profile_st {
     unsigned long id;
 } SRTP_PROTECTION_PROFILE;
 
-DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
 
 typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data,
                                             int len, void *arg);
@@ -979,8 +980,6 @@ extern "C" {
  * These need to be after the above set of includes due to a compiler bug
  * in VisualStudio 2015
  */
-DEFINE_STACK_OF_CONST(SSL_CIPHER)
-DEFINE_STACK_OF(SSL_COMP)
 
 /* compatibility */
 # define SSL_set_app_data(s,arg)         (SSL_set_ex_data(s,0,(char *)(arg)))
index 1229838da6aeeeb2caf45fa05224ddb5f1cfca77..bf8f236cf327c06aa69b47c6dc7229ec47a3dcd1 100644 (file)
@@ -37,6 +37,8 @@ extern "C" {
 # include <openssl/x509.h>
 # include <openssl/x509v3.h>
 
+DEFINE_OR_DECLARE_STACK_OF(EVP_MD)
+
 typedef struct TS_msg_imprint_st TS_MSG_IMPRINT;
 typedef struct TS_req_st TS_REQ;
 typedef struct TS_accuracy_st TS_ACCURACY;
@@ -264,8 +266,6 @@ typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,
 
 typedef struct TS_resp_ctx TS_RESP_CTX;
 
-DEFINE_STACK_OF_CONST(EVP_MD)
-
 /* Creates a response context that can be used for generating responses. */
 TS_RESP_CTX *TS_RESP_CTX_new(void);
 void TS_RESP_CTX_free(TS_RESP_CTX *ctx);
index 2b1d0820cff133de821213b624996f9449f0d5c6..27f90a7bdf60394427f24c9699c5d126b53d75fc 100644 (file)
@@ -60,7 +60,9 @@ typedef int ASN1_BOOLEAN;
 typedef int ASN1_NULL;
 # endif
 
+typedef struct asn1_type_st ASN1_TYPE;
 typedef struct asn1_object_st ASN1_OBJECT;
+typedef struct asn1_string_table_st ASN1_STRING_TABLE;
 
 typedef struct ASN1_ITEM_st ASN1_ITEM;
 typedef struct asn1_pctx_st ASN1_PCTX;
index 254ec6c29d88d6bf83d61a1ec72de1583dfa7247..fa55d92ac8419d9b50fc864ea0a9a6ea149b7e9c 100644 (file)
@@ -283,7 +283,8 @@ const UI_METHOD *UI_null(void);
  * about a string or a prompt, including test data for a verification prompt.
  */
 typedef struct ui_string_st UI_STRING;
-DEFINE_STACK_OF(UI_STRING)
+
+DEFINE_OR_DECLARE_STACK_OF(UI_STRING)
 
 /*
  * The different types of strings that are currently supported. This is only
index c54a91b671c4721d99f56411866df5e9537e7980..310980299e513f26cb4caa1bc237db12d94033cf 100644 (file)
@@ -78,32 +78,24 @@ typedef struct X509_sig_st X509_SIG;
 
 typedef struct X509_name_entry_st X509_NAME_ENTRY;
 
-DEFINE_STACK_OF(X509_NAME_ENTRY)
-
-DEFINE_STACK_OF(X509_NAME)
+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
 typedef struct X509_extension_st X509_EXTENSION;
-
+DEFINE_OR_DECLARE_STACK_OF(X509_EXTENSION)
 typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
-
-DEFINE_STACK_OF(X509_EXTENSION)
-
 typedef struct x509_attributes_st X509_ATTRIBUTE;
-
-DEFINE_STACK_OF(X509_ATTRIBUTE)
-
+DEFINE_OR_DECLARE_STACK_OF(X509_ATTRIBUTE)
 typedef struct X509_req_info_st X509_REQ_INFO;
-
 typedef struct X509_req_st X509_REQ;
-
 typedef struct x509_cert_aux_st X509_CERT_AUX;
-
 typedef struct x509_cinf_st X509_CINF;
 
-DEFINE_STACK_OF(X509)
-
 /* This is used for a table of trust checking functions */
 
 typedef struct x509_trust_st {
@@ -114,8 +106,8 @@ typedef struct x509_trust_st {
     int arg1;
     void *arg2;
 } X509_TRUST;
+DEFINE_OR_DECLARE_STACK_OF(X509_TRUST)
 
-DEFINE_STACK_OF(X509_TRUST)
 
 /* standard trust ids */
 
@@ -227,12 +219,8 @@ DEFINE_STACK_OF(X509_TRUST)
                         XN_FLAG_FN_LN | \
                         XN_FLAG_FN_ALIGN)
 
-DEFINE_STACK_OF(X509_REVOKED)
-
 typedef struct X509_crl_info_st X509_CRL_INFO;
 
-DEFINE_STACK_OF(X509_CRL)
-
 typedef struct private_key_st {
     int version;
     /* The PKCS#8 data types */
@@ -256,8 +244,7 @@ typedef struct X509_info_st {
     int enc_len;
     char *enc_data;
 } X509_INFO;
-
-DEFINE_STACK_OF(X509_INFO)
+DEFINE_OR_DECLARE_STACK_OF(X509_INFO)
 
 /*
  * The next 2 structures and their 8 routines are used to manipulate Netscape's
index 5822eab52de422aad0de1b46edc3a7c7c989370e..84b076a1cb3fad65e0a00b907bad3ce16baaa394 100644 (file)
@@ -60,9 +60,9 @@ typedef enum {
 #define X509_LU_FAIL    0
 #endif
 
-DEFINE_STACK_OF(X509_LOOKUP)
-DEFINE_STACK_OF(X509_OBJECT)
-DEFINE_STACK_OF(X509_VERIFY_PARAM)
+DEFINE_OR_DECLARE_STACK_OF(X509_LOOKUP)
+DEFINE_OR_DECLARE_STACK_OF(X509_OBJECT)
+DEFINE_OR_DECLARE_STACK_OF(X509_VERIFY_PARAM)
 
 int X509_STORE_set_depth(X509_STORE *store, int depth);
 
index 6f4743d1508847841d601b0bd893f850198787e6..e4f09adfce8ba2562c93d6fec9b8458f381ee619 100644 (file)
 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;
@@ -97,8 +116,6 @@ struct v3_ext_ctx {
 
 typedef struct v3_ext_method X509V3_EXT_METHOD;
 
-DEFINE_STACK_OF(X509V3_EXT_METHOD)
-
 /* ext_flags values */
 # define X509V3_EXT_DYNAMIC      0x1
 # define X509V3_EXT_CTX_DEP      0x2
@@ -169,11 +186,7 @@ typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
 
 typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE;
 
-DEFINE_STACK_OF(GENERAL_NAME)
 typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
-DEFINE_STACK_OF(GENERAL_NAMES)
-
-DEFINE_STACK_OF(ACCESS_DESCRIPTION)
 
 typedef struct DIST_POINT_NAME_st {
     int type;
@@ -208,8 +221,6 @@ struct DIST_POINT_st {
 
 typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
 
-DEFINE_STACK_OF(DIST_POINT)
-
 struct AUTHORITY_KEYID_st {
     ASN1_OCTET_STRING *keyid;
     GENERAL_NAMES *issuer;
@@ -223,8 +234,6 @@ typedef struct SXNET_ID_st {
     ASN1_OCTET_STRING *user;
 } SXNETID;
 
-DEFINE_STACK_OF(SXNETID)
-
 typedef struct SXNET_st {
     ASN1_INTEGER *version;
     STACK_OF(SXNETID) *ids;
@@ -256,8 +265,6 @@ typedef struct POLICYQUALINFO_st {
     } d;
 } POLICYQUALINFO;
 
-DEFINE_STACK_OF(POLICYQUALINFO)
-
 typedef struct POLICYINFO_st {
     ASN1_OBJECT *policyid;
     STACK_OF(POLICYQUALINFO) *qualifiers;
@@ -265,15 +272,11 @@ typedef struct POLICYINFO_st {
 
 typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
 
-DEFINE_STACK_OF(POLICYINFO)
-
 typedef struct POLICY_MAPPING_st {
     ASN1_OBJECT *issuerDomainPolicy;
     ASN1_OBJECT *subjectDomainPolicy;
 } POLICY_MAPPING;
 
-DEFINE_STACK_OF(POLICY_MAPPING)
-
 typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
 
 typedef struct GENERAL_SUBTREE_st {
@@ -282,8 +285,6 @@ typedef struct GENERAL_SUBTREE_st {
     ASN1_INTEGER *maximum;
 } GENERAL_SUBTREE;
 
-DEFINE_STACK_OF(GENERAL_SUBTREE)
-
 struct NAME_CONSTRAINTS_st {
     STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
     STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
@@ -458,8 +459,6 @@ typedef struct x509_purpose_st {
 # define X509V3_ADD_DELETE               5L
 # define X509V3_ADD_SILENT               0x10
 
-DEFINE_STACK_OF(X509_PURPOSE)
-
 DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
 
 DECLARE_ASN1_FUNCTIONS(SXNET)
@@ -736,7 +735,6 @@ 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_STACK_OF(X509_POLICY_NODE)
 
 #ifndef OPENSSL_NO_RFC3779
 typedef struct ASRange_st {
@@ -755,7 +753,6 @@ typedef struct ASIdOrRange_st {
 } ASIdOrRange;
 
 typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
-DEFINE_STACK_OF(ASIdOrRange)
 
 # define ASIdentifierChoice_inherit              0
 # define ASIdentifierChoice_asIdsOrRanges        1
@@ -793,7 +790,6 @@ typedef struct IPAddressOrRange_st {
 } IPAddressOrRange;
 
 typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
-DEFINE_STACK_OF(IPAddressOrRange)
 
 # define IPAddressChoice_inherit                 0
 # define IPAddressChoice_addressesOrRanges       1
@@ -812,7 +808,6 @@ typedef struct IPAddressFamily_st {
 } IPAddressFamily;
 
 typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
-DEFINE_STACK_OF(IPAddressFamily)
 
 DECLARE_ASN1_FUNCTIONS(IPAddressRange)
 DECLARE_ASN1_FUNCTIONS(IPAddressOrRange)
@@ -884,7 +879,6 @@ int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain,
 
 #endif                         /* OPENSSL_NO_RFC3779 */
 
-DEFINE_STACK_OF(ASN1_STRING)
 
 /*
  * Admission Syntax
@@ -897,8 +891,6 @@ DECLARE_ASN1_FUNCTIONS(NAMING_AUTHORITY)
 DECLARE_ASN1_FUNCTIONS(PROFESSION_INFO)
 DECLARE_ASN1_FUNCTIONS(ADMISSIONS)
 DECLARE_ASN1_FUNCTIONS(ADMISSION_SYNTAX)
-DEFINE_STACK_OF(ADMISSIONS)
-DEFINE_STACK_OF(PROFESSION_INFO)
 typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS;
 
 const ASN1_OBJECT *NAMING_AUTHORITY_get0_authorityId(
index 6498f84de67d0fb7645b2f6cbf869827736bf4c5..c46bc2e641f0f662868b8daac475e097d179f310 100644 (file)
@@ -19,6 +19,8 @@
 
 #ifndef OPENSSL_NO_SRTP
 
+DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
+
 static SRTP_PROTECTION_PROFILE srtp_known_profiles[] = {
     {
      "SRTP_AES128_CM_SHA1_80",
index fde68943a972806484734a02b144d49d26f2fdb5..2b49e7e51a0bfafa4239b09b875f4b2e501212d6 100644 (file)
 #include <openssl/x509v3.h>
 #include "internal/cryptlib.h"
 
+DEFINE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 #define TLS13_NUM_CIPHERS       OSSL_NELEM(tls13_ciphers)
 #define SSL3_NUM_CIPHERS        OSSL_NELEM(ssl3_ciphers)
 #define SSL3_NUM_SCSVS          OSSL_NELEM(ssl3_scsvs)
index b2ef4759d689218bb43e505ab741f072dd600172..51bfa439f0edadfc0825260f56a0900ef2523872 100644 (file)
@@ -25,6 +25,9 @@
 #include "ssl_cert_table.h"
 #include "internal/thread_once.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+
 static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
                                          int op, int bits, int nid, void *other,
                                          void *ex);
index 066c38a7ccdc71e8479dd6b99f4ed7998dc249d2..9ee1fc7fa9b3f6819f5232906450c67df63e90d4 100644 (file)
@@ -22,6 +22,9 @@
 #include "internal/thread_once.h"
 #include "internal/cryptlib.h"
 
+DEFINE_STACK_OF(SSL_COMP)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 /* NB: make sure indices in these tables match values above */
 
 typedef struct {
index cccda866eb8416278b8d6c59475ccf514b4b3e84..9408acc89ef8f3c1b94eeca2c4e41558136a87d5 100644 (file)
@@ -14,6 +14,8 @@
 #include <openssl/dh.h>
 #include "internal/nelem.h"
 
+DEFINE_STACK_OF(X509_NAME)
+
 /*
  * structure holding name tables. This is used for permitted elements in lists
  * such as TLSv1.
index edfd69cd90a2eaf44be5e672b2590ea1e62b2383..63cbb3d90413d60f0fb79482792b28ed22f44f3f 100644 (file)
 #include "internal/refcount.h"
 #include "internal/ktls.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(OCSP_RESPID)
+DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
+DEFINE_STACK_OF(SCT)
+
 static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t)
 {
     (void)r;
index e0b488706143bcede156381d5068f41e7024956d..7a699747d3dde9d4c6bae79d09424e44d20a6b56 100644 (file)
@@ -17,6 +17,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/pem.h>
 
+DEFINE_STACK_OF(X509)
+
 static int ssl_set_cert(CERT *c, X509 *x509);
 static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey);
 
index 5fc09d5d686802b3e98973369a6600a9785c1959..2062879406cdfebb68f11c628f32e672e7f515f1 100644 (file)
@@ -16,6 +16,8 @@
 #include "ssl_local.h"
 #include "statem/statem_local.h"
 
+DEFINE_STACK_OF(X509)
+
 static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s);
 static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s);
 static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck);
index 6bd16091d731c8cc6b666b13063083e6517d641a..3c023486da41e487c2a5500fb90dfe7871d4e9f2 100644 (file)
@@ -14,6 +14,8 @@
 #include "statem_local.h"
 #include "internal/cryptlib.h"
 
+DEFINE_STACK_OF(X509_NAME)
+
 static int final_renegotiate(SSL *s, unsigned int context, int sent);
 static int init_server_name(SSL *s, unsigned int context);
 static int final_server_name(SSL *s, unsigned int context, int sent);
index b8fcd8caa51141eac1c93613c1841df23a93e976..764c52322d9b6ca75c6e06f542e761796e7c157b 100644 (file)
 #include "internal/cryptlib.h"
 #include "statem_local.h"
 
+DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+DEFINE_STACK_OF(OCSP_RESPID)
+
 EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt,
                                           unsigned int context, X509 *x,
                                           size_t chainidx)
index 9a11bc8656585417651a3684e93598f027dc9d4e..e33b671a05397d04d08330f04107ae3568d4dfad 100644 (file)
 #include "statem_local.h"
 #include "internal/cryptlib.h"
 
+DEFINE_STACK_OF(SRTP_PROTECTION_PROFILE)
+DEFINE_STACK_OF(OCSP_RESPID)
+DEFINE_STACK_OF(X509_EXTENSION)
+
 #define COOKIE_STATE_FORMAT_VERSION     0
 
 /*
index eb4d416b6b4c63f62e82d813ab57b48598840b8b..4e43117ca29424a0c52f255b5d3d75139a6e7af7 100644 (file)
 #include <openssl/trace.h>
 #include <internal/cryptlib.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(SSL_COMP)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 static MSG_PROCESS_RETURN tls_process_as_hello_retry_request(SSL *s, PACKET *pkt);
 static MSG_PROCESS_RETURN tls_process_encrypted_extensions(SSL *s, PACKET *pkt);
 
index 1df15c39db9a74235f3e85d5edddaceee651cc4e..262fe355f3f5aa203ad0550b0140b1e40edfebda 100644 (file)
 #include <openssl/x509.h>
 #include <openssl/trace.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 /*
  * Map error codes to TLS/SSL alart types.
  */
index 83dbf67a7e600b801c20e97f770982f5e2a72517..c463f22ce242be6a44b92b5b8dbaefaaf4cbb8ae 100644 (file)
 #include <openssl/core_names.h>
 #include <openssl/asn1t.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(SSL_COMP)
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 #define TICKET_NONCE_SIZE       8
 
 typedef struct {
index dc9cd6f1eb47c6e1694943168f8168a2d752485e..7a5041b634060d1953e44bdad481548507c289fd 100644 (file)
 #include "ssl_local.h"
 #include <openssl/ct.h>
 
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+
 static const SIGALG_LOOKUP *find_sig_alg(SSL *s, X509 *x, EVP_PKEY *pkey);
 static int tls12_sigalg_allowed(const SSL *s, int op, const SIGALG_LOOKUP *lu);
 
index 370d033a4da75636f7abdacc63d7695cccc80805..9e2c5eaaea58f6e41a7bc207fd4be6910986f84e 100644 (file)
@@ -21,6 +21,8 @@
 #include "internal/nelem.h"
 #include "testutil.h"
 
+DEFINE_STACK_OF(SSL_CIPHER)
+
 static SSL_CTX *ctx;
 static SSL *s;
 
index b950411c382f1c59b40f3ca4d17b21f5da51758f..3bc103c7370e7d7e9f691605b7a2fb95ee3d4583 100644 (file)
@@ -21,6 +21,8 @@
 #include "internal/nelem.h"
 #include "testutil.h"
 
+DEFINE_STACK_OF_CONST(SSL_CIPHER)
+
 typedef struct cipherlist_test_fixture {
     const char *test_case_name;
     SSL_CTX *server;
index c4ec6cadd740bb4b8739526f775f45e8c274b753..c82a1648277aeed3af32182deb50d38b1033d613 100644 (file)
@@ -22,6 +22,8 @@
 #include "internal/nelem.h"
 #include "testutil.h"
 
+DEFINE_STACK_OF(SSL_CIPHER)
+
 typedef struct cipher_id_name {
     int id;
     const char *name;
index 44d09e0446fe39d77e5b5ea0c6df4c1b1dacf933..b10662349ca1784985ef9264211a38096c351451 100644 (file)
@@ -15,6 +15,9 @@
 
 #ifndef NDEBUG /* tests need mock server, which is available only if !NDEBUG */
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+
 static const char *server_key_f;
 static const char *server_cert_f;
 static const char *client_key_f;
index 470ab63b1303b8d008ab53a39185eb1409c07890..a2a8adc856650d706a3e7329038638245a5e86ba 100644 (file)
 
 #include <openssl/x509_vfy.h>
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+DEFINE_STACK_OF(X509_EXTENSION)
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+DEFINE_STACK_OF(POLICYINFO)
+
 typedef struct test_fixture {
     const char *test_case_name;
     OSSL_CMP_CTX *ctx;
index 6e78432d47798f57bfaf1ccbef9be95a45fab2af..cd30c4976269fb1637fbf8302c7e888e392bfe8b 100644 (file)
@@ -11,6 +11,9 @@
 
 #include "cmp_testlib.h"
 
+DEFINE_STACK_OF(OSSL_CMP_ITAV)
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];
 
 typedef struct test_fixture {
index 6aadd439bcd4ab460124f7f4b289a68891ce7af8..413e284fcc1c73eef0de87451185158537f75f21 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "cmp_testlib.h"
 
+DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
+
 static const char *server_cert_f;
 static const char *pkcs10_f;
 
index fc006ac6ca820afb1650417c21e11987a44d591e..ce5a6cb420e8e29bcc471138f2001c005f7557f0 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "cmp_testlib.h"
 
+DEFINE_STACK_OF(X509)
+
 static const char *ir_protected_f;
 static const char *ir_unprotected_f;
 static const char *ip_PBM_f;
index 7358f1589f1ea71d337f5202341b1f48afb9a78a..bf6699a2b17441769e6fa26cf32274dd4fd649e0 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "cmp_testlib.h"
 
+DEFINE_STACK_OF(ASN1_UTF8STRING)
+
 typedef struct test_fixture {
     const char *test_case_name;
     int pkistatus;
index bb3351b4b0d3a2f87812cbb84442181ea2cba6ab..d25ab7468b592dac92125c9ff5fdf6787dc5ea7e 100644 (file)
@@ -12,6 +12,8 @@
 #include "cmp_testlib.h"
 #include <openssl/rsa.h> /* needed in case config no-deprecated */
 
+DEFINE_STACK_OF(X509)
+
 EVP_PKEY *load_pem_key(const char *file)
 {
     EVP_PKEY *key = NULL;
index 5f43f1e2ec6fe8ec2821b1282dc08a8a0e308511..c74dd2faeca4be5a5141f902e236b4a20a7d2ccd 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "cmp_testlib.h"
 #include "../crypto/crmf/crmf_local.h" /* for manipulating POPO signature */
+DEFINE_STACK_OF(OSSL_CRMF_MSG)
 
 static const char *server_f;
 static const char *client_f;
index ad1cbd1c1475a40cc8b1a8690b0394d4854dd2ff..2ac330a8fa3c6d0cc9b8a4e4a55bbbf063305a8f 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "testutil.h"
 
+DEFINE_STACK_OF(X509)
+
 static X509 *cert = NULL;
 static EVP_PKEY *privkey = NULL;
 
index dbf6244653428d11af4124da2361c002217a2136..48b3779df770cfac8fefb91b482f326d46858aee 100644 (file)
@@ -14,6 +14,9 @@
 #include <openssl/safestack.h>
 #include <openssl/err.h>
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF_CSTRING()
+
 static STACK_OF(OPENSSL_CSTRING) *section_names = NULL;
 
 static void collect_section_name(CONF_VALUE *v)
index 6a2ef4e90d1f044015122b2437c6abc7828942a4..ac2d27b32814f0f919c3a485258d5170ace129a7 100644 (file)
@@ -17,6 +17,9 @@
 
 #include "testutil.h"
 
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+
 #define PARAM_TIME 1474934400 /* Sep 27th, 2016 */
 
 static const char *kCRLTestRoot[] = {
index bd098c5d6a7da52d3293a2067583ac641e461df0..79ffcbf9a2c02619469e389d8df0aff1dd0ab881 100644 (file)
@@ -21,6 +21,9 @@
 #include <openssl/crypto.h>
 
 #ifndef OPENSSL_NO_CT
+
+DEFINE_STACK_OF(SCT)
+
 /* Used when declaring buffers to read text files into */
 # define CT_TEST_MAX_FILE_SIZE 8096
 
index b0d6ffe563b8a28488732d06507f659c8e624562..96b9579f3ce961253e1d7554f712081f03786bbf 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "internal/nelem.h"
 
+DEFINE_STACK_OF(X509)
+
 #define _UC(c) ((unsigned char)(c))
 
 static const char *basedomain;
index 33603baed6cef88672cbb7e5dde4bdf2838e24cc..b45df8a2e9b662abe75328ce8e3bf3b8f2c6b619 100644 (file)
@@ -20,6 +20,8 @@
 /* for SSL_READ_ETM() */
 #include "../ssl/ssl_local.h"
 
+DEFINE_STACK_OF(SSL_CIPHER)
+
 static int debug = 0;
 
 static unsigned int clnt_psk_callback(SSL *ssl, const char *hint,
index 71e4716292d869336a4a9b39440ab06b3b00bb4f..6727a007a0f38c900f48b4ca38922d4b0ef5dd15 100644 (file)
@@ -25,6 +25,8 @@
 #include "testutil.h"
 #include "evp_test.h"
 
+DEFINE_STACK_OF_STRING()
+
 #define AAD_NUM 4
 
 typedef struct evp_test_method_st EVP_TEST_METHOD;
index d46db3f2986da35c7106689ebd06be3302ee93b6..32aa12c466fc706dfca1507756b1e2592c1589de 100644 (file)
@@ -26,6 +26,8 @@
 #include <netinet/sctp.h>
 #endif
 
+DEFINE_STACK_OF(X509_NAME)
+
 HANDSHAKE_RESULT *HANDSHAKE_RESULT_new(void)
 {
     HANDSHAKE_RESULT *ret;
index 6449c6f61e60caa32f2cdced507f2f39df76a166..f0b12a7dd0fb6b62200496210cff03a19ef78818 100644 (file)
@@ -15,6 +15,8 @@
 
 #include "testutil.h"
 
+DEFINE_STACK_OF(CONF_VALUE)
+
 static const ASN1_ITEM *x509_it = NULL;
 static X509 *x509 = NULL;
 #define SERVER "mock.server"
index 9e8c30625996a0c17b36c0286472e8a21ae06d28..4ea6c636d46ebf0e61071d77641b31dcdf047438 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "testutil.h"
 
+DEFINE_STACK_OF(X509)
+
 static const char *certstr;
 static const char *privkeystr;
 
index c671feaf21e1a2ff29ec34da4890a69a6544bb39..731f569743b6492f4851d464315d559c383e6ce7 100644 (file)
@@ -19,6 +19,8 @@
 #include "ssl_test_ctx.h"
 #include "testutil.h"
 
+DEFINE_STACK_OF(X509_NAME)
+
 static CONF *conf = NULL;
 static OSSL_PROVIDER *defctxnull = NULL, *thisprov = NULL;
 static OPENSSL_CTX *libctx = NULL;
index 6a3b66bcb98e9ba91ee25c0c3971b44a6f9212e3..f591adf90ba91b294b848154742c8a959a1608f9 100644 (file)
@@ -20,6 +20,9 @@
 # define strcasecmp _stricmp
 #endif
 
+DEFINE_STACK_OF(CONF_VALUE)
+DEFINE_STACK_OF(X509_NAME)
+
 static const int default_app_data_size = 256;
 /* Default set to be as small as possible to exercise fragmentation. */
 static const int default_max_fragment_size = 512;
index d1635585e86f68e6539db049c8e492f3516aa482..f9349bc59b377a864a1394fede15793e815ff004 100644 (file)
 #include "internal/ktls.h"
 #include "../ssl/ssl_local.h"
 
+DEFINE_STACK_OF(OCSP_RESPID)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_NAME)
+
 static OPENSSL_CTX *libctx = NULL;
 static OSSL_PROVIDER *defctxnull = NULL;
 
@@ -5518,6 +5522,8 @@ static int test_pha_key_update(void)
 
 static SRP_VBASE *vbase = NULL;
 
+DEFINE_STACK_OF(SRP_user_pwd)
+
 static int ssl_srp_cb(SSL *s, int *ad, void *arg)
 {
     int ret = SSL3_AL_FATAL;
index 135fe48509be1d16223db9c15938bb30d69d1dbb..476a1758adbc6c0e016238ee0a50f3521e1771b1 100644 (file)
@@ -11,6 +11,8 @@
 #include "ssltestlib.h"
 #include "testutil.h"
 
+DEFINE_STACK_OF(SSL_CIPHER)
+
 static int docorrupt = 0;
 
 static void copy_flags(BIO *bio)
index dca0694ecf60386e9871defbc1de6e40878365c3..d45b2786d31bfc55790dfcd6095bdf73333a95d3 100644 (file)
@@ -81,6 +81,9 @@
 # include <unistd.h>
 #endif
 
+DEFINE_STACK_OF(SSL_COMP)
+DEFINE_STACK_OF_STRING()
+
 static SSL_CTX *s_ctx = NULL;
 static SSL_CTX *s_ctx2 = NULL;
 
index d17ab7146a805f0425478d55317d6ec7edbd1bf2..507b0fcf9fb6842fbe025961bc0613bda6a201f1 100644 (file)
@@ -19,6 +19,8 @@
 # define strcasecmp _stricmp
 #endif
 
+DEFINE_STACK_OF(GENERAL_NAME)
+
 static const char *const names[] = {
     "a", "b", ".", "*", "@",
     ".a", "a.", ".b", "b.", ".*", "*.", "*@", "@*", "a@", "@a", "b@", "..",
index 3dd4562714df251f8f06271de5ccc426f7f3c8a7..6cce626026ff07bd67de226deafbcb7c2d694df8 100644 (file)
@@ -16,6 +16,8 @@
 #include <openssl/err.h>
 #include "testutil.h"
 
+DEFINE_STACK_OF(X509)
+
 static const char *roots_f;
 static const char *untrusted_f;
 static const char *bad_f;
index ed0f61056f069e1b25f38956e5e2abad8ee40720..2b02fef5f5711888dbac9f43dde409af3955c4a3 100644 (file)
@@ -124,6 +124,11 @@ PKCS7_get_detached(3)
 PKCS7_is_detached(3)
 STACK_OF(3)
 SKM_DEFINE_STACK_OF(3)
+DEFINE_OR_DECLARE_STACK_OF(3)
+DEFINE_OR_DECLARE_STACK_OF_STRING(3)
+DEFINE_OR_DECLARE_STACK_OF_CSTRING(3)
+DEFINE_STACK_OF_STRING(3)
+DEFINE_STACK_OF_CSTRING(3)
 U64(3)
 SSL_set_mtu(3)
 DTLS_set_link_mtu(3)
index 6d615016b451eb8422da4ba4eb0816c76c9090a8..6d060bb77a67313dd400e1213fa14d2db6f842ad 100644 (file)
@@ -372,6 +372,28 @@ EOF
     { regexp   => qr/DEFINE_STACK_OF_CONST<<<\((.*)\)>>>/,
       massager => sub { return ("SKM_DEFINE_STACK_OF($1,const $1,$1)"); },
     },
+    { regexp   => qr/DEFINE_STACK_OF_STRING<<<\((.*?)\)>>>/,
+      massager => sub {
+          return ("DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)");
+      }
+    },
+    { regexp   => qr/DEFINE_STACK_OF_CSTRING<<<\((.*?)\)>>>/,
+      massager => sub {
+          return ("DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)");
+      }
+    },
+    # DEFINE_OR_DECLARE macro calls must be interpretted as DEFINE macro
+    # calls, because that's what they look like to the external apps.
+    # (if that ever changes, we must change the substitutions to STACK_OF)
+    { regexp   => qr/DEFINE_OR_DECLARE_STACK_OF<<<\((.*?)\)>>>/,
+      massager => sub { return ("DEFINE_STACK_OF($1)"); }
+    },
+    { regexp   => qr/DEFINE_OR_DECLARE_STACK_OF_STRING<<<\(\)>>>/,
+      massager => sub { return ("DEFINE_STACK_OF_STRING()"); },
+    },
+    { regexp   => qr/DEFINE_OR_DECLARE_STACK_OF_CSTRING<<<\(\)>>>/,
+      massager => sub { return ("DEFINE_STACK_OF_CSTRING()"); },
+    },
 
     #####
     # ASN1 stuff