Fix safestack issues in asn1.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 13:35:41 +0000 (14:35 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:10:40 +0000 (11:10 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12781)

44 files changed:
.gitignore
apps/asn1pars.c
apps/cmp_mock_srv.c
apps/x509.c
build.info
crypto/asn1/a_strnid.c
crypto/asn1/asn1_gen.c
crypto/asn1/asn1_lib.c
crypto/asn1/asn_mime.c
crypto/asn1/d2i_pr.c
crypto/cmp/cmp_client.c
crypto/cmp/cmp_ctx.c
crypto/cmp/cmp_hdr.c
crypto/cmp/cmp_msg.c
crypto/cmp/cmp_status.c
crypto/cmp/cmp_util.c
crypto/cms/cms_sd.c
crypto/ocsp/ocsp_ext.c
crypto/pkcs7/pk7_attr.c
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_lib.c
crypto/pkcs7/pk7_smime.c
crypto/ts/ts_rsp_print.c
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_verify.c
crypto/x509/pcy_data.c
crypto/x509/pcy_map.c
crypto/x509/pcy_node.c
crypto/x509/pcy_tree.c
crypto/x509/t_x509.c
crypto/x509/v3_admis.c
crypto/x509/v3_cpols.c
crypto/x509/v3_extku.c
crypto/x509/v3_purp.c
crypto/x509/v3_tlsf.c
crypto/x509/x509_att.c
crypto/x509/x509_trs.c
crypto/x509/x509_vpm.c
crypto/x509/x_attrib.c
crypto/x509/x_x509a.c
include/openssl/asn1.h.in [moved from include/openssl/asn1.h with 98% similarity]
test/cmp_ctx_test.c
test/cmp_hdr_test.c
test/cmp_status_test.c

index 0ab5c085571ddc3c0f75280330f50e6bf01b6d2b..0565a0c3d3305bc80085bd99ad917baef11ff234 100644 (file)
 # Auto generated headers
 /crypto/buildinf.h
 /include/crypto/*_conf.h
+/include/openssl/asn1.h
 /include/openssl/configuration.h
-/include/openssl/opensslv.h
 /include/openssl/fipskey.h
+/include/openssl/opensslv.h
 /include/openssl/safestack.h
 /include/openssl/ssl.h
 /include/openssl/x509.h
index 9acc3c0080376398cad1ce430282fd0080ea12aa..ae47aa8efcbefbb5fdc8dd122aa17226c0dcc124 100644 (file)
@@ -18,8 +18,6 @@
 #include <openssl/pem.h>
 #include <openssl/asn1t.h>
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 typedef enum OPTION_choice {
     OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
     OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,
index 2c825678565336c07ed45cf2bd3a4f6913fdc2ba..89db709f9468117960846eeef88f876885ef1ed5 100644 (file)
@@ -16,7 +16,6 @@
 #include <openssl/cmperr.h>
 
 DEFINE_STACK_OF(OSSL_CMP_ITAV)
-DEFINE_STACK_OF(ASN1_UTF8STRING)
  
 /* the context for the CMP mock server */
 typedef struct
index a8f515a90ba9fb19105ea6cd9be772cad441e426..5627bd9dbe6009a22c48af36e01afd8ea99d3cdd 100644 (file)
@@ -28,8 +28,6 @@
 # include <openssl/dsa.h>
 #endif
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 #undef POSTFIX
 #define POSTFIX ".srl"
 #define DEF_DAYS        30
index 9dc37a1b7eedefcb810daca7abd99809ee7fa890..33022e8bb30b61c0aa42b29e3a68f04f7e5a113d 100644 (file)
@@ -13,8 +13,10 @@ DEPEND[libssl]=libcrypto
 
 # Empty DEPEND "indices" means the dependencies are expected to be built
 # unconditionally before anything else.
-DEPEND[]=include/openssl/configuration.h include/openssl/opensslv.h \
+DEPEND[]=include/openssl/asn1.h \
+         include/openssl/configuration.h \
          include/openssl/fipskey.h \
+         include/openssl/opensslv.h \
          include/openssl/safestack.h \
          include/openssl/ssl.h \
          include/openssl/x509.h \
@@ -22,9 +24,10 @@ DEPEND[]=include/openssl/configuration.h include/openssl/opensslv.h \
          include/crypto/bn_conf.h include/crypto/dso_conf.h \
          doc/man7/openssl_user_macros.pod
 
+GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
 GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
-GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
 GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
+GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
 GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
 GENERATE[include/openssl/ssl.h]=include/openssl/ssl.h.in
 GENERATE[include/openssl/x509.h]=include/openssl/x509.h.in
index b2be46120834110db0986c8907b282443d6632b0..5fab787f3897a8893893460b1283283f99eb69c0 100644 (file)
@@ -12,8 +12,6 @@
 #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 9723da0a3c88f88fdb81a27df964f3229d8fe129..97094b3e0e06913c183a2ec8d1a1936bc92b19ed 100644 (file)
@@ -23,7 +23,6 @@
 
 #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
index 47ae801b94ebf73593d1b5a496525d65a3e96668..1331f608f42bd8fe671b5522375bcd304714e72f 100644 (file)
@@ -13,8 +13,6 @@
 #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 461ffbb332c04fb2fde4fda9b0a5e42333deddaa..65e84250458e1ca319e04d372a5c30f85a74deba 100644 (file)
@@ -20,7 +20,6 @@
 #include "asn1_local.h"
 
 DEFINE_STACK_OF(BIO)
-DEFINE_STACK_OF(X509_ALGOR)
 
 /*
  * Generalised MIME like utilities for streaming ASN1. Although many have a
index ba8178269880271fd5efd9ba2d28a42d8c3176df..fcf8d2f8d04cd5b4a61a2afc82d15e02c3885051 100644 (file)
@@ -21,7 +21,6 @@
 #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 567eb45519bfdce143538af1c464a1cef6d87a81..3889d63fcdbeb638f930018972a46fdf43701db0 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "openssl/cmp_util.h"
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 DEFINE_STACK_OF(OSSL_CMP_CERTRESPONSE)
 DEFINE_STACK_OF(OSSL_CMP_PKISI)
 DEFINE_STACK_OF(OSSL_CRMF_CERTID)
index 107cfb1b85d19882057969590aeca51c72220210..fdbd90a0766e607c915e36ae36bf5b095e0d2808 100644 (file)
@@ -21,7 +21,6 @@
 #include <openssl/crmf.h>
 #include <openssl/err.h>
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 DEFINE_STACK_OF(OSSL_CMP_ITAV)
 
 /*
index 6bd1e581af57cb59f2c8d309ccef232361ca67a5..2691fce1b501bfdbd6880952852467f8c924d676 100644 (file)
@@ -20,7 +20,6 @@
 #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)
index d7f0e1fff74c83f95a4d825ded052a0b15d4d7e0..c11fe4ca93145412ee8640e1dd35ed6404d5588b 100644 (file)
@@ -27,7 +27,6 @@ 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)
 {
index 8f10a42fb95cdd5f5d1b169d1fe02b9917c0fca7..c9809c5a3a7c9a80ad482707de0c2c0a1fd39516 100644 (file)
@@ -26,8 +26,6 @@
 #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 ec292ee35289e6169ed893e074a367e094b18c12..bdd876a89f215e051012061b32ab062299fcca98 100644 (file)
@@ -17,7 +17,6 @@
 #include <openssl/x509v3.h>
 
 DEFINE_STACK_OF(X509_OBJECT)
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 
 /*
  * use trace API for CMP-specific logging, prefixed by "CMP " and severity
index ac07ddefe9f34a026e34b3ee6fc628583c988203..e76766bab728fdd7aaa75cc436c7281e15d72fe1 100644 (file)
@@ -24,7 +24,6 @@
 
 DEFINE_STACK_OF(CMS_RevocationInfoChoice)
 DEFINE_STACK_OF(CMS_SignerInfo)
-DEFINE_STACK_OF(X509_ALGOR)
 
 /* CMS SignedData Utilities */
 
index f8c9c0029d38ab97165f24052ec3bd3fb541ee3d..c2b61bd4f2c43a738541104667b221f395339cb6 100644 (file)
@@ -16,8 +16,6 @@
 #include <openssl/rand.h>
 #include <openssl/x509v3.h>
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 /* Standard wrapper functions for extensions */
 
 /* OCSP request extensions */
index 926a02a32ed9c4b6da371eb287bfccac54977325..7df05c8084ee30d3550e77e79b7e393f211f6ccb 100644 (file)
@@ -17,8 +17,6 @@
 #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 faefa9e95b551bf3fe1266ef9c493c4a03ca8f03..8362d77b7eac801861dfac325b72d9d8184d407e 100644 (file)
@@ -16,7 +16,6 @@
 #include <openssl/err.h>
 #include "pk7_local.h"
 
-DEFINE_STACK_OF(X509_ALGOR)
 DEFINE_STACK_OF(PKCS7_RECIP_INFO)
 DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
 
index 59e23a445f6af20ad4b190ae2036b3d635ffa5b8..e169783e52016106faae2e1a6f9d47906feec2dc 100644 (file)
@@ -16,7 +16,6 @@
 #include "crypto/x509.h" /* for sk_X509_add1_cert() */
 #include "pk7_local.h"
 
-DEFINE_STACK_OF(X509_ALGOR)
 DEFINE_STACK_OF(PKCS7_RECIP_INFO)
 DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
 
index 2bd495a717a1b5b979b49a1909b67c9ec888bf52..de8c0568dbaa899145c89971d225aa3d153209a7 100644 (file)
@@ -17,7 +17,6 @@
 
 #define BUFFERSIZE 4096
 
-DEFINE_STACK_OF(X509_ALGOR)
 DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
 
 static int pkcs7_copy_existing_digest(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
index b5374e0fc1f8ac072f177fcc0b5cef885b0b7050..e74ef452cca9b7d7dcab1c356b78cccacdd882c6 100644 (file)
@@ -15,7 +15,6 @@
 #include <openssl/ts.h>
 #include "ts_local.h"
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 DEFINE_STACK_OF(CONF_VALUE)
 
 struct status_map_st {
index a1904719cc7356a021c9c24d0cc8b20221a8700c..0e139be5b9ce114f13d3a2fd394d5c126b5d7d5b 100644 (file)
@@ -17,8 +17,6 @@
 #include "ts_local.h"
 #include "crypto/ess.h"
 
-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 *);
index 02690c19a71173de9e0ca8abebfd5b70a17f4bec..0077798c43e861494c48a59349b52c33eebf8ed1 100644 (file)
@@ -18,7 +18,6 @@
 DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
 DEFINE_STACK_OF(ESS_CERT_ID)
 DEFINE_STACK_OF(ESS_CERT_ID_V2)
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 
 static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
                           X509 *signer, STACK_OF(X509) **chain);
index f0f2db6e108ea4611727c7f4f935fc945cbbcf60..9499f94dff73933a3b4620d8f51758b1c339db07 100644 (file)
@@ -13,8 +13,6 @@
 
 #include "pcy_local.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 /* Policy Node routines */
 
 void policy_data_free(X509_POLICY_DATA *data)
index 78c2d5904b35edce8e37ff23bb34ab714684a3f5..a1210ef37ffcc1737a103ce42edc78db2237f613 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "pcy_local.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 /*
  * Set policy mapping entries in cache. Note: this modifies the passed
  * POLICY_MAPPINGS structure
index 60b903416064b0b3295273f176367f751ee3a06c..d2b43814bd15443c2934848ba56d77233bbe8e3a 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "pcy_local.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 static int node_cmp(const X509_POLICY_NODE *const *a,
                     const X509_POLICY_NODE *const *b)
 {
index bffded30f866bf70f5ba6c5072785ffa343e99c1..3ee30745d28549d36137a7347640568b0ae29c83 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "pcy_local.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 static void expected_print(BIO *channel,
                            X509_POLICY_LEVEL *lev, X509_POLICY_NODE *node,
                            int indent)
