diff --git a/.gitignore b/.gitignore index aca011b2c1..0cad330e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ /include/openssl/cms.h /include/openssl/configuration.h /include/openssl/crmf.h +/include/openssl/ct.h /include/openssl/fipskey.h /include/openssl/ocsp.h /include/openssl/opensslv.h diff --git a/apps/s_client.c b/apps/s_client.c index ecd737ef69..ca9891aba8 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -59,8 +59,6 @@ typedef unsigned int u_int; # endif #endif -DEFINE_STACK_OF(SCT) - #undef BUFSIZZ #define BUFSIZZ 1024*8 #define S_CLIENT_IRC_READ_TIMEOUT 8 diff --git a/build.info b/build.info index 828918c6c6..01e26704ef 100644 --- a/build.info +++ b/build.info @@ -18,6 +18,7 @@ DEPEND[]=include/openssl/asn1.h \ include/openssl/cms.h \ include/openssl/configuration.h \ include/openssl/crmf.h \ + include/openssl/ct.h \ include/openssl/fipskey.h \ include/openssl/opensslv.h \ include/openssl/ocsp.h \ @@ -36,6 +37,7 @@ 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 GENERATE[include/openssl/crmf.h]=include/openssl/crmf.h.in +GENERATE[include/openssl/ct.h]=include/openssl/ct.h.in GENERATE[include/openssl/fipskey.h]=include/openssl/fipskey.h.in GENERATE[include/openssl/ocsp.h]=include/openssl/ocsp.h.in GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in diff --git a/crypto/ct/ct_log.c b/crypto/ct/ct_log.c index 73eeee9d7d..32a29ed699 100644 --- a/crypto/ct/ct_log.c +++ b/crypto/ct/ct_log.c @@ -18,8 +18,6 @@ #include "internal/cryptlib.h" -DEFINE_STACK_OF(CTLOG) - /* * Information about a CT log server. */ diff --git a/crypto/ct/ct_oct.c b/crypto/ct/ct_oct.c index 4aca0385d0..712fc563c4 100644 --- a/crypto/ct/ct_oct.c +++ b/crypto/ct/ct_oct.c @@ -21,8 +21,6 @@ #include "ct_local.h" -DEFINE_STACK_OF(SCT) - int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len) { size_t siglen; diff --git a/crypto/ct/ct_prn.c b/crypto/ct/ct_prn.c index a89b4aa6e7..374235b7ec 100644 --- a/crypto/ct/ct_prn.c +++ b/crypto/ct/ct_prn.c @@ -16,8 +16,6 @@ #include "ct_local.h" -DEFINE_STACK_OF(SCT) - static void SCT_signature_algorithms_print(const SCT *sct, BIO *out) { int nid = SCT_get_signature_nid(sct); diff --git a/crypto/ct/ct_sct.c b/crypto/ct/ct_sct.c index f6c262c967..1b8e1dc61e 100644 --- a/crypto/ct/ct_sct.c +++ b/crypto/ct/ct_sct.c @@ -19,8 +19,6 @@ #include "ct_local.h" -DEFINE_STACK_OF(SCT) - SCT *SCT_new(void) { SCT *sct = OPENSSL_zalloc(sizeof(*sct)); diff --git a/crypto/ct/ct_x509v3.c b/crypto/ct/ct_x509v3.c index 51dd779a3a..085402b046 100644 --- a/crypto/ct/ct_x509v3.c +++ b/crypto/ct/ct_x509v3.c @@ -13,8 +13,6 @@ #include "ct_local.h" -DEFINE_STACK_OF(SCT) - static char *i2s_poison(const X509V3_EXT_METHOD *method, void *val) { return OPENSSL_strdup("NULL"); diff --git a/include/openssl/ct.h b/include/openssl/ct.h.in similarity index 99% rename from include/openssl/ct.h rename to include/openssl/ct.h.in index a69c986f06..e72fe4b6b7 100644 --- a/include/openssl/ct.h +++ b/include/openssl/ct.h.in @@ -1,4 +1,6 @@ /* + * {- join("\n * ", @autowarntext) -} + * * Copyright 2016-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_CT_H # define OPENSSL_CT_H # pragma once @@ -34,8 +40,11 @@ extern "C" { /* All hashes are SHA256 in v1 of Certificate Transparency */ # define CT_V1_HASHLEN SHA256_DIGEST_LENGTH -DEFINE_OR_DECLARE_STACK_OF(SCT) -DEFINE_OR_DECLARE_STACK_OF(CTLOG) +{- + generate_stack_macros("SCT") + .generate_stack_macros("CTLOG"); +-} + typedef enum { CT_LOG_ENTRY_TYPE_NOT_SET = -1, diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index e4cc6efa76..64ecdccb8f 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -28,8 +28,6 @@ #include "internal/refcount.h" #include "internal/ktls.h" -DEFINE_STACK_OF(SCT) - static int ssl_undefined_function_1(SSL *ssl, SSL3_RECORD *r, size_t s, int t, SSL_MAC_BUF *mac, size_t macsize) { diff --git a/test/ct_test.c b/test/ct_test.c index 2e161a74d2..d1799fa7a2 100644 --- a/test/ct_test.c +++ b/test/ct_test.c @@ -22,8 +22,6 @@ #ifndef OPENSSL_NO_CT -DEFINE_STACK_OF(SCT) - /* Used when declaring buffers to read text files into */ # define CT_TEST_MAX_FILE_SIZE 8096