fix error code
[oweals/openssl.git] / crypto / cms / cms_lcl.h
index 774ec103f7a3d008d577dc26e1512dcdf754ad5f..2d8f54b1b67260cb15a9a1b6668cbc1963d14c77 100644 (file)
@@ -91,6 +91,7 @@ typedef struct CMS_KEKIdentifier_st CMS_KEKIdentifier;
 typedef struct CMS_KEKRecipientInfo_st CMS_KEKRecipientInfo;
 typedef struct CMS_PasswordRecipientInfo_st CMS_PasswordRecipientInfo;
 typedef struct CMS_OtherRecipientInfo_st CMS_OtherRecipientInfo;
+typedef struct CMS_ReceiptsFrom_st CMS_ReceiptsFrom;
 
 struct CMS_ContentInfo_st
        {
@@ -123,6 +124,8 @@ struct CMS_EncapsulatedContentInfo_st
        {
        ASN1_OBJECT *eContentType;
        ASN1_OCTET_STRING *eContent;
+       /* Set to 1 if incomplete structure only part set up */
+       int partial;
        };
 
 struct CMS_SignerInfo_st
@@ -172,6 +175,8 @@ struct CMS_EncryptedContentInfo_st
        const EVP_CIPHER *cipher;
        unsigned char *key;
        size_t keylen;
+       /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */
+       int debug;
        };
 
 struct CMS_RecipientInfo_st
@@ -372,6 +377,37 @@ struct CMS_OtherKeyAttribute_st
        ASN1_TYPE *keyAttr;
        };
 
+/* ESS structures */
+
+#ifdef HEADER_X509V3_H
+
+struct CMS_ReceiptRequest_st
+       {
+       ASN1_OCTET_STRING *signedContentIdentifier;
+       CMS_ReceiptsFrom *receiptsFrom;
+       STACK_OF(GENERAL_NAMES) *receiptsTo;
+       };
+
+
+struct CMS_ReceiptsFrom_st
+       {
+       int type;
+       union
+               {
+               long allOrFirstTier;
+               STACK_OF(GENERAL_NAMES) *receiptList;
+               } d;
+       };
+#endif
+
+struct CMS_Receipt_st
+       {
+       long version;
+       ASN1_OBJECT *contentType;
+       ASN1_OCTET_STRING *signedContentIdentifier;
+       ASN1_OCTET_STRING *originatorSignatureValue;
+       };
+
 DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
 DECLARE_ASN1_ITEM(CMS_SignerInfo)
 DECLARE_ASN1_ITEM(CMS_IssuerAndSerialNumber)
@@ -411,6 +447,13 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
 
 BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec);
 BIO *cms_EncryptedData_init_bio(CMS_ContentInfo *cms);
+int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, 
+                               const EVP_CIPHER *cipher,
+                               const unsigned char *key, size_t keylen);
+
+int cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms);
+int cms_msgSigDigest_add1(CMS_SignerInfo *dest, CMS_SignerInfo *src);
+ASN1_OCTET_STRING *cms_encode_Receipt(CMS_SignerInfo *si);
 
 BIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms);