]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix safestack issues in asn1t.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 14:56:05 +0000 (15:56 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:10:41 +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)

.gitignore
build.info
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c
crypto/x509/x_name.c
include/openssl/asn1t.h.in [moved from include/openssl/asn1t.h with 99% similarity]

index 0cad330e0a0384c1ff39f99a0b4fd3fab2a30cd2..535792bd74afeadcae1e88d12c249c1bb2e76a23 100644 (file)
@@ -23,6 +23,7 @@
 /crypto/buildinf.h
 /include/crypto/*_conf.h
 /include/openssl/asn1.h
+/include/openssl/asn1t.h
 /include/openssl/cmp.h
 /include/openssl/cms.h
 /include/openssl/configuration.h
index 01e26704ef1ca251339a96ef9d8bae59830d1330..8f7f9f839599f4225e2bf1ae600c84f083b1820e 100644 (file)
@@ -14,6 +14,7 @@ DEPEND[libssl]=libcrypto
 # Empty DEPEND "indices" means the dependencies are expected to be built
 # unconditionally before anything else.
 DEPEND[]=include/openssl/asn1.h \
+         include/openssl/asn1t.h \
          include/openssl/cmp.h \
          include/openssl/cms.h \
          include/openssl/configuration.h \
@@ -33,6 +34,7 @@ DEPEND[]=include/openssl/asn1.h \
          doc/man7/openssl_user_macros.pod
 
 GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
+GENERATE[include/openssl/asn1t.h]=include/openssl/asn1t.h.in
 GENERATE[include/openssl/cmp.h]=include/openssl/cmp.h.in
 GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
 GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
index 379d1e6ee1f7b795385922c156ccbd7d72fa74a6..740707f85388b5496d7bee2f050e8c693ab471c3 100644 (file)
@@ -17,8 +17,6 @@
 #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)
  * could eventually exceed the stack given malicious input with excessive
index 9bd2099c5ee83c73fc981ae2bd5933560ee63251..3a5b29f37d557412d50330677d8348e618ff7e0f 100644 (file)
@@ -13,8 +13,6 @@
 #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 48ba9f3f742f4da462ae4125d8cdddb1014b2c33..5bdcf461a52f8ffdb70581626893792dbff10dd8 100644 (file)
@@ -15,8 +15,6 @@
 #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 1a57b2232d20902605ad000173995ed8e88fedc3..692bd6566a2648293f5b041293b02a563c6f552c 100644 (file)
@@ -16,8 +16,6 @@
 #include "crypto/asn1.h"
 #include "x509_local.h"
 
-DEFINE_STACK_OF(ASN1_VALUE)
-
 /*
  * Maximum length of X509_NAME: much larger than anything we should
  * ever see in practice.
similarity index 99%
rename from include/openssl/asn1t.h
rename to include/openssl/asn1t.h.in
index 286db9e2eb4b5c732ef469eca03b9cc62981016e..1eebd1f85a059f46fef6605dbe699eddf79740d2 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 2000-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_ASN1T_H
 # define OPENSSL_ASN1T_H
 # pragma once
@@ -880,7 +886,10 @@ DECLARE_ASN1_ITEM(LONG)
 DECLARE_ASN1_ITEM(ZLONG)
 # endif
 
-DEFINE_OR_DECLARE_STACK_OF(ASN1_VALUE)
+{-
+    generate_stack_macros("ASN1_VALUE");
+-}
+
 
 /* Functions used internally by the ASN1 code */