TianoCore EDK2 master
Loading...
Searching...
No Matches
CryptPkcs7Internal.h
Go to the documentation of this file.
1
12#ifndef CRYPT_PKCS7_INTERNAL_H_
13#define CRYPT_PKCS7_INTERNAL_H_
14
15#include "InternalCryptLib.h"
16
17#include "mbedtls/oid.h"
18#include "mbedtls/asn1.h"
19#include "mbedtls/asn1write.h"
20#include "mbedtls/x509.h"
21#include "mbedtls/x509_crt.h"
22
26#define MBEDTLS_OID_PKCS7 MBEDTLS_OID_PKCS "\x07"
27#define MBEDTLS_OID_PKCS7_DATA MBEDTLS_OID_PKCS7 "\x01"
28#define MBEDTLS_OID_PKCS7_SIGNED_DATA MBEDTLS_OID_PKCS7 "\x02"
29#define MBEDTLS_OID_PKCS7_ENVELOPED_DATA MBEDTLS_OID_PKCS7 "\x03"
30#define MBEDTLS_OID_PKCS7_SIGNED_AND_ENVELOPED_DATA MBEDTLS_OID_PKCS7 "\x04"
31#define MBEDTLS_OID_PKCS7_DIGESTED_DATA MBEDTLS_OID_PKCS7 "\x05"
32#define MBEDTLS_OID_PKCS7_ENCRYPTED_DATA MBEDTLS_OID_PKCS7 "\x06"
33
38typedef struct MbedtlsPkcs7SignerInfo {
39 INT32 Version;
40 mbedtls_x509_buf Serial;
41 mbedtls_x509_name Issuer;
42 mbedtls_x509_buf IssuerRaw;
43 mbedtls_x509_buf AlgIdentifier;
44 mbedtls_x509_buf SigAlgIdentifier;
45 mbedtls_x509_buf AuthAttr;
46 mbedtls_x509_buf Sig;
47 struct MbedtlsPkcs7SignerInfo *Next;
49
53typedef struct MbedtlsPkcs7Data {
54 mbedtls_asn1_buf Oid;
55 mbedtls_asn1_buf Data;
57
62typedef struct MbedtlsPkcs7SignedData {
63 INT32 Version;
64 mbedtls_asn1_buf DigestAlgorithms;
65 struct MbedtlsPkcs7Data ContentInfo;
66 mbedtls_x509_crt Certificates;
67 mbedtls_x509_crl Crls;
68 struct MbedtlsPkcs7SignerInfo SignerInfos;
70
74typedef struct MbedtlsPkcs7 {
75 mbedtls_asn1_buf ContentTypeOid;
76 struct MbedtlsPkcs7SignedData SignedData;
78
79#define EDKII_ASN1_CHK_ADD(g, f) \
80 do \
81 { \
82 if( ( Ret = (f) ) < 0 ) \
83 return( Ret ); \
84 else \
85 (g) += Ret; \
86 } while( 0 )
87
88#endif