[Automatic update for 2016-03-13]
[metze/wireshark/wip.git] / asn1 / cms / cms.cnf
1 # CMS.cnf
2 # CMS conformation file
3
4 #.IMPORT ../x509af/x509af-exp.cnf
5 #.IMPORT ../x509ce/x509ce-exp.cnf
6 #.IMPORT ../x509if/x509if-exp.cnf
7 #.IMPORT ../x509sat/x509sat-exp.cnf
8
9 #.OMIT_ASSIGNMENT
10 KeyWrapAlgorithm
11 CBCParameter
12 IV
13 ExtendedCertificateOrCertificate
14 #.END
15
16 #.EXPORTS
17 ContentInfo
18 ContentType
19 Countersignature
20 Digest
21 DigestAlgorithmIdentifier
22 DigestAlgorithmIdentifiers
23 EncapsulatedContentInfo
24 EnvelopedData
25 IssuerAndSerialNumber
26 SignedAttributes
27 SignedData
28 SignerIdentifier
29 SignerInfo
30 SignerInfos
31 SignatureValue
32 UnsignedAttributes
33
34 #.REGISTER
35 ContentInfo                     B "1.2.840.113549.1.9.16.1.6" "id-ct-contentInfo"
36 #OctetString            B "1.2.840.113549.1.7.1"      "id-data"                  see x509sat.cnf
37 SignedData                      B "1.2.840.113549.1.7.2"      "id-signedData"
38 EnvelopedData           B "1.2.840.113549.1.7.3"      "id-envelopedData"
39 DigestedData            B "1.2.840.113549.1.7.5"      "id-digestedData"
40 EncryptedData           B "1.2.840.113549.1.7.6"      "id-encryptedData"
41 AuthenticatedData       B "1.2.840.113549.1.9.16.1.2" "id-ct-authenticatedData"
42
43 ContentType                     B "1.2.840.113549.1.9.3"        "id-contentType"
44 MessageDigest           B "1.2.840.113549.1.9.4"        "id-messageDigest"
45 SigningTime                     B "1.2.840.113549.1.9.5"        "id-signingTime"
46 Countersignature        B "1.2.840.113549.1.9.6"        "id-counterSignature"
47
48 ContentInfo                     B "2.6.1.4.18" "id-et-pkcs7"
49
50 IssuerAndSerialNumber   B "1.3.6.1.4.1.311.16.4" "ms-oe-encryption-key-preference"
51 SMIMECapabilities       B "1.2.840.113549.1.9.15" "id-smime-capabilities"
52 SMIMEEncryptionKeyPreference B "1.2.840.113549.1.9.16.2.11" "id-encryption-key-preference"
53
54 # I think the following should be RC2CBCParameter - but that appears to be incorrect
55 RC2CBCParameters        B "1.2.840.113549.3.2" "id-alg-rc2-cbc"
56 RC2CBCParameters        B "1.2.840.113549.3.4" "id-alg-rc4"
57 RC2WrapParameter        B "1.2.840.113549.1.9.16.3.7" "id-alg-cmsrc2-wrap"
58
59 # RFC 2798 Attributes - see master list in x509sat.cnf
60 SignedData              B "2.16.840.1.113730.3.1.40"      "userSMIMECertificate"
61
62 #.NO_EMIT
63
64 #.TYPE_RENAME
65
66 #.FIELD_RENAME
67 SignerInfo/signature    signatureValue
68 RecipientEncryptedKey/rid       rekRid
69 EncryptedContentInfo/contentType        encryptedContentType
70 AttributeCertificateV1/signature        signatureValue_v1
71 AttributeCertificateV1/signatureAlgorithm       signatureAlgorithm_v1
72 AttributeCertificateInfoV1/attributes   attributes_v1
73 AttributeCertificateInfoV1/issuer       issuer_v1
74 AttributeCertificateInfoV1/signature    signature_v1
75 AttributeCertificateInfoV1/version      version_v1
76 RevocationInfoChoice/other              otherRIC
77
78 #.FN_BODY ContentInfo
79   top_tree = tree;
80   %(DEFAULT_BODY)s
81   content_tvb = NULL;
82   top_tree = NULL;
83
84 #.FN_PARS ContentType
85         FN_VARIANT = _str VAL_PTR = &object_identifier_id
86
87 #.FN_BODY ContentType
88         const char *name = NULL;
89
90         %(DEFAULT_BODY)s
91
92         if(object_identifier_id) {
93                 name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
94                 proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id);
95         }
96
97 #.FN_BODY ContentInfo/content
98   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
99
100
101 #.FN_BODY EncapsulatedContentInfo/eContent
102
103   offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
104   proto_item_set_text(actx->created_item, "eContent (%%u bytes)", tvb_reported_length (content_tvb));
105
106   call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
107
108 #.FN_PARS OtherRecipientInfo/oriType
109   FN_VARIANT = _str  VAL_PTR = &object_identifier_id
110
111 #.FN_BODY OtherRecipientInfo/oriValue
112   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
113
114 #.FN_PARS OtherKeyAttribute/keyAttrId
115   FN_VARIANT = _str  HF_INDEX = hf_cms_ci_contentType  VAL_PTR = &object_identifier_id
116
117 #.FN_BODY OtherKeyAttribute/keyAttr
118   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
119 #.FN_PARS OtherRevocationInfoFormat/otherRevInfoFormat
120   FN_VARIANT = _str  VAL_PTR = &object_identifier_id
121
122 #.FN_BODY OtherRevocationInfoFormat/otherRevInfo
123   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
124
125 #.FN_PARS Attribute/attrType
126   FN_VARIANT = _str  HF_INDEX = hf_cms_attrType  VAL_PTR = &object_identifier_id
127
128 #.FN_BODY Attribute/attrType
129   const char *name = NULL;
130
131   %(DEFAULT_BODY)s
132
133   if(object_identifier_id) {
134     name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
135     proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id);
136   }
137
138 #.FN_BODY AttributeValue
139
140   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
141
142 #.FN_BODY MessageDigest
143   proto_item *pi;
144   int old_offset = offset;
145
146   %(DEFAULT_BODY)s
147
148   pi = actx->created_item;
149
150   /* move past TLV */
151   old_offset = get_ber_identifier(tvb, old_offset, NULL, NULL, NULL);
152   old_offset = get_ber_length(tvb, old_offset, NULL, NULL);
153
154   if(content_tvb)
155     cms_verify_msg_digest(pi, content_tvb, x509af_get_last_algorithm_id(), tvb, old_offset);
156
157 #.FN_PARS SMIMECapability/capability
158   FN_VARIANT = _str  HF_INDEX = hf_cms_attrType  VAL_PTR = &object_identifier_id
159
160 #.FN_BODY SMIMECapability/capability
161   const char *name = NULL;
162
163   %(DEFAULT_BODY)s
164
165   if(object_identifier_id) {
166     name = oid_resolved_from_string(wmem_packet_scope(), object_identifier_id);
167     proto_item_append_text(tree, " %%s", name ? name : object_identifier_id);
168     cap_tree = tree;
169   }
170
171 #.FN_BODY SMIMECapability/parameters
172
173   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
174
175 #.FN_PARS RC2ParameterVersion
176   VAL_PTR = &length
177
178 #.FN_BODY RC2ParameterVersion
179   guint32 length = 0;
180
181   %(DEFAULT_BODY)s
182
183   if(cap_tree != NULL)
184     proto_item_append_text(cap_tree, " (%%d bits)", length);
185
186 #.FN_PARS EncryptedContent VAL_PTR = &encrypted_tvb
187
188 #.FN_HDR EncryptedContent
189         tvbuff_t *encrypted_tvb;
190         proto_item *item;
191 #.END
192
193 #.FN_FTR EncryptedContent
194
195         item = actx->created_item;
196
197         PBE_decrypt_data(object_identifier_id, encrypted_tvb, actx, item);
198
199 #.END
200
201