From: Matt Caswell Date: Thu, 3 Sep 2020 15:06:16 +0000 (+0100) Subject: Fix safestack issues in bio.h X-Git-Tag: openssl-3.0.0-alpha7~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd731474207126615679f4cc9ae772d7da990332;p=thirdparty%2Fopenssl.git Fix safestack issues in bio.h Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12781) --- diff --git a/.gitignore b/.gitignore index f1aeaddceeb..038f8b4f372 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ /include/crypto/*_conf.h /include/openssl/asn1.h /include/openssl/asn1t.h +/include/openssl/bio.h /include/openssl/cmp.h /include/openssl/cms.h /include/openssl/configuration.h diff --git a/build.info b/build.info index 7c5388b96cf..e5cd3da971f 100644 --- a/build.info +++ b/build.info @@ -15,6 +15,7 @@ DEPEND[libssl]=libcrypto # unconditionally before anything else. DEPEND[]=include/openssl/asn1.h \ include/openssl/asn1t.h \ + include/openssl/bio.h \ include/openssl/cmp.h \ include/openssl/cms.h \ include/openssl/configuration.h \ @@ -36,6 +37,7 @@ DEPEND[]=include/openssl/asn1.h \ GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in GENERATE[include/openssl/asn1t.h]=include/openssl/asn1t.h.in +GENERATE[include/openssl/bio.h]=include/openssl/bio.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 diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index 65e84250458..596b32a57e2 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -19,8 +19,6 @@ #include "internal/bio.h" #include "asn1_local.h" -DEFINE_STACK_OF(BIO) - /* * Generalised MIME like utilities for streaming ASN1. Although many have a * PKCS7/CMS like flavour others are more general purpose. diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 6f7c06afd70..63dfaef4d82 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -30,8 +30,6 @@ # endif #endif -DEFINE_STACK_OF(BIO) - #ifndef S_ISDIR # define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) #endif diff --git a/include/openssl/bio.h b/include/openssl/bio.h.in similarity index 99% rename from include/openssl/bio.h rename to include/openssl/bio.h.in index 88e57e70a80..d7380d47e9f 100644 --- a/include/openssl/bio.h +++ b/include/openssl/bio.h.in @@ -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 @@ -6,6 +8,9 @@ * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ +{- +use OpenSSL::stackhash qw(generate_stack_macros); +-} #ifndef OPENSSL_BIO_H # define OPENSSL_BIO_H @@ -287,7 +292,10 @@ int BIO_method_type(const BIO *b); typedef int BIO_info_cb(BIO *, int, int); typedef BIO_info_cb bio_info_cb; /* backward compatibility */ -DEFINE_OR_DECLARE_STACK_OF(BIO) +{- + generate_stack_macros("BIO"); +-} + /* Prefix and suffix callback in ASN1 BIO */ typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,