summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-03-24 22:14:02 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-03-24 22:14:02 +0000
commitbe86c7fc8784f785b20bad50f71327a57068a565 (patch)
treebacdef7b8b41c7287412f0f6c3336b283f7b8617 /crypto/cms
parent6205171362d8a0c07a84d07c425f540507e5f685 (diff)
Add signed receipt ASN1 structures. Initial GENERAL_NAME utility functions.
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms.h2
-rw-r--r--crypto/cms/cms_asn1.c13
-rw-r--r--crypto/cms/cms_lcl.h32
3 files changed, 47 insertions, 0 deletions
diff --git a/crypto/cms/cms.h b/crypto/cms/cms.h
index 1a316d7fd8..797f86bb9c 100644
--- a/crypto/cms/cms.h
+++ b/crypto/cms/cms.h
@@ -71,6 +71,8 @@ typedef struct CMS_SignerInfo_st CMS_SignerInfo;
typedef struct CMS_CertificateChoices CMS_CertificateChoices;
typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
+typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
+typedef struct CMS_Receipt_st CMS_Receipt;
DECLARE_STACK_OF(CMS_SignerInfo)
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
diff --git a/crypto/cms/cms_asn1.c b/crypto/cms/cms_asn1.c
index e5af9a0686..bef043a8f0 100644
--- a/crypto/cms/cms_asn1.c
+++ b/crypto/cms/cms_asn1.c
@@ -53,6 +53,7 @@
#include <openssl/asn1t.h>
#include <openssl/pem.h>
+#include <openssl/x509v3.h>
#include "cms.h"
#include "cms_lcl.h"
@@ -357,3 +358,15 @@ ASN1_ITEM_TEMPLATE(CMS_Attributes_Verify) =
V_ASN1_SET, CMS_ATTRIBUTES, X509_ATTRIBUTE)
ASN1_ITEM_TEMPLATE_END(CMS_Attributes_Verify)
+
+
+ASN1_CHOICE(CMS_ReceiptsFrom) = {
+ ASN1_IMP(CMS_ReceiptsFrom, d.allOrFirstTier, LONG, 0),
+ ASN1_IMP_SEQUENCE_OF(CMS_ReceiptsFrom, d.receiptList, GENERAL_NAME, 1)
+} ASN1_CHOICE_END(CMS_ReceiptsFrom)
+
+ASN1_SEQUENCE(CMS_ReceiptRequest) = {
+ ASN1_SIMPLE(CMS_ReceiptRequest, signedContentIdentifier, ASN1_OCTET_STRING),
+ ASN1_SIMPLE(CMS_ReceiptRequest, receiptsFrom, CMS_ReceiptsFrom)
+} ASN1_SEQUENCE_END(CMS_ReceiptRequest)
+
diff --git a/crypto/cms/cms_lcl.h b/crypto/cms/cms_lcl.h
index f23d096607..0956721938 100644
--- a/crypto/cms/cms_lcl.h
+++ b/crypto/cms/cms_lcl.h
@@ -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
{
@@ -374,6 +375,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;
+ GENERAL_NAMES *receiptsTo;
+ };
+
+
+struct CMS_ReceiptsFrom_st
+ {
+ int type;
+ union
+ {
+ long allOrFirstTier;
+ 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)