Fix safestack issues in crypto.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 15:24:47 +0000 (16:24 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:11:21 +0000 (11:11 +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/dso/dso_dlfcn.c
crypto/dso/dso_lib.c
crypto/dso/dso_win32.c
crypto/ex_data.c
include/openssl/crypto.h.in [moved from include/openssl/crypto.h with 99% similarity]

index 68e7b2abd1b2ebd67b3749b85e1a6e667b87355b..e7e924d74a62aacb5eb7741621eb3c9f6cd0234c 100644 (file)
@@ -30,6 +30,7 @@
 /include/openssl/conf.h
 /include/openssl/configuration.h
 /include/openssl/crmf.h
+/include/openssl/crypto.h
 /include/openssl/ct.h
 /include/openssl/ess.h
 /include/openssl/fipskey.h
index b091a1c3466d18c910a08cad687d7e413d17f1fe..091c4791d6b21d7319d912711780d9f8889ec6ce 100644 (file)
@@ -21,6 +21,7 @@ DEPEND[]=include/openssl/asn1.h \
          include/openssl/conf.h \
          include/openssl/configuration.h \
          include/openssl/crmf.h \
+         include/openssl/crypto.h \
          include/openssl/ct.h \
          include/openssl/ess.h \
          include/openssl/fipskey.h \
@@ -44,6 +45,7 @@ GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
 GENERATE[include/openssl/conf.h]=include/openssl/conf.h.in
 GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in
 GENERATE[include/openssl/crmf.h]=include/openssl/crmf.h.in
+GENERATE[include/openssl/crypto.h]=include/openssl/crypto.h.in
 GENERATE[include/openssl/ct.h]=include/openssl/ct.h.in
 GENERATE[include/openssl/ess.h]=include/openssl/ess.h.in
 GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in
index bb34c6ed4299eb750aa55674aaf72e387d58ac60..b34984b919dfc27cdad0368511ee244da77c96ec 100644 (file)
@@ -19,8 +19,6 @@
 #include "dso_local.h"
 #include "e_os.h"
 
-DEFINE_STACK_OF(void)
-
 #ifdef DSO_DLFCN
 
 # ifdef HAVE_DLFCN_H
index 6c347b58d6ce856cb2d4d77f51cc33670174b6a9..6e2b8d944d23d524c27f19dd37e2d693895aef4b 100644 (file)
@@ -10,8 +10,6 @@
 #include "dso_local.h"
 #include "internal/refcount.h"
 
-DEFINE_STACK_OF(void)
-
 static DSO_METHOD *default_DSO_meth = NULL;
 
 static DSO *DSO_new_method(DSO_METHOD *meth)
index 1472140e926aa8831a86eaed23bd443301a468ca..7248fc2878ea485562ac88ea59e5b3683f6c01d6 100644 (file)
@@ -69,8 +69,6 @@ static void *win32_globallookup(const char *name);
 
 static const char *openssl_strnchr(const char *string, int c, size_t len);
 
-DEFINE_STACK_OF(void)
-
 static DSO_METHOD dso_meth_win32 = {
     "OpenSSL 'win32' shared library method",
     win32_load,
index 80a136164adacf17059dfc31977a2508926b4c78..cc9ebc36f46c8ad53a99b2eaab3a4be4225b3b38 100644 (file)
@@ -10,8 +10,6 @@
 #include "crypto/cryptlib.h"
 #include "internal/thread_once.h"
 
-DEFINE_STACK_OF(void)
-
 int do_ex_data_init(OPENSSL_CTX *ctx)
 {
     OSSL_EX_DATA_GLOBAL *global = openssl_ctx_get_ex_data_global(ctx);
similarity index 99%
rename from include/openssl/crypto.h
rename to include/openssl/crypto.h.in
index a7c2863b548febb0d6a8c739f8bfdb0540480978..51f1977274c61df217c706ea8a20e246a6c2ecad 100644 (file)
@@ -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,11 @@
  * https://www.openssl.org/source/license.html
  */
 
+{-
+use OpenSSL::stackhash qw(generate_stack_macros);
+-}
+
+
 #ifndef OPENSSL_CRYPTO_H
 # define OPENSSL_CRYPTO_H
 # pragma once
@@ -170,7 +177,10 @@ struct crypto_ex_data_st {
     STACK_OF(void) *sk;
 };
 
-DEFINE_OR_DECLARE_STACK_OF(void)
+{-
+    generate_stack_macros("void");
+-}
+
 
 /*
  * Per class, we have a STACK of function pointers.