summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-09-03 14:35:41 +0100
committerMatt Caswell <matt@openssl.org>2020-09-13 11:10:40 +0100
commitb4780134df95b34ae263e966e93c83594a38de5b (patch)
tree81e361e6653d1fc025af029be24d71af6a8f5051 /crypto
parent24c4ea958ecae0b194cc3eb812a81766cdb421f6 (diff)
Fix safestack issues in asn1.h
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/a_strnid.c2
-rw-r--r--crypto/asn1/asn1_gen.c1
-rw-r--r--crypto/asn1/asn1_lib.c2
-rw-r--r--crypto/asn1/asn_mime.c1
-rw-r--r--crypto/asn1/d2i_pr.c1
-rw-r--r--crypto/cmp/cmp_client.c1
-rw-r--r--crypto/cmp/cmp_ctx.c1
-rw-r--r--crypto/cmp/cmp_hdr.c1
-rw-r--r--crypto/cmp/cmp_msg.c1
-rw-r--r--crypto/cmp/cmp_status.c2
-rw-r--r--crypto/cmp/cmp_util.c1
-rw-r--r--crypto/cms/cms_sd.c1
-rw-r--r--crypto/ocsp/ocsp_ext.c2
-rw-r--r--crypto/pkcs7/pk7_attr.c2
-rw-r--r--crypto/pkcs7/pk7_doit.c1
-rw-r--r--crypto/pkcs7/pk7_lib.c1
-rw-r--r--crypto/pkcs7/pk7_smime.c1
-rw-r--r--crypto/ts/ts_rsp_print.c1
-rw-r--r--crypto/ts/ts_rsp_sign.c2
-rw-r--r--crypto/ts/ts_rsp_verify.c1
-rw-r--r--crypto/x509/pcy_data.c2
-rw-r--r--crypto/x509/pcy_map.c2
-rw-r--r--crypto/x509/pcy_node.c2
-rw-r--r--crypto/x509/pcy_tree.c2
-rw-r--r--crypto/x509/t_x509.c2
-rw-r--r--crypto/x509/v3_admis.c2
-rw-r--r--crypto/x509/v3_cpols.c1
-rw-r--r--crypto/x509/v3_extku.c1
-rw-r--r--crypto/x509/v3_purp.c2
-rw-r--r--crypto/x509/v3_tlsf.c1
-rw-r--r--crypto/x509/x509_att.c2
-rw-r--r--crypto/x509/x509_trs.c2
-rw-r--r--crypto/x509/x509_vpm.c1
-rw-r--r--crypto/x509/x_attrib.c2
-rw-r--r--crypto/x509/x_x509a.c2
35 files changed, 0 insertions, 52 deletions
diff --git a/crypto/asn1/a_strnid.c b/crypto/asn1/a_strnid.c
index b2be461208..5fab787f38 100644
--- a/crypto/asn1/a_strnid.c
+++ b/crypto/asn1/a_strnid.c
@@ -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,
diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c
index 9723da0a3c..97094b3e0e 100644
--- a/crypto/asn1/asn1_gen.c
+++ b/crypto/asn1/asn1_gen.c
@@ -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
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c
index 47ae801b94..1331f608f4 100644
--- a/crypto/asn1/asn1_lib.c
+++ b/crypto/asn1/asn1_lib.c
@@ -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);
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 461ffbb332..65e8425045 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -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
diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c
index ba81782698..fcf8d2f8d0 100644
--- a/crypto/asn1/d2i_pr.c
+++ b/crypto/asn1/d2i_pr.c
@@ -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)
{
diff --git a/crypto/cmp/cmp_client.c b/crypto/cmp/cmp_client.c
index 567eb45519..3889d63fcd 100644
--- a/crypto/cmp/cmp_client.c
+++ b/crypto/cmp/cmp_client.c
@@ -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)
diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c
index 107cfb1b85..fdbd90a076 100644
--- a/crypto/cmp/cmp_ctx.c
+++ b/crypto/cmp/cmp_ctx.c
@@ -21,7 +21,6 @@
#include <openssl/crmf.h>
#include <openssl/err.h>
-DEFINE_STACK_OF(ASN1_UTF8STRING)
DEFINE_STACK_OF(OSSL_CMP_ITAV)
/*
diff --git a/crypto/cmp/cmp_hdr.c b/crypto/cmp/cmp_hdr.c
index 6bd1e581af..2691fce1b5 100644
--- a/crypto/cmp/cmp_hdr.c
+++ b/crypto/cmp/cmp_hdr.c
@@ -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)
diff --git a/crypto/cmp/cmp_msg.c b/crypto/cmp/cmp_msg.c
index d7f0e1fff7..c11fe4ca93 100644
--- a/crypto/cmp/cmp_msg.c
+++ b/crypto/cmp/cmp_msg.c
@@ -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)
{
diff --git a/crypto/cmp/cmp_status.c b/crypto/cmp/cmp_status.c
index 8f10a42fb9..c9809c5a3a 100644
--- a/crypto/cmp/cmp_status.c
+++ b/crypto/cmp/cmp_status.c
@@ -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)
diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c
index ec292ee352..bdd876a89f 100644
--- a/crypto/cmp/cmp_util.c
+++ b/crypto/cmp/cmp_util.c
@@ -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
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index ac07ddefe9..e76766bab7 100644
--- a/crypto/cms/cms_sd.c
+++ b/crypto/cms/cms_sd.c
@@ -24,7 +24,6 @@
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
DEFINE_STACK_OF(CMS_SignerInfo)
-DEFINE_STACK_OF(X509_ALGOR)
/* CMS SignedData Utilities */
diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c
index f8c9c0029d..c2b61bd4f2 100644
--- a/crypto/ocsp/ocsp_ext.c
+++ b/crypto/ocsp/ocsp_ext.c
@@ -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 */
diff --git a/crypto/pkcs7/pk7_attr.c b/crypto/pkcs7/pk7_attr.c
index 926a02a32e..7df05c8084 100644
--- a/crypto/pkcs7/pk7_attr.c
+++ b/crypto/pkcs7/pk7_attr.c
@@ -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)
{
diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c
index faefa9e95b..8362d77b7e 100644
--- a/crypto/pkcs7/pk7_doit.c
+++ b/crypto/pkcs7/pk7_doit.c
@@ -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)
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c
index 59e23a445f..e169783e52 100644
--- a/crypto/pkcs7/pk7_lib.c
+++ b/crypto/pkcs7/pk7_lib.c
@@ -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)
diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c
index 2bd495a717..de8c0568db 100644
--- a/crypto/pkcs7/pk7_smime.c
+++ b/crypto/pkcs7/pk7_smime.c
@@ -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);
diff --git a/crypto/ts/ts_rsp_print.c b/crypto/ts/ts_rsp_print.c
index b5374e0fc1..e74ef452cc 100644
--- a/crypto/ts/ts_rsp_print.c
+++ b/crypto/ts/ts_rsp_print.c
@@ -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 {
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index a1904719cc..0e139be5b9 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -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 *);
diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index 02690c19a7..0077798c43 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -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);
diff --git a/crypto/x509/pcy_data.c b/crypto/x509/pcy_data.c
index f0f2db6e10..9499f94dff 100644
--- a/crypto/x509/pcy_data.c
+++ b/crypto/x509/pcy_data.c
@@ -13,8 +13,6 @@
#include "pcy_local.h"
-DEFINE_STACK_OF(ASN1_OBJECT)
-
/* Policy Node routines */
void policy_data_free(X509_POLICY_DATA *data)
diff --git a/crypto/x509/pcy_map.c b/crypto/x509/pcy_map.c
index 78c2d5904b..a1210ef37f 100644
--- a/crypto/x509/pcy_map.c
+++ b/crypto/x509/pcy_map.c
@@ -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
diff --git a/crypto/x509/pcy_node.c b/crypto/x509/pcy_node.c
index 60b9034160..d2b43814bd 100644
--- a/crypto/x509/pcy_node.c
+++ b/crypto/x509/pcy_node.c
@@ -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)
{
diff --git a/crypto/x509/pcy_tree.c b/crypto/x509/pcy_tree.c
index bffded30f8..3ee30745d2 100644
--- a/crypto/x509/pcy_tree.c
+++ b/crypto/x509/pcy_tree.c
@@ -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)
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 8f4b8e8222..2d0ccd8a68 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -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)
{
diff --git a/crypto/x509/v3_admis.c b/crypto/x509/v3_admis.c
index 74b1f3d883..0dfd088eb4 100644
--- a/crypto/x509/v3_admis.c
+++ b/crypto/x509/v3_admis.c
@@ -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),
diff --git a/crypto/x509/v3_cpols.c b/crypto/x509/v3_cpols.c
index 2de281cd60..f7dcfb5dce 100644
--- a/crypto/x509/v3_cpols.c
+++ b/crypto/x509/v3_cpols.c
@@ -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... */
diff --git a/crypto/x509/v3_extku.c b/crypto/x509/v3_extku.c
index 7769bc9931..b96fb58ac8 100644
--- a/crypto/x509/v3_extku.c
+++ b/crypto/x509/v3_extku.c
@@ -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,
diff --git a/crypto/x509/v3_purp.c b/crypto/x509/v3_purp.c
index f36ef8a3a1..92f3bbe3b0 100644
--- a/crypto/x509/v3_purp.c
+++ b/crypto/x509/v3_purp.c
@@ -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);
diff --git a/crypto/x509/v3_tlsf.c b/crypto/x509/v3_tlsf.c
index 81ce333a34..1ccf7dab10 100644
--- a/crypto/x509/v3_tlsf.c
+++ b/crypto/x509/v3_tlsf.c
@@ -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,
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c
index bb4bfe03f4..d93d757aef 100644
--- a/crypto/x509/x509_att.c
+++ b/crypto/x509/x509_att.c
@@ -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);
diff --git a/crypto/x509/x509_trs.c b/crypto/x509/x509_trs.c
index 92e2220a13..10718c347d 100644
--- a/crypto/x509/x509_trs.c
+++ b/crypto/x509/x509_trs.c
@@ -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);
diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index 8fe09fd61a..17c0790911 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -18,7 +18,6 @@
#include "x509_local.h"
-DEFINE_STACK_OF(ASN1_OBJECT)
DEFINE_STACK_OF(X509_VERIFY_PARAM)
/* X509_VERIFY_PARAM functions */
diff --git a/crypto/x509/x_attrib.c b/crypto/x509/x_attrib.c
index fca6df5067..5c5e608173 100644
--- a/crypto/x509/x_attrib.c
+++ b/crypto/x509/x_attrib.c
@@ -14,8 +14,6 @@
#include <openssl/x509.h>
#include "x509_local.h"
-DEFINE_STACK_OF(ASN1_TYPE)
-
/*-
* X509_ATTRIBUTE: this has the following form:
*
diff --git a/crypto/x509/x_x509a.c b/crypto/x509/x_x509a.c
index f0dc9d6535..ef93db26d8 100644
--- a/crypto/x509/x_x509a.c
+++ b/crypto/x509/x_x509a.c
@@ -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