]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix safestack issues in cms.h
authorMatt Caswell <matt@openssl.org>
Thu, 3 Sep 2020 13:55:08 +0000 (14:55 +0100)
committerMatt Caswell <matt@openssl.org>
Sun, 13 Sep 2020 10:10:41 +0000 (11:10 +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
apps/cms.c
build.info
crypto/cms/cms_env.c
crypto/cms/cms_ess.c
crypto/cms/cms_kari.c
crypto/cms/cms_lib.c
crypto/cms/cms_pwri.c
crypto/cms/cms_sd.c
crypto/cms/cms_smime.c
include/openssl/cms.h.in [moved from include/openssl/cms.h with 98% similarity]

index edf56c7f3fa5829f1927e71a99bc7bd788358e3e..f0c19f434fdf71b72be4f0e681ebddf8cfaaac18 100644 (file)
@@ -24,6 +24,7 @@
 /include/crypto/*_conf.h
 /include/openssl/asn1.h
 /include/openssl/cmp.h
+/include/openssl/cms.h
 /include/openssl/configuration.h
 /include/openssl/fipskey.h
 /include/openssl/opensslv.h
index 2706e5af86ba10443778bfa3d5f519cdf1f31270..178c441f1abae69333c5f9a3cd2db9bd020582fa 100644 (file)
@@ -23,8 +23,6 @@
 # include <openssl/x509v3.h>
 # include <openssl/cms.h>
 
-DEFINE_STACK_OF(CMS_SignerInfo)
-
 static int save_certs(char *signerfile, STACK_OF(X509) *signers);
 static int cms_cb(int ok, X509_STORE_CTX *ctx);
 static void receipt_request_print(CMS_ContentInfo *cms);
index 97b882af7f73bf1a55d576ed361fef464a1ef58d..8729d6c5aa82a189c30ffb83020aca0de0d69bfd 100644 (file)
@@ -15,6 +15,7 @@ DEPEND[libssl]=libcrypto
 # unconditionally before anything else.
 DEPEND[]=include/openssl/asn1.h \
          include/openssl/cmp.h \
+         include/openssl/cms.h \
          include/openssl/configuration.h \
          include/openssl/fipskey.h \
          include/openssl/opensslv.h \
@@ -28,6 +29,7 @@ DEPEND[]=include/openssl/asn1.h \
 GENERATE[include/openssl/asn1.h]=include/openssl/asn1.h.in
 GENERATE[include/openssl/configuration.h]=include/openssl/configuration.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/fipskey.h]=include/openssl/fipskey.h.in
 GENERATE[include/openssl/opensslv.h]=include/openssl/opensslv.h.in
 GENERATE[include/openssl/safestack.h]=include/openssl/safestack.h.in
index f0c895704f4527e1b565bffea8740d30aa43ca5d..068696586e8069ff0e6aff39e4483621b6dd4af6 100644 (file)
@@ -19,9 +19,6 @@
 #include "crypto/x509.h"
 #include "cms_local.h"
 
-DEFINE_STACK_OF(CMS_RecipientInfo)
-DEFINE_STACK_OF(CMS_RevocationInfoChoice)
-
 /* CMS EnvelopedData Utilities */
 static void cms_env_set_version(CMS_EnvelopedData *env);
 
index df2ab07f7377af91cc4095bc077f3b893dae68e7..9903c444fa6ee3194fc6816c051ccac483a276c9 100644 (file)
@@ -20,7 +20,6 @@
 #include "crypto/x509.h"
 #include "cms_local.h"
 
-DEFINE_STACK_OF(CMS_SignerInfo)
 DEFINE_STACK_OF(ESS_CERT_ID)
 DEFINE_STACK_OF(ESS_CERT_ID_V2)
 
index b5d85b7d67399723e628cae335498bfa1d6ea956..82a03e6c6bb5c8abf582cfa3e1e3247396541e3a 100644 (file)
@@ -23,8 +23,6 @@
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
-DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
-
 /* Key Agreement Recipient Info (KARI) routines */
 
 int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
index 0b9a3f2b2f27c925bbddd93e94362e5ac6651d32..bc7da7ff94b6f9cbe51840d69beb92d8ea232815 100644 (file)
@@ -21,8 +21,6 @@
 static STACK_OF(CMS_CertificateChoices)
 **cms_get0_certificate_choices(CMS_ContentInfo *cms);
 
-DEFINE_STACK_OF(CMS_RevocationInfoChoice)
-
 IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
 
 CMS_ContentInfo *d2i_CMS_ContentInfo(CMS_ContentInfo **a,
index e281bd72f2247dc3505e047322987c3fc1308c72..0393608fdb158a4f8ecf64ca3750383b715054cc 100644 (file)
@@ -18,8 +18,6 @@
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
-DEFINE_STACK_OF(CMS_RecipientInfo)
-
 int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
                                     unsigned char *pass, ossl_ssize_t passlen)
 {
index e76766bab728fdd7aaa75cc436c7281e15d72fe1..4b6822f4fd295d7d042d377d5348e96ab00a11b9 100644 (file)
@@ -22,9 +22,6 @@
 #include "crypto/ess.h"
 #include "crypto/x509.h" /* for X509_add_cert_new() */
 
-DEFINE_STACK_OF(CMS_RevocationInfoChoice)
-DEFINE_STACK_OF(CMS_SignerInfo)
-
 /* CMS SignedData Utilities */
 
 static CMS_SignedData *cms_get0_signed(CMS_ContentInfo *cms)
index b2287c624d4cad60e06d514c0262f18607608bb2..a50eee9fa97d4c41cc3d0074472018d2f3fb4d88 100644 (file)
 #include "cms_local.h"
 #include "crypto/asn1.h"
 
-DEFINE_STACK_OF(CMS_SignerInfo)
-DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
-DEFINE_STACK_OF(CMS_RecipientInfo)
-
 static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
 {
     BIO *rbio;
similarity index 98%
rename from include/openssl/cms.h
rename to include/openssl/cms.h.in
index ad6718dd6f2f62cc5f861a539cf001b7fc40c39e..f89cbf96e7e11a7f81e988d66548de9f35877e60 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * {- join("\n * ", @autowarntext) -}
+ *
  * Copyright 2008-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_CMS_H
 # define OPENSSL_CMS_H
 # pragma once
@@ -36,10 +42,12 @@ typedef struct CMS_Receipt_st CMS_Receipt;
 typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
 typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
 
-DEFINE_OR_DECLARE_STACK_OF(CMS_SignerInfo)
-DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
-DEFINE_OR_DECLARE_STACK_OF(CMS_RecipientInfo)
-DEFINE_OR_DECLARE_STACK_OF(CMS_RevocationInfoChoice)
+{-
+    generate_stack_macros("CMS_SignerInfo")
+    .generate_stack_macros("CMS_RecipientEncryptedKey")
+    .generate_stack_macros("CMS_RecipientInfo")
+    .generate_stack_macros("CMS_RevocationInfoChoice");
+-}
 
 DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
 DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)