summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-09-03 10:23:44 +0100
committerMatt Caswell <matt@openssl.org>2020-09-13 11:09:45 +0100
commite6623cfbffcc03e2483632359e005ca13adacc9d (patch)
tree64caba9fa625624f304162011a54a55b09b0ad41 /include
parent6ac1cd10ba8a1d92d3858e53a7aea2cf444adf26 (diff)
Fix safestack issues in x509.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 'include')
-rw-r--r--include/openssl/x509.h.in (renamed from include/openssl/x509.h)36
1 files changed, 27 insertions, 9 deletions
diff --git a/include/openssl/x509.h b/include/openssl/x509.h.in
index bbe2d62cf9..bded195d78 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h.in
@@ -1,4 +1,6 @@
/*
+ * {- join("\n * ", @autowarntext) -}
+ *
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
*
@@ -8,6 +10,10 @@
* https://www.openssl.org/source/license.html
*/
+{-
+use OpenSSL::stackhash qw(generate_stack_macros generate_const_stack_macros);
+-}
+
#ifndef OPENSSL_X509_H
# define OPENSSL_X509_H
# pragma once
@@ -41,10 +47,12 @@ extern "C" {
#endif
/* Needed stacks for types defined in other headers */
-DEFINE_OR_DECLARE_STACK_OF(X509_NAME)
-DEFINE_OR_DECLARE_STACK_OF(X509)
-DEFINE_OR_DECLARE_STACK_OF(X509_REVOKED)
-DEFINE_OR_DECLARE_STACK_OF(X509_CRL)
+{-
+ generate_stack_macros("X509_NAME")
+ .generate_stack_macros("X509")
+ .generate_stack_macros("X509_REVOKED")
+ .generate_stack_macros("X509_CRL");
+-}
/* Flags for X509_get_signature_info() */
/* Signature info is valid */
@@ -82,16 +90,22 @@ typedef struct X509_val_st {
typedef struct X509_sig_st X509_SIG;
typedef struct X509_name_entry_st X509_NAME_ENTRY;
-DEFINE_OR_DECLARE_STACK_OF(X509_NAME_ENTRY)
+{-
+ generate_stack_macros("X509_NAME_ENTRY");
+-}
# 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)
+{-
+ generate_stack_macros("X509_EXTENSION");
+-}
typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
typedef struct x509_attributes_st X509_ATTRIBUTE;
-DEFINE_OR_DECLARE_STACK_OF(X509_ATTRIBUTE)
+{-
+ generate_stack_macros("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;
@@ -107,7 +121,9 @@ typedef struct x509_trust_st {
int arg1;
void *arg2;
} X509_TRUST;
-DEFINE_OR_DECLARE_STACK_OF(X509_TRUST)
+{-
+ generate_stack_macros("X509_TRUST");
+-}
/* standard trust ids */
@@ -246,7 +262,9 @@ typedef struct X509_info_st {
int enc_len;
char *enc_data;
} X509_INFO;
-DEFINE_OR_DECLARE_STACK_OF(X509_INFO)
+{-
+ generate_stack_macros("X509_INFO");
+-}
/*
* The next 2 structures and their 8 routines are used to manipulate Netscape's