Fix safestack issues in asn1.h
[openssl.git] / include / openssl / asn1.h.in
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)