I am using openssl to define an ASN.1 structure, but encountered an error during compilation: 'CMS_SignerInfo_it': undeclared identifier. Have I included the required header files and linked the required libraries? Is the usage of CMS_SignerInfo not like this?
#pragma once
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/x509.h>
#include <openssl/safestack.h>
#include <openssl/cms.h>
#pragma comment(lib, "libcrypto.lib")
#pragma comment(lib, "libssl.lib")
typedef struct {
ASN1_OBJECT* eContentType;
ASN1_OCTET_STRING* eContent;
} EncapsulatedContentInfo;
ASN1_SEQUENCE(EncapsulatedContentInfo) = {
ASN1_SIMPLE(EncapsulatedContentInfo, eContentType, ASN1_OBJECT),
ASN1_EXP_OPT(EncapsulatedContentInfo, eContent, ASN1_OCTET_STRING, 0),
} ASN1_SEQUENCE_END(EncapsulatedContentInfo);
typedef struct {
ASN1_INTEGER* version;
STACK_OF(X509_ALGOR)* digestAlgorithms;
EncapsulatedContentInfo* encapsulatedContentInfo;
STACK_OF(X509)* certificates;
STACK_OF(X509_CRL)* crls;
STACK_OF(CMS_SignerInfo)* signerInfos;
} SignedData0;
ASN1_SEQUENCE(SignedData0) = {
ASN1_SIMPLE(SignedData0, version, ASN1_INTEGER),
ASN1_SET_OF(SignedData0, digestAlgorithms, X509_ALGOR),
ASN1_SIMPLE(SignedData0, encapsulatedContentInfo, EncapsulatedContentInfo),
ASN1_IMP_SET_OF_OPT(SignedData0, certificates, X509, 0),
ASN1_IMP_SET_OF_OPT(SignedData0, crls, X509_CRL, 1),
ASN1_SET_OF(SignedData0, signerInfos, CMS_SignerInfo)
} ASN1_SEQUENCE_END(SignedData0);
typedef struct {
ASN1_OBJECT* contentType;
ASN1_TYPE* content;
} CT_KDH;
ASN1_SEQUENCE(CT_KDH) = {
ASN1_SIMPLE(CT_KDH, contentType, ASN1_OBJECT),
ASN1_EXP_OPT(CT_KDH, content, ASN1_ANY, 0)
} ASN1_SEQUENCE_END(CT_KDH);
DECLARE_ASN1_FUNCTIONS(SignedData0);
DECLARE_ASN1_FUNCTIONS(CT_KDH);
DECLARE_ASN1_FUNCTIONS(EncapsulatedContentInfo);