Fix safestack issues in bio.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)
This commit is contained in:
Matt Caswell 2020-09-03 16:06:16 +01:00
parent 1e14bca233
commit dd73147420
5 changed files with 12 additions and 5 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@
/include/crypto/*_conf.h /include/crypto/*_conf.h
/include/openssl/asn1.h /include/openssl/asn1.h
/include/openssl/asn1t.h /include/openssl/asn1t.h
/include/openssl/bio.h
/include/openssl/cmp.h /include/openssl/cmp.h
/include/openssl/cms.h /include/openssl/cms.h
/include/openssl/configuration.h /include/openssl/configuration.h

View File

@ -15,6 +15,7 @@ DEPEND[libssl]=libcrypto
# unconditionally before anything else. # unconditionally before anything else.
DEPEND[]=include/openssl/asn1.h \ DEPEND[]=include/openssl/asn1.h \
include/openssl/asn1t.h \ include/openssl/asn1t.h \
include/openssl/bio.h \
include/openssl/cmp.h \ include/openssl/cmp.h \
include/openssl/cms.h \ include/openssl/cms.h \
include/openssl/configuration.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/asn1.h]=include/openssl/asn1.h.in
GENERATE[include/openssl/asn1t.h]=include/openssl/asn1t.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/cmp.h]=include/openssl/cmp.h.in
GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in GENERATE[include/openssl/cms.h]=include/openssl/cms.h.in
GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in GENERATE[include/openssl/configuration.h]=include/openssl/configuration.h.in

View File

@ -19,8 +19,6 @@
#include "internal/bio.h" #include "internal/bio.h"
#include "asn1_local.h" #include "asn1_local.h"
DEFINE_STACK_OF(BIO)
/* /*
* Generalised MIME like utilities for streaming ASN1. Although many have a * Generalised MIME like utilities for streaming ASN1. Although many have a
* PKCS7/CMS like flavour others are more general purpose. * PKCS7/CMS like flavour others are more general purpose.

View File

@ -30,8 +30,6 @@
# endif # endif
#endif #endif
DEFINE_STACK_OF(BIO)
#ifndef S_ISDIR #ifndef S_ISDIR
# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR) # define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
#endif #endif

View File

@ -1,4 +1,6 @@
/* /*
* {- join("\n * ", @autowarntext) -}
*
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
* *
* Licensed under the Apache License 2.0 (the "License"). You may not use * 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 * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html * https://www.openssl.org/source/license.html
*/ */
{-
use OpenSSL::stackhash qw(generate_stack_macros);
-}
#ifndef OPENSSL_BIO_H #ifndef OPENSSL_BIO_H
# define 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 int BIO_info_cb(BIO *, int, int);
typedef BIO_info_cb bio_info_cb; /* backward compatibility */ 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 */ /* Prefix and suffix callback in ASN1 BIO */
typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen, typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,