From 1e14bca2332a95340366324372c59e6a78ddbad7 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 3 Sep 2020 16:01:51 +0100 Subject: Fix safestack issues in ess.h Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12781) --- include/openssl/ess.h | 57 --------------------------------------- include/openssl/ess.h.in | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 57 deletions(-) delete mode 100644 include/openssl/ess.h create mode 100644 include/openssl/ess.h.in (limited to 'include') diff --git a/include/openssl/ess.h b/include/openssl/ess.h deleted file mode 100644 index 17962473c1..0000000000 --- a/include/openssl/ess.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifndef OPENSSL_ESS_H -# define OPENSSL_ESS_H - -# include - -# ifdef __cplusplus -extern "C" { -# endif -# include -# include -# include - - -typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL; -typedef struct ESS_cert_id ESS_CERT_ID; -typedef struct ESS_signing_cert ESS_SIGNING_CERT; - -DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID) - -typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2; -typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2; - -DEFINE_OR_DECLARE_STACK_OF(ESS_CERT_ID_V2) - -DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL) -DECLARE_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL) - -DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID, ESS_CERT_ID) -DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID) - -DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_SIGNING_CERT) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_SIGNING_CERT, ESS_SIGNING_CERT) -DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT) - -DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID_V2) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID_V2, ESS_CERT_ID_V2) -DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2) - -DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_SIGNING_CERT_V2) -DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_SIGNING_CERT_V2, ESS_SIGNING_CERT_V2) -DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT_V2) - -# ifdef __cplusplus -} -# endif -#endif diff --git a/include/openssl/ess.h.in b/include/openssl/ess.h.in new file mode 100644 index 0000000000..185bdd8f8b --- /dev/null +++ b/include/openssl/ess.h.in @@ -0,0 +1,69 @@ +/* + * {- join("\n * ", @autowarntext) -} + * + * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * 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_ESS_H +# define OPENSSL_ESS_H + +# include + +# ifdef __cplusplus +extern "C" { +# endif +# include +# include +# include + + +typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL; +typedef struct ESS_cert_id ESS_CERT_ID; +typedef struct ESS_signing_cert ESS_SIGNING_CERT; + +{- + generate_stack_macros("ESS_CERT_ID"); +-} + + +typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2; +typedef struct ESS_cert_id_v2_st ESS_CERT_ID_V2; + +{- + generate_stack_macros("ESS_CERT_ID_V2"); +-} + + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_ISSUER_SERIAL) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_ISSUER_SERIAL, ESS_ISSUER_SERIAL) +DECLARE_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID, ESS_CERT_ID) +DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_SIGNING_CERT) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_SIGNING_CERT, ESS_SIGNING_CERT) +DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_CERT_ID_V2) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_CERT_ID_V2, ESS_CERT_ID_V2) +DECLARE_ASN1_DUP_FUNCTION(ESS_CERT_ID_V2) + +DECLARE_ASN1_ALLOC_FUNCTIONS(ESS_SIGNING_CERT_V2) +DECLARE_ASN1_ENCODE_FUNCTIONS_only(ESS_SIGNING_CERT_V2, ESS_SIGNING_CERT_V2) +DECLARE_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT_V2) + +# ifdef __cplusplus +} +# endif +#endif -- cgit v1.2.3