index 8f4b8e82228472b01ec9485ccfa5602dc6594661..2d0ccd8a683e775dbb381db81f2c7b0159647121 100644 (file)
@@ -17,8 +17,6 @@
 #include "crypto/asn1.h"
 #include "crypto/x509.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 #ifndef OPENSSL_NO_STDIO
 int X509_print_fp(FILE *fp, X509 *x)
 {
index 74b1f3d883e2d0ecf3ebfe476abd0e84fcb5de32..0dfd088eb4919dfaf66638b728181cd7f46e85aa 100644 (file)
@@ -20,8 +20,6 @@
 #include "v3_admis.h"
 #include "ext_dat.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
-
 ASN1_SEQUENCE(NAMING_AUTHORITY) = {
     ASN1_OPT(NAMING_AUTHORITY, namingAuthorityId, ASN1_OBJECT),
     ASN1_OPT(NAMING_AUTHORITY, namingAuthorityUrl, ASN1_IA5STRING),
index 2de281cd609bb6b2cd886cfdcb7bf871fb0803b5..f7dcfb5dce58c564413929f673261139ff18bb0f 100644 (file)
@@ -19,7 +19,6 @@
 #include "ext_dat.h"
 
 DEFINE_STACK_OF(CONF_VALUE)
-DEFINE_STACK_OF(ASN1_INTEGER)
 
 /* Certificate policies extension support: this one is a bit complex... */
 
index 7769bc99310d54b66d1edd670bae87a82deba949..b96fb58ac81175874ced11f7cb48fb32279667cd 100644 (file)
@@ -14,7 +14,6 @@
 #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,
index f36ef8a3a1ee1d4e0eeb607c77ce31ad0e1a6049..92f3bbe3b0ddd3ae68c9773812431a49e8521678 100644 (file)
@@ -16,8 +16,6 @@
 #include "internal/tsan_assist.h"
 #include "x509_local.h"
 
-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 81ce333a34c3084ef20350d5cc3c13a4ba4f9e2c..1ccf7dab108efca9196306c3ee56ea1d118ae2f6 100644 (file)
@@ -16,7 +16,6 @@
 #include "ext_dat.h"
 #include "x509_local.h"
 
-DEFINE_STACK_OF(ASN1_INTEGER)
 DEFINE_STACK_OF(CONF_VALUE)
 
 static STACK_OF(CONF_VALUE) *i2v_TLS_FEATURE(const X509V3_EXT_METHOD *method,
index bb4bfe03f4a9d982ccfdeadf5606b97584e1d28b..d93d757aefa1367a0f3924254f171b1988384b42 100644 (file)
@@ -17,8 +17,6 @@
 #include <openssl/x509v3.h>
 #include "x509_local.h"
 
-DEFINE_STACK_OF(ASN1_TYPE)
-
 int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
 {
     return sk_X509_ATTRIBUTE_num(x);
index 92e2220a13b86270d0975ed1469a1266de8fb9ff..10718c347dda7ac98078ac1110e99dd24d7969aa 100644 (file)
@@ -12,8 +12,6 @@
 #include <openssl/x509v3.h>
 #include "crypto/x509.h"
 
-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 8fe09fd61aa84c92a618e83367d623d52e2f69ec..17c07909115e5ae676f642bc654ca2c985c896fc 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "x509_local.h"
 
-DEFINE_STACK_OF(ASN1_OBJECT)
 DEFINE_STACK_OF(X509_VERIFY_PARAM)
 
 /* X509_VERIFY_PARAM functions */
index fca6df5067d9651c0e0275711b9d2d84302eae79..5c5e6081733454879bed8766ce485699e1c19e6a 100644 (file)
@@ -14,8 +14,6 @@
 #include <openssl/x509.h>
 #include "x509_local.h"
 
-DEFINE_STACK_OF(ASN1_TYPE)
-
 /*-
  * X509_ATTRIBUTE: this has the following form:
  *
index f0dc9d6535f233e2da2411dfc9b188501ddbf72b..ef93db26d87f566169c5beb6e17eb278065530a5 100644 (file)
@@ -14,8 +14,6 @@
 #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
similarity index 98%
rename from include/openssl/asn1.h
rename to include/openssl/asn1.h.in
index b47e8e823e2a1eba19fe8a46edabfabbbec9b027..c4d6f068ae1266ec26c1f84c9a506921d1167ab7 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
@@ -7,6 +9,10 @@
  * https://www.openssl.org/source/license.html
  */
 
+{-
+use OpenSSL::stackhash qw(generate_stack_macros);
+-}
+
 #ifndef OPENSSL_ASN1_H
 # define OPENSSL_ASN1_H
 # pragma once
@@ -121,7 +127,10 @@ extern "C" {
 # define SMIME_STREAM            0x1000
 
 /* Stacks for types not otherwise defined in this header */
-DEFINE_OR_DECLARE_STACK_OF(X509_ALGOR)
+{-
+    generate_stack_macros("X509_ALGOR");
+-}
+
 
 # define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
 /*
@@ -196,7 +205,9 @@ struct asn1_string_table_st {
     unsigned long flags;
 };
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_STRING_TABLE)
+{-
+    generate_stack_macros("ASN1_STRING_TABLE");
+-}
 
 /* size limits: this stuff is taken straight from RFC2459 */
 
@@ -452,7 +463,9 @@ struct asn1_type_st {
     } value;
 };
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_TYPE)
+{-
+    generate_stack_macros("ASN1_TYPE");
+-}
 
 typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
 
@@ -506,7 +519,9 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
 ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t);
 void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_OBJECT)
+{-
+    generate_stack_macros("ASN1_OBJECT");
+-}
 
 DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT)
 
