Fix safestack issues in cms.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 14:55:08 +01:00
parent 798f932980
commit 904e1f92b3
11 changed files with 15 additions and 23 deletions

1
.gitignore vendored
View 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

View 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);

View 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

View 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);

View 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)

View 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,

View 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,

View 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)
{

View 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)

View File

@ -16,10 +16,6 @@
#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;

View 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)