summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2019-12-19 17:30:24 -0500
committerTomas Mraz <tmraz@fedoraproject.org>2020-04-24 16:42:46 +0200
commit852c2ed260860b6b85c84f9fe96fb4d23d49c9f2 (patch)
treed8104686e0a02217c13f51e5d10d7434fa13e3dc /crypto/cms
parent4692e98bdbaebb6f078e89a75c54395839e68b24 (diff)
In OpenSSL builds, declare STACK for datatypes ...
... and only *define* them in the source files that need them. Use DEFINE_OR_DECLARE which is set appropriately for internal builds and not non-deprecated builds. Deprecate stack-of-block Better documentation Move some ASN1 struct typedefs to types.h Update ParseC to handle this. Most of all, ParseC needed to be more consistent. The handlers are "recursive", in so far that they are called again and again until they terminate, which depends entirely on what the "massager" returns. There's a comment at the beginning of ParseC that explains how that works. {Richard Levtte} Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10669)
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_env.c4
-rw-r--r--crypto/cms/cms_ess.c3
-rw-r--r--crypto/cms/cms_kari.c2
-rw-r--r--crypto/cms/cms_lib.c4
-rw-r--r--crypto/cms/cms_pwri.c2
-rw-r--r--crypto/cms/cms_sd.c6
-rw-r--r--crypto/cms/cms_smime.c6
7 files changed, 27 insertions, 0 deletions
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
index af53fc82bb..a5ef2ddee5 100644
--- a/crypto/cms/cms_env.c
+++ b/crypto/cms/cms_env.c
@@ -18,6 +18,10 @@
#include "crypto/asn1.h"
#include "crypto/evp.h"
+DEFINE_STACK_OF(CMS_RecipientInfo)
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
/* CMS EnvelopedData Utilities */
static void cms_env_set_version(CMS_EnvelopedData *env);
diff --git a/crypto/cms/cms_ess.c b/crypto/cms/cms_ess.c
index 00a08aafea..12243dd869 100644
--- a/crypto/cms/cms_ess.c
+++ b/crypto/cms/cms_ess.c
@@ -19,6 +19,9 @@
#include "crypto/ess.h"
#include "crypto/cms.h"
+DEFINE_STACK_OF(GENERAL_NAMES)
+DEFINE_STACK_OF(CMS_SignerInfo)
+
IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest)
/* ESS services */
diff --git a/crypto/cms/cms_kari.c b/crypto/cms/cms_kari.c
index 14a884caeb..4e837718dc 100644
--- a/crypto/cms/cms_kari.c
+++ b/crypto/cms/cms_kari.c
@@ -17,6 +17,8 @@
#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,
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index 835e34887d..89dfc15081 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -16,6 +16,10 @@
#include <openssl/cms.h>
#include "cms_local.h"
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+
IMPLEMENT_ASN1_FUNCTIONS(CMS_ContentInfo)
IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
diff --git a/crypto/cms/cms_pwri.c b/crypto/cms/cms_pwri.c
index a4c32dcdc9..dee4a53ca1 100644
--- a/crypto/cms/cms_pwri.c
+++ b/crypto/cms/cms_pwri.c
@@ -18,6 +18,8 @@
#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)
{
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index 4a40226cf5..a5342c4a00 100644
--- a/crypto/cms/cms_sd.c
+++ b/crypto/cms/cms_sd.c
@@ -21,6 +21,12 @@
#include "crypto/cms.h"
#include "crypto/ess.h"
+DEFINE_STACK_OF(CMS_RevocationInfoChoice)
+DEFINE_STACK_OF(CMS_SignerInfo)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_ALGOR)
+DEFINE_STACK_OF(X509_ATTRIBUTE)
+
/* CMS SignedData Utilities */
static CMS_SignedData *cms_get0_signed(CMS_ContentInfo *cms)
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c
index f07064ea61..dbdc815e97 100644
--- a/crypto/cms/cms_smime.c
+++ b/crypto/cms/cms_smime.c
@@ -16,6 +16,12 @@
#include "cms_local.h"
#include "crypto/asn1.h"
+DEFINE_STACK_OF(CMS_SignerInfo)
+DEFINE_STACK_OF(X509)
+DEFINE_STACK_OF(X509_CRL)
+DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
+DEFINE_STACK_OF(CMS_RecipientInfo)
+
static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
{
BIO *rbio;