@@ -542,7 +557,10 @@ int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
 int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
                             BIT_STRING_BITNAME *tbl);
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_INTEGER)
+{-
+    generate_stack_macros("ASN1_INTEGER");
+-}
+
 
 DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
 ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
@@ -577,7 +595,9 @@ int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
 int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
                           int len);
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_UTF8STRING)
+{-
+    generate_stack_macros("ASN1_UTF8STRING");
+-}
 
 DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
 DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
@@ -588,7 +608,9 @@ DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
 int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
 int UTF8_putc(unsigned char *str, int len, unsigned long value);
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_GENERALSTRING)
+{-
+    generate_stack_macros("ASN1_GENERALSTRING");
+-}
 
 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
 
index 997edf64cb70042d3d7a1aeeefbac1535bc6e643..58c3fc85f797a548ebbc3a9ec2d4963dfba7a382 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <openssl/x509_vfy.h>
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 DEFINE_STACK_OF(OSSL_CMP_ITAV)
 
 typedef struct test_fixture {
index 4dcf998e26b56ac3960769b6115edaa209c0c44c..344df43fea9593240e6943c87b7d3f1f7370670f 100644 (file)
@@ -12,7 +12,6 @@
 #include "cmp_testlib.h"
 
 DEFINE_STACK_OF(OSSL_CMP_ITAV)
-DEFINE_STACK_OF(ASN1_UTF8STRING)
 
 static unsigned char rand_data[OSSL_CMP_TRANSACTIONID_LENGTH];
 
index bf6699a2b17441769e6fa26cf32274dd4fd649e0..7358f1589f1ea71d337f5202341b1f48afb9a78a 100644 (file)
@@ -11,8 +11,6 @@
 
 #include "cmp_testlib.h"
 
-DEFINE_STACK_OF(ASN1_UTF8STRING)
-
 typedef struct test_fixture {
     const char *test_case_name;
     int pkistatus;