HACK: 2nd try to match RowsetProperties
[wireshark-wip.git] / epan / dissectors / packet-cms.c
blobc7943ac4c732dc6b5c1f9ad339cbe3742ecaa307
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-cms.c */
4 /* ../../tools/asn2wrs.py -b -C -p cms -c ./cms.cnf -s ./packet-cms-template -D . -O ../../epan/dissectors CryptographicMessageSyntax.asn AttributeCertificateVersion1.asn */
6 /* Input file: packet-cms-template.c */
8 #line 1 "../../asn1/cms/packet-cms-template.c"
9 /* packet-cms.c
10 * Routines for RFC5652 Cryptographic Message Syntax packet dissection
11 * Ronnie Sahlberg 2004
12 * Stig Bjorlykke 2010
14 * $Id$
16 * Wireshark - Network traffic analyzer
17 * By Gerald Combs <gerald@wireshark.org>
18 * Copyright 1998 Gerald Combs
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #include "config.h"
37 #include <glib.h>
39 #include <wsutil/sha1.h>
40 #include <wsutil/md5.h>
42 #include <epan/packet.h>
43 #include <epan/oids.h>
44 #include <epan/asn1.h>
46 #include <string.h>
48 #include "packet-ber.h"
49 #include "packet-cms.h"
50 #include "packet-x509af.h"
51 #include "packet-x509ce.h"
52 #include "packet-x509if.h"
53 #include "packet-x509sat.h"
54 #include "packet-pkcs12.h"
56 #define PNAME "Cryptographic Message Syntax"
57 #define PSNAME "CMS"
58 #define PFNAME "cms"
60 /* Initialize the protocol and registered fields */
61 static int proto_cms = -1;
62 static int hf_cms_ci_contentType = -1;
64 /*--- Included file: packet-cms-hf.c ---*/
65 #line 1 "../../asn1/cms/packet-cms-hf.c"
66 static int hf_cms_ContentInfo_PDU = -1; /* ContentInfo */
67 static int hf_cms_ContentType_PDU = -1; /* ContentType */
68 static int hf_cms_SignedData_PDU = -1; /* SignedData */
69 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
70 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
71 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
72 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
73 static int hf_cms_IssuerAndSerialNumber_PDU = -1; /* IssuerAndSerialNumber */
74 static int hf_cms_MessageDigest_PDU = -1; /* MessageDigest */
75 static int hf_cms_SigningTime_PDU = -1; /* SigningTime */
76 static int hf_cms_Countersignature_PDU = -1; /* Countersignature */
77 static int hf_cms_RC2WrapParameter_PDU = -1; /* RC2WrapParameter */
78 static int hf_cms_SMIMECapabilities_PDU = -1; /* SMIMECapabilities */
79 static int hf_cms_SMIMEEncryptionKeyPreference_PDU = -1; /* SMIMEEncryptionKeyPreference */
80 static int hf_cms_RC2CBCParameters_PDU = -1; /* RC2CBCParameters */
81 static int hf_cms_contentType = -1; /* ContentType */
82 static int hf_cms_content = -1; /* T_content */
83 static int hf_cms_version = -1; /* CMSVersion */
84 static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
85 static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
86 static int hf_cms_certificates = -1; /* CertificateSet */
87 static int hf_cms_crls = -1; /* RevocationInfoChoices */
88 static int hf_cms_signerInfos = -1; /* SignerInfos */
89 static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
90 static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
91 static int hf_cms_eContentType = -1; /* ContentType */
92 static int hf_cms_eContent = -1; /* T_eContent */
93 static int hf_cms_sid = -1; /* SignerIdentifier */
94 static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
95 static int hf_cms_signedAttrs = -1; /* SignedAttributes */
96 static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
97 static int hf_cms_signatureValue = -1; /* SignatureValue */
98 static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
99 static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
100 static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
101 static int hf_cms_SignedAttributes_item = -1; /* Attribute */
102 static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
103 static int hf_cms_attrType = -1; /* T_attrType */
104 static int hf_cms_attrValues = -1; /* SET_OF_AttributeValue */
105 static int hf_cms_attrValues_item = -1; /* AttributeValue */
106 static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
107 static int hf_cms_recipientInfos = -1; /* RecipientInfos */
108 static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
109 static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
110 static int hf_cms_certs = -1; /* CertificateSet */
111 static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
112 static int hf_cms_encryptedContentType = -1; /* ContentType */
113 static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
114 static int hf_cms_encryptedContent = -1; /* EncryptedContent */
115 static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
116 static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
117 static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
118 static int hf_cms_kekri = -1; /* KEKRecipientInfo */
119 static int hf_cms_pwri = -1; /* PasswordRecipientInfo */
120 static int hf_cms_ori = -1; /* OtherRecipientInfo */
121 static int hf_cms_rid = -1; /* RecipientIdentifier */
122 static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
123 static int hf_cms_encryptedKey = -1; /* EncryptedKey */
124 static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
125 static int hf_cms_ukm = -1; /* UserKeyingMaterial */
126 static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
127 static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
128 static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
129 static int hf_cms_publicKey = -1; /* BIT_STRING */
130 static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
131 static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
132 static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
133 static int hf_cms_date = -1; /* GeneralizedTime */
134 static int hf_cms_other = -1; /* OtherKeyAttribute */
135 static int hf_cms_kekid = -1; /* KEKIdentifier */
136 static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
137 static int hf_cms_keyDerivationAlgorithm = -1; /* KeyDerivationAlgorithmIdentifier */
138 static int hf_cms_oriType = -1; /* T_oriType */
139 static int hf_cms_oriValue = -1; /* T_oriValue */
140 static int hf_cms_digest = -1; /* Digest */
141 static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
142 static int hf_cms_authAttrs = -1; /* AuthAttributes */
143 static int hf_cms_mac = -1; /* MessageAuthenticationCode */
144 static int hf_cms_unauthAttrs = -1; /* UnauthAttributes */
145 static int hf_cms_AuthAttributes_item = -1; /* Attribute */
146 static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
147 static int hf_cms_RevocationInfoChoices_item = -1; /* RevocationInfoChoice */
148 static int hf_cms_crl = -1; /* CertificateList */
149 static int hf_cms_otherRIC = -1; /* OtherRevocationInfoFormat */
150 static int hf_cms_otherRevInfoFormat = -1; /* T_otherRevInfoFormat */
151 static int hf_cms_otherRevInfo = -1; /* T_otherRevInfo */
152 static int hf_cms_certificate = -1; /* Certificate */
153 static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
154 static int hf_cms_v1AttrCert = -1; /* AttributeCertificateV1 */
155 static int hf_cms_v2AttrCert = -1; /* AttributeCertificateV2 */
156 static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
157 static int hf_cms_issuer = -1; /* Name */
158 static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
159 static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
160 static int hf_cms_keyAttr = -1; /* T_keyAttr */
161 static int hf_cms_utcTime = -1; /* UTCTime */
162 static int hf_cms_generalTime = -1; /* GeneralizedTime */
163 static int hf_cms_rc2ParameterVersion = -1; /* INTEGER */
164 static int hf_cms_iv = -1; /* OCTET_STRING */
165 static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
166 static int hf_cms_signature = -1; /* Signature */
167 static int hf_cms_attributes = -1; /* UnauthAttributes */
168 static int hf_cms_SMIMECapabilities_item = -1; /* SMIMECapability */
169 static int hf_cms_capability = -1; /* T_capability */
170 static int hf_cms_parameters = -1; /* T_parameters */
171 static int hf_cms_recipientKeyId = -1; /* RecipientKeyIdentifier */
172 static int hf_cms_subjectAltKeyIdentifier = -1; /* SubjectKeyIdentifier */
173 static int hf_cms_rc2WrapParameter = -1; /* RC2WrapParameter */
174 static int hf_cms_rc2CBCParameter = -1; /* RC2CBCParameter */
175 static int hf_cms_acInfo = -1; /* AttributeCertificateInfoV1 */
176 static int hf_cms_signatureAlgorithm_v1 = -1; /* AlgorithmIdentifier */
177 static int hf_cms_signatureValue_v1 = -1; /* BIT_STRING */
178 static int hf_cms_version_v1 = -1; /* AttCertVersionV1 */
179 static int hf_cms_subject = -1; /* T_subject */
180 static int hf_cms_baseCertificateID = -1; /* IssuerSerial */
181 static int hf_cms_subjectName = -1; /* GeneralNames */
182 static int hf_cms_issuer_v1 = -1; /* GeneralNames */
183 static int hf_cms_signature_v1 = -1; /* AlgorithmIdentifier */
184 static int hf_cms_attCertValidityPeriod = -1; /* AttCertValidityPeriod */
185 static int hf_cms_attributes_v1 = -1; /* SEQUENCE_OF_Attribute */
186 static int hf_cms_attributes_v1_item = -1; /* Attribute */
187 static int hf_cms_issuerUniqueID = -1; /* UniqueIdentifier */
188 static int hf_cms_extensions = -1; /* Extensions */
190 /*--- End of included file: packet-cms-hf.c ---*/
191 #line 56 "../../asn1/cms/packet-cms-template.c"
193 /* Initialize the subtree pointers */
195 /*--- Included file: packet-cms-ett.c ---*/
196 #line 1 "../../asn1/cms/packet-cms-ett.c"
197 static gint ett_cms_ContentInfo = -1;
198 static gint ett_cms_SignedData = -1;
199 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
200 static gint ett_cms_SignerInfos = -1;
201 static gint ett_cms_EncapsulatedContentInfo = -1;
202 static gint ett_cms_SignerInfo = -1;
203 static gint ett_cms_SignerIdentifier = -1;
204 static gint ett_cms_SignedAttributes = -1;
205 static gint ett_cms_UnsignedAttributes = -1;
206 static gint ett_cms_Attribute = -1;
207 static gint ett_cms_SET_OF_AttributeValue = -1;
208 static gint ett_cms_EnvelopedData = -1;
209 static gint ett_cms_OriginatorInfo = -1;
210 static gint ett_cms_RecipientInfos = -1;
211 static gint ett_cms_EncryptedContentInfo = -1;
212 static gint ett_cms_UnprotectedAttributes = -1;
213 static gint ett_cms_RecipientInfo = -1;
214 static gint ett_cms_KeyTransRecipientInfo = -1;
215 static gint ett_cms_RecipientIdentifier = -1;
216 static gint ett_cms_KeyAgreeRecipientInfo = -1;
217 static gint ett_cms_OriginatorIdentifierOrKey = -1;
218 static gint ett_cms_OriginatorPublicKey = -1;
219 static gint ett_cms_RecipientEncryptedKeys = -1;
220 static gint ett_cms_RecipientEncryptedKey = -1;
221 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
222 static gint ett_cms_RecipientKeyIdentifier = -1;
223 static gint ett_cms_KEKRecipientInfo = -1;
224 static gint ett_cms_KEKIdentifier = -1;
225 static gint ett_cms_PasswordRecipientInfo = -1;
226 static gint ett_cms_OtherRecipientInfo = -1;
227 static gint ett_cms_DigestedData = -1;
228 static gint ett_cms_EncryptedData = -1;
229 static gint ett_cms_AuthenticatedData = -1;
230 static gint ett_cms_AuthAttributes = -1;
231 static gint ett_cms_UnauthAttributes = -1;
232 static gint ett_cms_RevocationInfoChoices = -1;
233 static gint ett_cms_RevocationInfoChoice = -1;
234 static gint ett_cms_OtherRevocationInfoFormat = -1;
235 static gint ett_cms_CertificateChoices = -1;
236 static gint ett_cms_CertificateSet = -1;
237 static gint ett_cms_IssuerAndSerialNumber = -1;
238 static gint ett_cms_OtherKeyAttribute = -1;
239 static gint ett_cms_Time = -1;
240 static gint ett_cms_RC2CBCParameter = -1;
241 static gint ett_cms_ExtendedCertificate = -1;
242 static gint ett_cms_ExtendedCertificateInfo = -1;
243 static gint ett_cms_SMIMECapabilities = -1;
244 static gint ett_cms_SMIMECapability = -1;
245 static gint ett_cms_SMIMEEncryptionKeyPreference = -1;
246 static gint ett_cms_RC2CBCParameters = -1;
247 static gint ett_cms_AttributeCertificateV1 = -1;
248 static gint ett_cms_AttributeCertificateInfoV1 = -1;
249 static gint ett_cms_T_subject = -1;
250 static gint ett_cms_SEQUENCE_OF_Attribute = -1;
252 /*--- End of included file: packet-cms-ett.c ---*/
253 #line 59 "../../asn1/cms/packet-cms-template.c"
255 static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
258 static const char *object_identifier_id;
259 static tvbuff_t *content_tvb = NULL;
261 static proto_tree *top_tree=NULL;
262 static proto_tree *cap_tree=NULL;
264 #define HASH_SHA1 "1.3.14.3.2.26"
265 #define SHA1_BUFFER_SIZE 20
267 #define HASH_MD5 "1.2.840.113549.2.5"
268 #define MD5_BUFFER_SIZE 16
271 /* SHA-2 variants */
272 #define HASH_SHA224 "2.16.840.1.101.3.4.2.4"
273 #define SHA224_BUFFER_SIZE 32 /* actually 28 */
274 #define HASH_SHA256 "2.16.840.1.101.3.4.2.1"
275 #define SHA256_BUFFER_SIZE 32
277 unsigned char digest_buf[MAX(SHA1_BUFFER_SIZE, MD5_BUFFER_SIZE)];
279 static void
280 cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff_t *tvb, int offset)
282 sha1_context sha1_ctx;
283 md5_state_t md5_ctx;
284 int i= 0, buffer_size = 0;
286 /* we only support two algorithms at the moment - if we do add SHA2
287 we should add a registration process to use a registration process */
289 if(strcmp(alg, HASH_SHA1) == 0) {
291 sha1_starts(&sha1_ctx);
293 sha1_update(&sha1_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
294 tvb_length(content));
296 sha1_finish(&sha1_ctx, digest_buf);
298 buffer_size = SHA1_BUFFER_SIZE;
300 } else if(strcmp(alg, HASH_MD5) == 0) {
302 md5_init(&md5_ctx);
304 md5_append(&md5_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
305 tvb_length(content));
307 md5_finish(&md5_ctx, digest_buf);
309 buffer_size = MD5_BUFFER_SIZE;
312 if(buffer_size) {
313 /* compare our computed hash with what we have received */
315 if(tvb_bytes_exist(tvb, offset, buffer_size) &&
316 (tvb_memeql(tvb, offset, digest_buf, buffer_size) != 0)) {
317 proto_item_append_text(pi, " [incorrect, should be ");
318 for(i = 0; i < buffer_size; i++)
319 proto_item_append_text(pi, "%02X", digest_buf[i]);
321 proto_item_append_text(pi, "]");
323 else
324 proto_item_append_text(pi, " [correct]");
325 } else {
326 proto_item_append_text(pi, " [unable to verify]");
332 /*--- Included file: packet-cms-fn.c ---*/
333 #line 1 "../../asn1/cms/packet-cms-fn.c"
337 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
338 #line 90 "../../asn1/cms/cms.cnf"
339 const char *name = NULL;
341 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
344 if(object_identifier_id) {
345 name = oid_resolved_from_string(object_identifier_id);
346 proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
351 return offset;
356 static int
357 dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
358 #line 100 "../../asn1/cms/cms.cnf"
359 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
364 return offset;
368 static const ber_sequence_t ContentInfo_sequence[] = {
369 { &hf_cms_contentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
370 { &hf_cms_content , BER_CLASS_CON, 0, 0, dissect_cms_T_content },
371 { NULL, 0, 0, 0, NULL }
375 dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
376 #line 81 "../../asn1/cms/cms.cnf"
377 top_tree = tree;
378 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
379 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
381 content_tvb = NULL;
382 top_tree = NULL;
386 return offset;
390 static const value_string cms_CMSVersion_vals[] = {
391 { 0, "v0" },
392 { 1, "v1" },
393 { 2, "v2" },
394 { 3, "v3" },
395 { 4, "v4" },
396 { 5, "v5" },
397 { 0, NULL }
401 static int
402 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
403 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
404 NULL);
406 return offset;
412 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
413 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
415 return offset;
419 static const ber_sequence_t DigestAlgorithmIdentifiers_set_of[1] = {
420 { &hf_cms_DigestAlgorithmIdentifiers_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
424 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
425 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
426 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
428 return offset;
433 static int
434 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
435 #line 104 "../../asn1/cms/cms.cnf"
437 offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
438 proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_length (content_tvb));
440 call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
444 return offset;
448 static const ber_sequence_t EncapsulatedContentInfo_sequence[] = {
449 { &hf_cms_eContentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
450 { &hf_cms_eContent , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cms_T_eContent },
451 { NULL, 0, 0, 0, NULL }
455 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
456 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
457 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
459 return offset;
464 static int
465 dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
466 #line 131 "../../asn1/cms/cms.cnf"
467 const char *name = NULL;
469 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
472 if(object_identifier_id) {
473 name = oid_resolved_from_string(object_identifier_id);
474 proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
479 return offset;
484 static int
485 dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
486 #line 141 "../../asn1/cms/cms.cnf"
488 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
492 return offset;
496 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
497 { &hf_cms_attrValues_item , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeValue },
500 static int
501 dissect_cms_SET_OF_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
502 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
503 SET_OF_AttributeValue_set_of, hf_index, ett_cms_SET_OF_AttributeValue);
505 return offset;
509 static const ber_sequence_t Attribute_sequence[] = {
510 { &hf_cms_attrType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_attrType },
511 { &hf_cms_attrValues , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SET_OF_AttributeValue },
512 { NULL, 0, 0, 0, NULL }
515 static int
516 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
517 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
518 Attribute_sequence, hf_index, ett_cms_Attribute);
520 return offset;
524 static const ber_sequence_t UnauthAttributes_set_of[1] = {
525 { &hf_cms_UnauthAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
528 static int
529 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
530 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
531 1, NO_BOUND, UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
533 return offset;
537 static const ber_sequence_t ExtendedCertificateInfo_sequence[] = {
538 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
539 { &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
540 { &hf_cms_attributes , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_UnauthAttributes },
541 { NULL, 0, 0, 0, NULL }
544 static int
545 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
546 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
547 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
549 return offset;
554 static int
555 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
556 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
558 return offset;
563 static int
564 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
565 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
566 NULL, hf_index, -1,
567 NULL);
569 return offset;
573 static const ber_sequence_t ExtendedCertificate_sequence[] = {
574 { &hf_cms_extendedCertificateInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ExtendedCertificateInfo },
575 { &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
576 { &hf_cms_signature , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Signature },
577 { NULL, 0, 0, 0, NULL }
580 static int
581 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
582 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
583 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
585 return offset;
589 static const value_string cms_AttCertVersionV1_vals[] = {
590 { 0, "v1" },
591 { 0, NULL }
595 static int
596 dissect_cms_AttCertVersionV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
597 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
598 NULL);
600 return offset;
604 static const value_string cms_T_subject_vals[] = {
605 { 0, "baseCertificateID" },
606 { 1, "subjectName" },
607 { 0, NULL }
610 static const ber_choice_t T_subject_choice[] = {
611 { 0, &hf_cms_baseCertificateID, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_x509af_IssuerSerial },
612 { 1, &hf_cms_subjectName , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
613 { 0, NULL, 0, 0, 0, NULL }
616 static int
617 dissect_cms_T_subject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
618 offset = dissect_ber_choice(actx, tree, tvb, offset,
619 T_subject_choice, hf_index, ett_cms_T_subject,
620 NULL);
622 return offset;
626 static const ber_sequence_t SEQUENCE_OF_Attribute_sequence_of[1] = {
627 { &hf_cms_attributes_v1_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
630 static int
631 dissect_cms_SEQUENCE_OF_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
632 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
633 SEQUENCE_OF_Attribute_sequence_of, hf_index, ett_cms_SEQUENCE_OF_Attribute);
635 return offset;
639 static const ber_sequence_t AttributeCertificateInfoV1_sequence[] = {
640 { &hf_cms_version_v1 , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_AttCertVersionV1 },
641 { &hf_cms_subject , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_T_subject },
642 { &hf_cms_issuer_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
643 { &hf_cms_signature_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
644 { &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
645 { &hf_cms_attCertValidityPeriod, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AttCertValidityPeriod },
646 { &hf_cms_attributes_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SEQUENCE_OF_Attribute },
647 { &hf_cms_issuerUniqueID , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509sat_UniqueIdentifier },
648 { &hf_cms_extensions , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509af_Extensions },
649 { NULL, 0, 0, 0, NULL }
652 static int
653 dissect_cms_AttributeCertificateInfoV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
654 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
655 AttributeCertificateInfoV1_sequence, hf_index, ett_cms_AttributeCertificateInfoV1);
657 return offset;
662 static int
663 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
664 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
665 NULL, hf_index, -1,
666 NULL);
668 return offset;
672 static const ber_sequence_t AttributeCertificateV1_sequence[] = {
673 { &hf_cms_acInfo , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeCertificateInfoV1 },
674 { &hf_cms_signatureAlgorithm_v1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
675 { &hf_cms_signatureValue_v1, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_BIT_STRING },
676 { NULL, 0, 0, 0, NULL }
679 static int
680 dissect_cms_AttributeCertificateV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
681 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
682 AttributeCertificateV1_sequence, hf_index, ett_cms_AttributeCertificateV1);
684 return offset;
689 static int
690 dissect_cms_AttributeCertificateV2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
691 offset = dissect_x509af_AttributeCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
693 return offset;
697 static const value_string cms_CertificateChoices_vals[] = {
698 { 0, "certificate" },
699 { 1, "extendedCertificate" },
700 { 2, "v1AttrCert" },
701 { 3, "v2AttrCert" },
702 { 0, NULL }
705 static const ber_choice_t CertificateChoices_choice[] = {
706 { 0, &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
707 { 1, &hf_cms_extendedCertificate, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_ExtendedCertificate },
708 { 2, &hf_cms_v1AttrCert , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV1 },
709 { 3, &hf_cms_v2AttrCert , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV2 },
710 { 0, NULL, 0, 0, 0, NULL }
713 static int
714 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
715 offset = dissect_ber_choice(actx, tree, tvb, offset,
716 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices,
717 NULL);
719 return offset;
723 static const ber_sequence_t CertificateSet_set_of[1] = {
724 { &hf_cms_CertificateSet_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_CertificateChoices },
727 static int
728 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
729 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
730 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
732 return offset;
737 static int
738 dissect_cms_T_otherRevInfoFormat(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
739 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
741 return offset;
746 static int
747 dissect_cms_T_otherRevInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
748 #line 125 "../../asn1/cms/cms.cnf"
749 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
753 return offset;
757 static const ber_sequence_t OtherRevocationInfoFormat_sequence[] = {
758 { &hf_cms_otherRevInfoFormat, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfoFormat },
759 { &hf_cms_otherRevInfo , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfo },
760 { NULL, 0, 0, 0, NULL }
763 static int
764 dissect_cms_OtherRevocationInfoFormat(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
765 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
766 OtherRevocationInfoFormat_sequence, hf_index, ett_cms_OtherRevocationInfoFormat);
768 return offset;
772 static const value_string cms_RevocationInfoChoice_vals[] = {
773 { 0, "crl" },
774 { 1, "other" },
775 { 0, NULL }
778 static const ber_choice_t RevocationInfoChoice_choice[] = {
779 { 0, &hf_cms_crl , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateList },
780 { 1, &hf_cms_otherRIC , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_OtherRevocationInfoFormat },
781 { 0, NULL, 0, 0, 0, NULL }
784 static int
785 dissect_cms_RevocationInfoChoice(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
786 offset = dissect_ber_choice(actx, tree, tvb, offset,
787 RevocationInfoChoice_choice, hf_index, ett_cms_RevocationInfoChoice,
788 NULL);
790 return offset;
794 static const ber_sequence_t RevocationInfoChoices_set_of[1] = {
795 { &hf_cms_RevocationInfoChoices_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RevocationInfoChoice },
798 static int
799 dissect_cms_RevocationInfoChoices(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
800 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
801 RevocationInfoChoices_set_of, hf_index, ett_cms_RevocationInfoChoices);
803 return offset;
807 static const ber_sequence_t IssuerAndSerialNumber_sequence[] = {
808 { &hf_cms_issuer , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509if_Name },
809 { &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
810 { NULL, 0, 0, 0, NULL }
814 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
815 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
816 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
818 return offset;
823 static int
824 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
825 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
826 NULL);
828 return offset;
832 const value_string cms_SignerIdentifier_vals[] = {
833 { 0, "issuerAndSerialNumber" },
834 { 1, "subjectKeyIdentifier" },
835 { 0, NULL }
838 static const ber_choice_t SignerIdentifier_choice[] = {
839 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
840 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
841 { 0, NULL, 0, 0, 0, NULL }
845 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
846 offset = dissect_ber_choice(actx, tree, tvb, offset,
847 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier,
848 NULL);
850 return offset;
854 static const ber_sequence_t SignedAttributes_set_of[1] = {
855 { &hf_cms_SignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
859 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
860 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
861 1, NO_BOUND, SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
863 return offset;
869 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
870 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
871 NULL);
873 return offset;
877 static const ber_sequence_t UnsignedAttributes_set_of[1] = {
878 { &hf_cms_UnsignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
882 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
883 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
884 1, NO_BOUND, UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
886 return offset;
890 static const ber_sequence_t SignerInfo_sequence[] = {
891 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
892 { &hf_cms_sid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_SignerIdentifier },
893 { &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
894 { &hf_cms_signedAttrs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_SignedAttributes },
895 { &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
896 { &hf_cms_signatureValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureValue },
897 { &hf_cms_unsignedAttrs , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnsignedAttributes },
898 { NULL, 0, 0, 0, NULL }
902 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
903 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
904 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
906 return offset;
910 static const ber_sequence_t SignerInfos_set_of[1] = {
911 { &hf_cms_SignerInfos_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfo },
915 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
916 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
917 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
919 return offset;
923 static const ber_sequence_t SignedData_sequence[] = {
924 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
925 { &hf_cms_digestAlgorithms, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifiers },
926 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
927 { &hf_cms_certificates , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
928 { &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
929 { &hf_cms_signerInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfos },
930 { NULL, 0, 0, 0, NULL }
934 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
935 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
936 SignedData_sequence, hf_index, ett_cms_SignedData);
938 return offset;
942 static const ber_sequence_t OriginatorInfo_sequence[] = {
943 { &hf_cms_certs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
944 { &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
945 { NULL, 0, 0, 0, NULL }
948 static int
949 dissect_cms_OriginatorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
950 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
951 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
953 return offset;
957 static const value_string cms_RecipientIdentifier_vals[] = {
958 { 0, "issuerAndSerialNumber" },
959 { 1, "subjectKeyIdentifier" },
960 { 0, NULL }
963 static const ber_choice_t RecipientIdentifier_choice[] = {
964 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
965 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
966 { 0, NULL, 0, 0, 0, NULL }
969 static int
970 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
971 offset = dissect_ber_choice(actx, tree, tvb, offset,
972 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier,
973 NULL);
975 return offset;
980 static int
981 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
982 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
984 return offset;
989 static int
990 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
991 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
992 NULL);
994 return offset;
998 static const ber_sequence_t KeyTransRecipientInfo_sequence[] = {
999 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1000 { &hf_cms_rid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RecipientIdentifier },
1001 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1002 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1003 { NULL, 0, 0, 0, NULL }
1006 static int
1007 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1008 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1009 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
1011 return offset;
1015 static const ber_sequence_t OriginatorPublicKey_sequence[] = {
1016 { &hf_cms_algorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
1017 { &hf_cms_publicKey , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_BIT_STRING },
1018 { NULL, 0, 0, 0, NULL }
1021 static int
1022 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1023 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1024 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
1026 return offset;
1030 static const value_string cms_OriginatorIdentifierOrKey_vals[] = {
1031 { 0, "issuerAndSerialNumber" },
1032 { 1, "subjectKeyIdentifier" },
1033 { 2, "originatorKey" },
1034 { 0, NULL }
1037 static const ber_choice_t OriginatorIdentifierOrKey_choice[] = {
1038 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
1039 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
1040 { 2, &hf_cms_originatorKey , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_OriginatorPublicKey },
1041 { 0, NULL, 0, 0, 0, NULL }
1044 static int
1045 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1046 offset = dissect_ber_choice(actx, tree, tvb, offset,
1047 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey,
1048 NULL);
1050 return offset;
1055 static int
1056 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1057 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1058 NULL);
1060 return offset;
1065 static int
1066 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1067 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
1069 return offset;
1074 static int
1075 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1076 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_ci_contentType, &object_identifier_id);
1078 return offset;
1083 static int
1084 dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1085 #line 120 "../../asn1/cms/cms.cnf"
1086 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1089 return offset;
1093 static const ber_sequence_t OtherKeyAttribute_sequence[] = {
1094 { &hf_cms_keyAttrId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_keyAttrId },
1095 { &hf_cms_keyAttr , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_T_keyAttr },
1096 { NULL, 0, 0, 0, NULL }
1099 static int
1100 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1101 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1102 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
1104 return offset;
1108 static const ber_sequence_t RecipientKeyIdentifier_sequence[] = {
1109 { &hf_cms_subjectKeyIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_SubjectKeyIdentifier },
1110 { &hf_cms_date , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1111 { &hf_cms_other , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_OtherKeyAttribute },
1112 { NULL, 0, 0, 0, NULL }
1115 static int
1116 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1117 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1118 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
1120 return offset;
1124 static const value_string cms_KeyAgreeRecipientIdentifier_vals[] = {
1125 { 0, "issuerAndSerialNumber" },
1126 { 1, "rKeyId" },
1127 { 0, NULL }
1130 static const ber_choice_t KeyAgreeRecipientIdentifier_choice[] = {
1131 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
1132 { 1, &hf_cms_rKeyId , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_RecipientKeyIdentifier },
1133 { 0, NULL, 0, 0, 0, NULL }
1136 static int
1137 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1138 offset = dissect_ber_choice(actx, tree, tvb, offset,
1139 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier,
1140 NULL);
1142 return offset;
1146 static const ber_sequence_t RecipientEncryptedKey_sequence[] = {
1147 { &hf_cms_rekRid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_KeyAgreeRecipientIdentifier },
1148 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1149 { NULL, 0, 0, 0, NULL }
1152 static int
1153 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1154 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1155 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
1157 return offset;
1161 static const ber_sequence_t RecipientEncryptedKeys_sequence_of[1] = {
1162 { &hf_cms_RecipientEncryptedKeys_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientEncryptedKey },
1165 static int
1166 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1167 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1168 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
1170 return offset;
1174 static const ber_sequence_t KeyAgreeRecipientInfo_sequence[] = {
1175 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1176 { &hf_cms_originator , BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_cms_OriginatorIdentifierOrKey },
1177 { &hf_cms_ukm , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_cms_UserKeyingMaterial },
1178 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1179 { &hf_cms_recipientEncryptedKeys, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientEncryptedKeys },
1180 { NULL, 0, 0, 0, NULL }
1183 static int
1184 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1185 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1186 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
1188 return offset;
1193 static int
1194 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1195 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1196 NULL);
1198 return offset;
1202 static const ber_sequence_t KEKIdentifier_sequence[] = {
1203 { &hf_cms_keyIdentifier , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1204 { &hf_cms_date , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1205 { &hf_cms_other , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_OtherKeyAttribute },
1206 { NULL, 0, 0, 0, NULL }
1209 static int
1210 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1211 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1212 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1214 return offset;
1218 static const ber_sequence_t KEKRecipientInfo_sequence[] = {
1219 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1220 { &hf_cms_kekid , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KEKIdentifier },
1221 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1222 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1223 { NULL, 0, 0, 0, NULL }
1226 static int
1227 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1228 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1229 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1231 return offset;
1236 static int
1237 dissect_cms_KeyDerivationAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1238 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1240 return offset;
1244 static const ber_sequence_t PasswordRecipientInfo_sequence[] = {
1245 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1246 { &hf_cms_keyDerivationAlgorithm, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_KeyDerivationAlgorithmIdentifier },
1247 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1248 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1249 { NULL, 0, 0, 0, NULL }
1252 static int
1253 dissect_cms_PasswordRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1254 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1255 PasswordRecipientInfo_sequence, hf_index, ett_cms_PasswordRecipientInfo);
1257 return offset;
1262 static int
1263 dissect_cms_T_oriType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1264 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
1266 return offset;
1271 static int
1272 dissect_cms_T_oriValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1273 #line 114 "../../asn1/cms/cms.cnf"
1274 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1278 return offset;
1282 static const ber_sequence_t OtherRecipientInfo_sequence[] = {
1283 { &hf_cms_oriType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_oriType },
1284 { &hf_cms_oriValue , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_T_oriValue },
1285 { NULL, 0, 0, 0, NULL }
1288 static int
1289 dissect_cms_OtherRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1290 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1291 OtherRecipientInfo_sequence, hf_index, ett_cms_OtherRecipientInfo);
1293 return offset;
1297 static const value_string cms_RecipientInfo_vals[] = {
1298 { 0, "ktri" },
1299 { 1, "kari" },
1300 { 2, "kekri" },
1301 { 3, "pwri" },
1302 { 4, "ori" },
1303 { 0, NULL }
1306 static const ber_choice_t RecipientInfo_choice[] = {
1307 { 0, &hf_cms_ktri , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyTransRecipientInfo },
1308 { 1, &hf_cms_kari , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_KeyAgreeRecipientInfo },
1309 { 2, &hf_cms_kekri , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_KEKRecipientInfo },
1310 { 3, &hf_cms_pwri , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_cms_PasswordRecipientInfo },
1311 { 4, &hf_cms_ori , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_cms_OtherRecipientInfo },
1312 { 0, NULL, 0, 0, 0, NULL }
1315 static int
1316 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1317 offset = dissect_ber_choice(actx, tree, tvb, offset,
1318 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo,
1319 NULL);
1321 return offset;
1325 static const ber_sequence_t RecipientInfos_set_of[1] = {
1326 { &hf_cms_RecipientInfos_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RecipientInfo },
1329 static int
1330 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1331 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1332 1, NO_BOUND, RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1334 return offset;
1339 static int
1340 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1341 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1343 return offset;
1348 static int
1349 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1350 #line 191 "../../asn1/cms/cms.cnf"
1351 tvbuff_t *encrypted_tvb;
1352 proto_item *item;
1354 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1355 &encrypted_tvb);
1357 #line 196 "../../asn1/cms/cms.cnf"
1359 item = actx->created_item;
1361 PBE_decrypt_data(object_identifier_id, encrypted_tvb, actx, item);
1364 return offset;
1368 static const ber_sequence_t EncryptedContentInfo_sequence[] = {
1369 { &hf_cms_encryptedContentType, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
1370 { &hf_cms_contentEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ContentEncryptionAlgorithmIdentifier },
1371 { &hf_cms_encryptedContent, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_EncryptedContent },
1372 { NULL, 0, 0, 0, NULL }
1375 static int
1376 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1377 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1378 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1380 return offset;
1384 static const ber_sequence_t UnprotectedAttributes_set_of[1] = {
1385 { &hf_cms_UnprotectedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
1388 static int
1389 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1390 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1391 1, NO_BOUND, UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1393 return offset;
1397 static const ber_sequence_t EnvelopedData_sequence[] = {
1398 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1399 { &hf_cms_originatorInfo , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OriginatorInfo },
1400 { &hf_cms_recipientInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientInfos },
1401 { &hf_cms_encryptedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedContentInfo },
1402 { &hf_cms_unprotectedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnprotectedAttributes },
1403 { NULL, 0, 0, 0, NULL }
1407 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1408 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1409 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1411 return offset;
1417 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1418 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1419 NULL);
1421 return offset;
1425 static const ber_sequence_t DigestedData_sequence[] = {
1426 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1427 { &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
1428 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
1429 { &hf_cms_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
1430 { NULL, 0, 0, 0, NULL }
1433 static int
1434 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1435 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1436 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1438 return offset;
1442 static const ber_sequence_t EncryptedData_sequence[] = {
1443 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1444 { &hf_cms_encryptedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedContentInfo },
1445 { &hf_cms_unprotectedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnprotectedAttributes },
1446 { NULL, 0, 0, 0, NULL }
1449 static int
1450 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1451 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1452 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1454 return offset;
1459 static int
1460 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1461 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1463 return offset;
1467 static const ber_sequence_t AuthAttributes_set_of[1] = {
1468 { &hf_cms_AuthAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
1471 static int
1472 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1473 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1474 1, NO_BOUND, AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1476 return offset;
1481 static int
1482 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1483 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1484 NULL);
1486 return offset;
1490 static const ber_sequence_t AuthenticatedData_sequence[] = {
1491 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1492 { &hf_cms_originatorInfo , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OriginatorInfo },
1493 { &hf_cms_recipientInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientInfos },
1494 { &hf_cms_macAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_MessageAuthenticationCodeAlgorithm },
1495 { &hf_cms_digestAlgorithm , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_DigestAlgorithmIdentifier },
1496 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
1497 { &hf_cms_authAttrs , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_AuthAttributes },
1498 { &hf_cms_mac , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_MessageAuthenticationCode },
1499 { &hf_cms_unauthAttrs , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnauthAttributes },
1500 { NULL, 0, 0, 0, NULL }
1503 static int
1504 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1505 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1506 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1508 return offset;
1513 static int
1514 dissect_cms_MessageDigest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1515 #line 145 "../../asn1/cms/cms.cnf"
1516 proto_item *pi;
1517 int old_offset = offset;
1519 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1520 NULL);
1523 pi = actx->created_item;
1525 /* move past TLV */
1526 old_offset = get_ber_identifier(tvb, old_offset, NULL, NULL, NULL);
1527 old_offset = get_ber_length(tvb, old_offset, NULL, NULL);
1529 if(content_tvb)
1530 cms_verify_msg_digest(pi, content_tvb, x509af_get_last_algorithm_id(), tvb, old_offset);
1534 return offset;
1539 static int
1540 dissect_cms_UTCTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1541 offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
1543 return offset;
1547 static const value_string cms_Time_vals[] = {
1548 { 0, "utcTime" },
1549 { 1, "generalTime" },
1550 { 0, NULL }
1553 static const ber_choice_t Time_choice[] = {
1554 { 0, &hf_cms_utcTime , BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_cms_UTCTime },
1555 { 1, &hf_cms_generalTime , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1556 { 0, NULL, 0, 0, 0, NULL }
1559 static int
1560 dissect_cms_Time(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1561 offset = dissect_ber_choice(actx, tree, tvb, offset,
1562 Time_choice, hf_index, ett_cms_Time,
1563 NULL);
1565 return offset;
1570 static int
1571 dissect_cms_SigningTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1572 offset = dissect_cms_Time(implicit_tag, tvb, offset, actx, tree, hf_index);
1574 return offset;
1580 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1581 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
1583 return offset;
1588 static int
1589 dissect_cms_RC2ParameterVersion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1590 #line 181 "../../asn1/cms/cms.cnf"
1591 guint32 length = 0;
1593 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1594 &length);
1597 if(cap_tree != NULL)
1598 proto_item_append_text(cap_tree, " (%d bits)", length);
1602 return offset;
1607 static int
1608 dissect_cms_RC2WrapParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1609 offset = dissect_cms_RC2ParameterVersion(implicit_tag, tvb, offset, actx, tree, hf_index);
1611 return offset;
1616 static int
1617 dissect_cms_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1618 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1619 NULL);
1621 return offset;
1625 static const ber_sequence_t RC2CBCParameter_sequence[] = {
1626 { &hf_cms_rc2ParameterVersion, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER },
1627 { &hf_cms_iv , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1628 { NULL, 0, 0, 0, NULL }
1631 static int
1632 dissect_cms_RC2CBCParameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1633 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1634 RC2CBCParameter_sequence, hf_index, ett_cms_RC2CBCParameter);
1636 return offset;
1641 static int
1642 dissect_cms_T_capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1643 #line 163 "../../asn1/cms/cms.cnf"
1644 const char *name = NULL;
1646 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
1649 if(object_identifier_id) {
1650 name = oid_resolved_from_string(object_identifier_id);
1651 proto_item_append_text(tree, " %s", name ? name : object_identifier_id);
1652 cap_tree = tree;
1657 return offset;
1662 static int
1663 dissect_cms_T_parameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1664 #line 174 "../../asn1/cms/cms.cnf"
1666 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1670 return offset;
1674 static const ber_sequence_t SMIMECapability_sequence[] = {
1675 { &hf_cms_capability , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_capability },
1676 { &hf_cms_parameters , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_T_parameters },
1677 { NULL, 0, 0, 0, NULL }
1680 static int
1681 dissect_cms_SMIMECapability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1682 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1683 SMIMECapability_sequence, hf_index, ett_cms_SMIMECapability);
1685 return offset;
1689 static const ber_sequence_t SMIMECapabilities_sequence_of[1] = {
1690 { &hf_cms_SMIMECapabilities_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SMIMECapability },
1693 static int
1694 dissect_cms_SMIMECapabilities(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1695 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1696 SMIMECapabilities_sequence_of, hf_index, ett_cms_SMIMECapabilities);
1698 return offset;
1702 static const value_string cms_SMIMEEncryptionKeyPreference_vals[] = {
1703 { 0, "issuerAndSerialNumber" },
1704 { 1, "recipientKeyId" },
1705 { 2, "subjectAltKeyIdentifier" },
1706 { 0, NULL }
1709 static const ber_choice_t SMIMEEncryptionKeyPreference_choice[] = {
1710 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_IssuerAndSerialNumber },
1711 { 1, &hf_cms_recipientKeyId , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_RecipientKeyIdentifier },
1712 { 2, &hf_cms_subjectAltKeyIdentifier, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
1713 { 0, NULL, 0, 0, 0, NULL }
1716 static int
1717 dissect_cms_SMIMEEncryptionKeyPreference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1718 offset = dissect_ber_choice(actx, tree, tvb, offset,
1719 SMIMEEncryptionKeyPreference_choice, hf_index, ett_cms_SMIMEEncryptionKeyPreference,
1720 NULL);
1722 return offset;
1726 static const value_string cms_RC2CBCParameters_vals[] = {
1727 { 0, "rc2WrapParameter" },
1728 { 1, "rc2CBCParameter" },
1729 { 0, NULL }
1732 static const ber_choice_t RC2CBCParameters_choice[] = {
1733 { 0, &hf_cms_rc2WrapParameter, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_RC2WrapParameter },
1734 { 1, &hf_cms_rc2CBCParameter , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RC2CBCParameter },
1735 { 0, NULL, 0, 0, 0, NULL }
1738 static int
1739 dissect_cms_RC2CBCParameters(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1740 offset = dissect_ber_choice(actx, tree, tvb, offset,
1741 RC2CBCParameters_choice, hf_index, ett_cms_RC2CBCParameters,
1742 NULL);
1744 return offset;
1747 /*--- PDUs ---*/
1749 static void dissect_ContentInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1750 asn1_ctx_t asn1_ctx;
1751 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1752 dissect_cms_ContentInfo(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_ContentInfo_PDU);
1754 static void dissect_ContentType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1755 asn1_ctx_t asn1_ctx;
1756 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1757 dissect_cms_ContentType(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_ContentType_PDU);
1759 static void dissect_SignedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1760 asn1_ctx_t asn1_ctx;
1761 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1762 dissect_cms_SignedData(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_SignedData_PDU);
1764 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1765 asn1_ctx_t asn1_ctx;
1766 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1767 dissect_cms_EnvelopedData(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_EnvelopedData_PDU);
1769 static void dissect_DigestedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1770 asn1_ctx_t asn1_ctx;
1771 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1772 dissect_cms_DigestedData(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_DigestedData_PDU);
1774 static void dissect_EncryptedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1775 asn1_ctx_t asn1_ctx;
1776 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1777 dissect_cms_EncryptedData(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_EncryptedData_PDU);
1779 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1780 asn1_ctx_t asn1_ctx;
1781 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1782 dissect_cms_AuthenticatedData(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_AuthenticatedData_PDU);
1784 static void dissect_IssuerAndSerialNumber_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1785 asn1_ctx_t asn1_ctx;
1786 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1787 dissect_cms_IssuerAndSerialNumber(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_IssuerAndSerialNumber_PDU);
1789 static void dissect_MessageDigest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1790 asn1_ctx_t asn1_ctx;
1791 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1792 dissect_cms_MessageDigest(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_MessageDigest_PDU);
1794 static void dissect_SigningTime_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1795 asn1_ctx_t asn1_ctx;
1796 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1797 dissect_cms_SigningTime(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_SigningTime_PDU);
1799 static void dissect_Countersignature_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1800 asn1_ctx_t asn1_ctx;
1801 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1802 dissect_cms_Countersignature(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_Countersignature_PDU);
1804 static void dissect_RC2WrapParameter_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1805 asn1_ctx_t asn1_ctx;
1806 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1807 dissect_cms_RC2WrapParameter(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_RC2WrapParameter_PDU);
1809 static void dissect_SMIMECapabilities_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1810 asn1_ctx_t asn1_ctx;
1811 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1812 dissect_cms_SMIMECapabilities(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_SMIMECapabilities_PDU);
1814 static void dissect_SMIMEEncryptionKeyPreference_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1815 asn1_ctx_t asn1_ctx;
1816 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1817 dissect_cms_SMIMEEncryptionKeyPreference(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_SMIMEEncryptionKeyPreference_PDU);
1819 static void dissect_RC2CBCParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1820 asn1_ctx_t asn1_ctx;
1821 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1822 dissect_cms_RC2CBCParameters(FALSE, tvb, 0, &asn1_ctx, tree, hf_cms_RC2CBCParameters_PDU);
1826 /*--- End of included file: packet-cms-fn.c ---*/
1827 #line 137 "../../asn1/cms/packet-cms-template.c"
1829 /*--- proto_register_cms ----------------------------------------------*/
1830 void proto_register_cms(void) {
1832 /* List of fields */
1833 static hf_register_info hf[] = {
1834 { &hf_cms_ci_contentType,
1835 { "contentType", "cms.contentInfo.contentType",
1836 FT_OID, BASE_NONE, NULL, 0,
1837 NULL, HFILL }},
1839 /*--- Included file: packet-cms-hfarr.c ---*/
1840 #line 1 "../../asn1/cms/packet-cms-hfarr.c"
1841 { &hf_cms_ContentInfo_PDU,
1842 { "ContentInfo", "cms.ContentInfo_element",
1843 FT_NONE, BASE_NONE, NULL, 0,
1844 NULL, HFILL }},
1845 { &hf_cms_ContentType_PDU,
1846 { "ContentType", "cms.ContentType",
1847 FT_OID, BASE_NONE, NULL, 0,
1848 NULL, HFILL }},
1849 { &hf_cms_SignedData_PDU,
1850 { "SignedData", "cms.SignedData_element",
1851 FT_NONE, BASE_NONE, NULL, 0,
1852 NULL, HFILL }},
1853 { &hf_cms_EnvelopedData_PDU,
1854 { "EnvelopedData", "cms.EnvelopedData_element",
1855 FT_NONE, BASE_NONE, NULL, 0,
1856 NULL, HFILL }},
1857 { &hf_cms_DigestedData_PDU,
1858 { "DigestedData", "cms.DigestedData_element",
1859 FT_NONE, BASE_NONE, NULL, 0,
1860 NULL, HFILL }},
1861 { &hf_cms_EncryptedData_PDU,
1862 { "EncryptedData", "cms.EncryptedData_element",
1863 FT_NONE, BASE_NONE, NULL, 0,
1864 NULL, HFILL }},
1865 { &hf_cms_AuthenticatedData_PDU,
1866 { "AuthenticatedData", "cms.AuthenticatedData_element",
1867 FT_NONE, BASE_NONE, NULL, 0,
1868 NULL, HFILL }},
1869 { &hf_cms_IssuerAndSerialNumber_PDU,
1870 { "IssuerAndSerialNumber", "cms.IssuerAndSerialNumber_element",
1871 FT_NONE, BASE_NONE, NULL, 0,
1872 NULL, HFILL }},
1873 { &hf_cms_MessageDigest_PDU,
1874 { "MessageDigest", "cms.MessageDigest",
1875 FT_BYTES, BASE_NONE, NULL, 0,
1876 NULL, HFILL }},
1877 { &hf_cms_SigningTime_PDU,
1878 { "SigningTime", "cms.SigningTime",
1879 FT_UINT32, BASE_DEC, VALS(cms_Time_vals), 0,
1880 NULL, HFILL }},
1881 { &hf_cms_Countersignature_PDU,
1882 { "Countersignature", "cms.Countersignature_element",
1883 FT_NONE, BASE_NONE, NULL, 0,
1884 NULL, HFILL }},
1885 { &hf_cms_RC2WrapParameter_PDU,
1886 { "RC2WrapParameter", "cms.RC2WrapParameter",
1887 FT_INT32, BASE_DEC, NULL, 0,
1888 NULL, HFILL }},
1889 { &hf_cms_SMIMECapabilities_PDU,
1890 { "SMIMECapabilities", "cms.SMIMECapabilities",
1891 FT_UINT32, BASE_DEC, NULL, 0,
1892 NULL, HFILL }},
1893 { &hf_cms_SMIMEEncryptionKeyPreference_PDU,
1894 { "SMIMEEncryptionKeyPreference", "cms.SMIMEEncryptionKeyPreference",
1895 FT_UINT32, BASE_DEC, VALS(cms_SMIMEEncryptionKeyPreference_vals), 0,
1896 NULL, HFILL }},
1897 { &hf_cms_RC2CBCParameters_PDU,
1898 { "RC2CBCParameters", "cms.RC2CBCParameters",
1899 FT_UINT32, BASE_DEC, VALS(cms_RC2CBCParameters_vals), 0,
1900 NULL, HFILL }},
1901 { &hf_cms_contentType,
1902 { "contentType", "cms.contentType",
1903 FT_OID, BASE_NONE, NULL, 0,
1904 NULL, HFILL }},
1905 { &hf_cms_content,
1906 { "content", "cms.content_element",
1907 FT_NONE, BASE_NONE, NULL, 0,
1908 NULL, HFILL }},
1909 { &hf_cms_version,
1910 { "version", "cms.version",
1911 FT_INT32, BASE_DEC, VALS(cms_CMSVersion_vals), 0,
1912 "CMSVersion", HFILL }},
1913 { &hf_cms_digestAlgorithms,
1914 { "digestAlgorithms", "cms.digestAlgorithms",
1915 FT_UINT32, BASE_DEC, NULL, 0,
1916 "DigestAlgorithmIdentifiers", HFILL }},
1917 { &hf_cms_encapContentInfo,
1918 { "encapContentInfo", "cms.encapContentInfo_element",
1919 FT_NONE, BASE_NONE, NULL, 0,
1920 "EncapsulatedContentInfo", HFILL }},
1921 { &hf_cms_certificates,
1922 { "certificates", "cms.certificates",
1923 FT_UINT32, BASE_DEC, NULL, 0,
1924 "CertificateSet", HFILL }},
1925 { &hf_cms_crls,
1926 { "crls", "cms.crls",
1927 FT_UINT32, BASE_DEC, NULL, 0,
1928 "RevocationInfoChoices", HFILL }},
1929 { &hf_cms_signerInfos,
1930 { "signerInfos", "cms.signerInfos",
1931 FT_UINT32, BASE_DEC, NULL, 0,
1932 NULL, HFILL }},
1933 { &hf_cms_DigestAlgorithmIdentifiers_item,
1934 { "DigestAlgorithmIdentifier", "cms.DigestAlgorithmIdentifier_element",
1935 FT_NONE, BASE_NONE, NULL, 0,
1936 NULL, HFILL }},
1937 { &hf_cms_SignerInfos_item,
1938 { "SignerInfo", "cms.SignerInfo_element",
1939 FT_NONE, BASE_NONE, NULL, 0,
1940 NULL, HFILL }},
1941 { &hf_cms_eContentType,
1942 { "eContentType", "cms.eContentType",
1943 FT_OID, BASE_NONE, NULL, 0,
1944 "ContentType", HFILL }},
1945 { &hf_cms_eContent,
1946 { "eContent", "cms.eContent",
1947 FT_BYTES, BASE_NONE, NULL, 0,
1948 NULL, HFILL }},
1949 { &hf_cms_sid,
1950 { "sid", "cms.sid",
1951 FT_UINT32, BASE_DEC, VALS(cms_SignerIdentifier_vals), 0,
1952 "SignerIdentifier", HFILL }},
1953 { &hf_cms_digestAlgorithm,
1954 { "digestAlgorithm", "cms.digestAlgorithm_element",
1955 FT_NONE, BASE_NONE, NULL, 0,
1956 "DigestAlgorithmIdentifier", HFILL }},
1957 { &hf_cms_signedAttrs,
1958 { "signedAttrs", "cms.signedAttrs",
1959 FT_UINT32, BASE_DEC, NULL, 0,
1960 "SignedAttributes", HFILL }},
1961 { &hf_cms_signatureAlgorithm,
1962 { "signatureAlgorithm", "cms.signatureAlgorithm_element",
1963 FT_NONE, BASE_NONE, NULL, 0,
1964 "SignatureAlgorithmIdentifier", HFILL }},
1965 { &hf_cms_signatureValue,
1966 { "signature", "cms.signature",
1967 FT_BYTES, BASE_NONE, NULL, 0,
1968 "SignatureValue", HFILL }},
1969 { &hf_cms_unsignedAttrs,
1970 { "unsignedAttrs", "cms.unsignedAttrs",
1971 FT_UINT32, BASE_DEC, NULL, 0,
1972 "UnsignedAttributes", HFILL }},
1973 { &hf_cms_issuerAndSerialNumber,
1974 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber_element",
1975 FT_NONE, BASE_NONE, NULL, 0,
1976 NULL, HFILL }},
1977 { &hf_cms_subjectKeyIdentifier,
1978 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1979 FT_BYTES, BASE_NONE, NULL, 0,
1980 NULL, HFILL }},
1981 { &hf_cms_SignedAttributes_item,
1982 { "Attribute", "cms.Attribute_element",
1983 FT_NONE, BASE_NONE, NULL, 0,
1984 NULL, HFILL }},
1985 { &hf_cms_UnsignedAttributes_item,
1986 { "Attribute", "cms.Attribute_element",
1987 FT_NONE, BASE_NONE, NULL, 0,
1988 NULL, HFILL }},
1989 { &hf_cms_attrType,
1990 { "attrType", "cms.attrType",
1991 FT_OID, BASE_NONE, NULL, 0,
1992 NULL, HFILL }},
1993 { &hf_cms_attrValues,
1994 { "attrValues", "cms.attrValues",
1995 FT_UINT32, BASE_DEC, NULL, 0,
1996 "SET_OF_AttributeValue", HFILL }},
1997 { &hf_cms_attrValues_item,
1998 { "AttributeValue", "cms.AttributeValue_element",
1999 FT_NONE, BASE_NONE, NULL, 0,
2000 NULL, HFILL }},
2001 { &hf_cms_originatorInfo,
2002 { "originatorInfo", "cms.originatorInfo_element",
2003 FT_NONE, BASE_NONE, NULL, 0,
2004 NULL, HFILL }},
2005 { &hf_cms_recipientInfos,
2006 { "recipientInfos", "cms.recipientInfos",
2007 FT_UINT32, BASE_DEC, NULL, 0,
2008 NULL, HFILL }},
2009 { &hf_cms_encryptedContentInfo,
2010 { "encryptedContentInfo", "cms.encryptedContentInfo_element",
2011 FT_NONE, BASE_NONE, NULL, 0,
2012 NULL, HFILL }},
2013 { &hf_cms_unprotectedAttrs,
2014 { "unprotectedAttrs", "cms.unprotectedAttrs",
2015 FT_UINT32, BASE_DEC, NULL, 0,
2016 "UnprotectedAttributes", HFILL }},
2017 { &hf_cms_certs,
2018 { "certs", "cms.certs",
2019 FT_UINT32, BASE_DEC, NULL, 0,
2020 "CertificateSet", HFILL }},
2021 { &hf_cms_RecipientInfos_item,
2022 { "RecipientInfo", "cms.RecipientInfo",
2023 FT_UINT32, BASE_DEC, VALS(cms_RecipientInfo_vals), 0,
2024 NULL, HFILL }},
2025 { &hf_cms_encryptedContentType,
2026 { "contentType", "cms.contentType",
2027 FT_OID, BASE_NONE, NULL, 0,
2028 NULL, HFILL }},
2029 { &hf_cms_contentEncryptionAlgorithm,
2030 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm_element",
2031 FT_NONE, BASE_NONE, NULL, 0,
2032 "ContentEncryptionAlgorithmIdentifier", HFILL }},
2033 { &hf_cms_encryptedContent,
2034 { "encryptedContent", "cms.encryptedContent",
2035 FT_BYTES, BASE_NONE, NULL, 0,
2036 NULL, HFILL }},
2037 { &hf_cms_UnprotectedAttributes_item,
2038 { "Attribute", "cms.Attribute_element",
2039 FT_NONE, BASE_NONE, NULL, 0,
2040 NULL, HFILL }},
2041 { &hf_cms_ktri,
2042 { "ktri", "cms.ktri_element",
2043 FT_NONE, BASE_NONE, NULL, 0,
2044 "KeyTransRecipientInfo", HFILL }},
2045 { &hf_cms_kari,
2046 { "kari", "cms.kari_element",
2047 FT_NONE, BASE_NONE, NULL, 0,
2048 "KeyAgreeRecipientInfo", HFILL }},
2049 { &hf_cms_kekri,
2050 { "kekri", "cms.kekri_element",
2051 FT_NONE, BASE_NONE, NULL, 0,
2052 "KEKRecipientInfo", HFILL }},
2053 { &hf_cms_pwri,
2054 { "pwri", "cms.pwri_element",
2055 FT_NONE, BASE_NONE, NULL, 0,
2056 "PasswordRecipientInfo", HFILL }},
2057 { &hf_cms_ori,
2058 { "ori", "cms.ori_element",
2059 FT_NONE, BASE_NONE, NULL, 0,
2060 "OtherRecipientInfo", HFILL }},
2061 { &hf_cms_rid,
2062 { "rid", "cms.rid",
2063 FT_UINT32, BASE_DEC, VALS(cms_RecipientIdentifier_vals), 0,
2064 "RecipientIdentifier", HFILL }},
2065 { &hf_cms_keyEncryptionAlgorithm,
2066 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm_element",
2067 FT_NONE, BASE_NONE, NULL, 0,
2068 "KeyEncryptionAlgorithmIdentifier", HFILL }},
2069 { &hf_cms_encryptedKey,
2070 { "encryptedKey", "cms.encryptedKey",
2071 FT_BYTES, BASE_NONE, NULL, 0,
2072 NULL, HFILL }},
2073 { &hf_cms_originator,
2074 { "originator", "cms.originator",
2075 FT_UINT32, BASE_DEC, VALS(cms_OriginatorIdentifierOrKey_vals), 0,
2076 "OriginatorIdentifierOrKey", HFILL }},
2077 { &hf_cms_ukm,
2078 { "ukm", "cms.ukm",
2079 FT_BYTES, BASE_NONE, NULL, 0,
2080 "UserKeyingMaterial", HFILL }},
2081 { &hf_cms_recipientEncryptedKeys,
2082 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
2083 FT_UINT32, BASE_DEC, NULL, 0,
2084 NULL, HFILL }},
2085 { &hf_cms_originatorKey,
2086 { "originatorKey", "cms.originatorKey_element",
2087 FT_NONE, BASE_NONE, NULL, 0,
2088 "OriginatorPublicKey", HFILL }},
2089 { &hf_cms_algorithm,
2090 { "algorithm", "cms.algorithm_element",
2091 FT_NONE, BASE_NONE, NULL, 0,
2092 "AlgorithmIdentifier", HFILL }},
2093 { &hf_cms_publicKey,
2094 { "publicKey", "cms.publicKey",
2095 FT_BYTES, BASE_NONE, NULL, 0,
2096 "BIT_STRING", HFILL }},
2097 { &hf_cms_RecipientEncryptedKeys_item,
2098 { "RecipientEncryptedKey", "cms.RecipientEncryptedKey_element",
2099 FT_NONE, BASE_NONE, NULL, 0,
2100 NULL, HFILL }},
2101 { &hf_cms_rekRid,
2102 { "rid", "cms.rid",
2103 FT_UINT32, BASE_DEC, VALS(cms_KeyAgreeRecipientIdentifier_vals), 0,
2104 "KeyAgreeRecipientIdentifier", HFILL }},
2105 { &hf_cms_rKeyId,
2106 { "rKeyId", "cms.rKeyId_element",
2107 FT_NONE, BASE_NONE, NULL, 0,
2108 "RecipientKeyIdentifier", HFILL }},
2109 { &hf_cms_date,
2110 { "date", "cms.date",
2111 FT_STRING, BASE_NONE, NULL, 0,
2112 "GeneralizedTime", HFILL }},
2113 { &hf_cms_other,
2114 { "other", "cms.other_element",
2115 FT_NONE, BASE_NONE, NULL, 0,
2116 "OtherKeyAttribute", HFILL }},
2117 { &hf_cms_kekid,
2118 { "kekid", "cms.kekid_element",
2119 FT_NONE, BASE_NONE, NULL, 0,
2120 "KEKIdentifier", HFILL }},
2121 { &hf_cms_keyIdentifier,
2122 { "keyIdentifier", "cms.keyIdentifier",
2123 FT_BYTES, BASE_NONE, NULL, 0,
2124 "OCTET_STRING", HFILL }},
2125 { &hf_cms_keyDerivationAlgorithm,
2126 { "keyDerivationAlgorithm", "cms.keyDerivationAlgorithm_element",
2127 FT_NONE, BASE_NONE, NULL, 0,
2128 "KeyDerivationAlgorithmIdentifier", HFILL }},
2129 { &hf_cms_oriType,
2130 { "oriType", "cms.oriType",
2131 FT_OID, BASE_NONE, NULL, 0,
2132 NULL, HFILL }},
2133 { &hf_cms_oriValue,
2134 { "oriValue", "cms.oriValue_element",
2135 FT_NONE, BASE_NONE, NULL, 0,
2136 NULL, HFILL }},
2137 { &hf_cms_digest,
2138 { "digest", "cms.digest",
2139 FT_BYTES, BASE_NONE, NULL, 0,
2140 NULL, HFILL }},
2141 { &hf_cms_macAlgorithm,
2142 { "macAlgorithm", "cms.macAlgorithm_element",
2143 FT_NONE, BASE_NONE, NULL, 0,
2144 "MessageAuthenticationCodeAlgorithm", HFILL }},
2145 { &hf_cms_authAttrs,
2146 { "authAttrs", "cms.authAttrs",
2147 FT_UINT32, BASE_DEC, NULL, 0,
2148 "AuthAttributes", HFILL }},
2149 { &hf_cms_mac,
2150 { "mac", "cms.mac",
2151 FT_BYTES, BASE_NONE, NULL, 0,
2152 "MessageAuthenticationCode", HFILL }},
2153 { &hf_cms_unauthAttrs,
2154 { "unauthAttrs", "cms.unauthAttrs",
2155 FT_UINT32, BASE_DEC, NULL, 0,
2156 "UnauthAttributes", HFILL }},
2157 { &hf_cms_AuthAttributes_item,
2158 { "Attribute", "cms.Attribute_element",
2159 FT_NONE, BASE_NONE, NULL, 0,
2160 NULL, HFILL }},
2161 { &hf_cms_UnauthAttributes_item,
2162 { "Attribute", "cms.Attribute_element",
2163 FT_NONE, BASE_NONE, NULL, 0,
2164 NULL, HFILL }},
2165 { &hf_cms_RevocationInfoChoices_item,
2166 { "RevocationInfoChoice", "cms.RevocationInfoChoice",
2167 FT_UINT32, BASE_DEC, VALS(cms_RevocationInfoChoice_vals), 0,
2168 NULL, HFILL }},
2169 { &hf_cms_crl,
2170 { "crl", "cms.crl_element",
2171 FT_NONE, BASE_NONE, NULL, 0,
2172 "CertificateList", HFILL }},
2173 { &hf_cms_otherRIC,
2174 { "other", "cms.other_element",
2175 FT_NONE, BASE_NONE, NULL, 0,
2176 "OtherRevocationInfoFormat", HFILL }},
2177 { &hf_cms_otherRevInfoFormat,
2178 { "otherRevInfoFormat", "cms.otherRevInfoFormat",
2179 FT_OID, BASE_NONE, NULL, 0,
2180 NULL, HFILL }},
2181 { &hf_cms_otherRevInfo,
2182 { "otherRevInfo", "cms.otherRevInfo_element",
2183 FT_NONE, BASE_NONE, NULL, 0,
2184 NULL, HFILL }},
2185 { &hf_cms_certificate,
2186 { "certificate", "cms.certificate_element",
2187 FT_NONE, BASE_NONE, NULL, 0,
2188 NULL, HFILL }},
2189 { &hf_cms_extendedCertificate,
2190 { "extendedCertificate", "cms.extendedCertificate_element",
2191 FT_NONE, BASE_NONE, NULL, 0,
2192 NULL, HFILL }},
2193 { &hf_cms_v1AttrCert,
2194 { "v1AttrCert", "cms.v1AttrCert_element",
2195 FT_NONE, BASE_NONE, NULL, 0,
2196 "AttributeCertificateV1", HFILL }},
2197 { &hf_cms_v2AttrCert,
2198 { "v2AttrCert", "cms.v2AttrCert_element",
2199 FT_NONE, BASE_NONE, NULL, 0,
2200 "AttributeCertificateV2", HFILL }},
2201 { &hf_cms_CertificateSet_item,
2202 { "CertificateChoices", "cms.CertificateChoices",
2203 FT_UINT32, BASE_DEC, VALS(cms_CertificateChoices_vals), 0,
2204 NULL, HFILL }},
2205 { &hf_cms_issuer,
2206 { "issuer", "cms.issuer",
2207 FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
2208 "Name", HFILL }},
2209 { &hf_cms_serialNumber,
2210 { "serialNumber", "cms.serialNumber",
2211 FT_INT32, BASE_DEC, NULL, 0,
2212 "CertificateSerialNumber", HFILL }},
2213 { &hf_cms_keyAttrId,
2214 { "keyAttrId", "cms.keyAttrId",
2215 FT_OID, BASE_NONE, NULL, 0,
2216 NULL, HFILL }},
2217 { &hf_cms_keyAttr,
2218 { "keyAttr", "cms.keyAttr_element",
2219 FT_NONE, BASE_NONE, NULL, 0,
2220 NULL, HFILL }},
2221 { &hf_cms_utcTime,
2222 { "utcTime", "cms.utcTime",
2223 FT_STRING, BASE_NONE, NULL, 0,
2224 NULL, HFILL }},
2225 { &hf_cms_generalTime,
2226 { "generalTime", "cms.generalTime",
2227 FT_STRING, BASE_NONE, NULL, 0,
2228 "GeneralizedTime", HFILL }},
2229 { &hf_cms_rc2ParameterVersion,
2230 { "rc2ParameterVersion", "cms.rc2ParameterVersion",
2231 FT_INT32, BASE_DEC, NULL, 0,
2232 "INTEGER", HFILL }},
2233 { &hf_cms_iv,
2234 { "iv", "cms.iv",
2235 FT_BYTES, BASE_NONE, NULL, 0,
2236 "OCTET_STRING", HFILL }},
2237 { &hf_cms_extendedCertificateInfo,
2238 { "extendedCertificateInfo", "cms.extendedCertificateInfo_element",
2239 FT_NONE, BASE_NONE, NULL, 0,
2240 NULL, HFILL }},
2241 { &hf_cms_signature,
2242 { "signature", "cms.signature",
2243 FT_BYTES, BASE_NONE, NULL, 0,
2244 NULL, HFILL }},
2245 { &hf_cms_attributes,
2246 { "attributes", "cms.attributes",
2247 FT_UINT32, BASE_DEC, NULL, 0,
2248 "UnauthAttributes", HFILL }},
2249 { &hf_cms_SMIMECapabilities_item,
2250 { "SMIMECapability", "cms.SMIMECapability_element",
2251 FT_NONE, BASE_NONE, NULL, 0,
2252 NULL, HFILL }},
2253 { &hf_cms_capability,
2254 { "capability", "cms.capability",
2255 FT_OID, BASE_NONE, NULL, 0,
2256 NULL, HFILL }},
2257 { &hf_cms_parameters,
2258 { "parameters", "cms.parameters_element",
2259 FT_NONE, BASE_NONE, NULL, 0,
2260 NULL, HFILL }},
2261 { &hf_cms_recipientKeyId,
2262 { "recipientKeyId", "cms.recipientKeyId_element",
2263 FT_NONE, BASE_NONE, NULL, 0,
2264 "RecipientKeyIdentifier", HFILL }},
2265 { &hf_cms_subjectAltKeyIdentifier,
2266 { "subjectAltKeyIdentifier", "cms.subjectAltKeyIdentifier",
2267 FT_BYTES, BASE_NONE, NULL, 0,
2268 "SubjectKeyIdentifier", HFILL }},
2269 { &hf_cms_rc2WrapParameter,
2270 { "rc2WrapParameter", "cms.rc2WrapParameter",
2271 FT_INT32, BASE_DEC, NULL, 0,
2272 NULL, HFILL }},
2273 { &hf_cms_rc2CBCParameter,
2274 { "rc2CBCParameter", "cms.rc2CBCParameter_element",
2275 FT_NONE, BASE_NONE, NULL, 0,
2276 NULL, HFILL }},
2277 { &hf_cms_acInfo,
2278 { "acInfo", "cms.acInfo_element",
2279 FT_NONE, BASE_NONE, NULL, 0,
2280 "AttributeCertificateInfoV1", HFILL }},
2281 { &hf_cms_signatureAlgorithm_v1,
2282 { "signatureAlgorithm", "cms.signatureAlgorithm_element",
2283 FT_NONE, BASE_NONE, NULL, 0,
2284 "AlgorithmIdentifier", HFILL }},
2285 { &hf_cms_signatureValue_v1,
2286 { "signature", "cms.signature",
2287 FT_BYTES, BASE_NONE, NULL, 0,
2288 "BIT_STRING", HFILL }},
2289 { &hf_cms_version_v1,
2290 { "version", "cms.version",
2291 FT_INT32, BASE_DEC, VALS(cms_AttCertVersionV1_vals), 0,
2292 "AttCertVersionV1", HFILL }},
2293 { &hf_cms_subject,
2294 { "subject", "cms.subject",
2295 FT_UINT32, BASE_DEC, VALS(cms_T_subject_vals), 0,
2296 NULL, HFILL }},
2297 { &hf_cms_baseCertificateID,
2298 { "baseCertificateID", "cms.baseCertificateID_element",
2299 FT_NONE, BASE_NONE, NULL, 0,
2300 "IssuerSerial", HFILL }},
2301 { &hf_cms_subjectName,
2302 { "subjectName", "cms.subjectName",
2303 FT_UINT32, BASE_DEC, NULL, 0,
2304 "GeneralNames", HFILL }},
2305 { &hf_cms_issuer_v1,
2306 { "issuer", "cms.issuer",
2307 FT_UINT32, BASE_DEC, NULL, 0,
2308 "GeneralNames", HFILL }},
2309 { &hf_cms_signature_v1,
2310 { "signature", "cms.signature_element",
2311 FT_NONE, BASE_NONE, NULL, 0,
2312 "AlgorithmIdentifier", HFILL }},
2313 { &hf_cms_attCertValidityPeriod,
2314 { "attCertValidityPeriod", "cms.attCertValidityPeriod_element",
2315 FT_NONE, BASE_NONE, NULL, 0,
2316 NULL, HFILL }},
2317 { &hf_cms_attributes_v1,
2318 { "attributes", "cms.attributes",
2319 FT_UINT32, BASE_DEC, NULL, 0,
2320 "SEQUENCE_OF_Attribute", HFILL }},
2321 { &hf_cms_attributes_v1_item,
2322 { "Attribute", "cms.Attribute_element",
2323 FT_NONE, BASE_NONE, NULL, 0,
2324 NULL, HFILL }},
2325 { &hf_cms_issuerUniqueID,
2326 { "issuerUniqueID", "cms.issuerUniqueID",
2327 FT_BYTES, BASE_NONE, NULL, 0,
2328 "UniqueIdentifier", HFILL }},
2329 { &hf_cms_extensions,
2330 { "extensions", "cms.extensions",
2331 FT_UINT32, BASE_DEC, NULL, 0,
2332 NULL, HFILL }},
2334 /*--- End of included file: packet-cms-hfarr.c ---*/
2335 #line 148 "../../asn1/cms/packet-cms-template.c"
2338 /* List of subtrees */
2339 static gint *ett[] = {
2341 /*--- Included file: packet-cms-ettarr.c ---*/
2342 #line 1 "../../asn1/cms/packet-cms-ettarr.c"
2343 &ett_cms_ContentInfo,
2344 &ett_cms_SignedData,
2345 &ett_cms_DigestAlgorithmIdentifiers,
2346 &ett_cms_SignerInfos,
2347 &ett_cms_EncapsulatedContentInfo,
2348 &ett_cms_SignerInfo,
2349 &ett_cms_SignerIdentifier,
2350 &ett_cms_SignedAttributes,
2351 &ett_cms_UnsignedAttributes,
2352 &ett_cms_Attribute,
2353 &ett_cms_SET_OF_AttributeValue,
2354 &ett_cms_EnvelopedData,
2355 &ett_cms_OriginatorInfo,
2356 &ett_cms_RecipientInfos,
2357 &ett_cms_EncryptedContentInfo,
2358 &ett_cms_UnprotectedAttributes,
2359 &ett_cms_RecipientInfo,
2360 &ett_cms_KeyTransRecipientInfo,
2361 &ett_cms_RecipientIdentifier,
2362 &ett_cms_KeyAgreeRecipientInfo,
2363 &ett_cms_OriginatorIdentifierOrKey,
2364 &ett_cms_OriginatorPublicKey,
2365 &ett_cms_RecipientEncryptedKeys,
2366 &ett_cms_RecipientEncryptedKey,
2367 &ett_cms_KeyAgreeRecipientIdentifier,
2368 &ett_cms_RecipientKeyIdentifier,
2369 &ett_cms_KEKRecipientInfo,
2370 &ett_cms_KEKIdentifier,
2371 &ett_cms_PasswordRecipientInfo,
2372 &ett_cms_OtherRecipientInfo,
2373 &ett_cms_DigestedData,
2374 &ett_cms_EncryptedData,
2375 &ett_cms_AuthenticatedData,
2376 &ett_cms_AuthAttributes,
2377 &ett_cms_UnauthAttributes,
2378 &ett_cms_RevocationInfoChoices,
2379 &ett_cms_RevocationInfoChoice,
2380 &ett_cms_OtherRevocationInfoFormat,
2381 &ett_cms_CertificateChoices,
2382 &ett_cms_CertificateSet,
2383 &ett_cms_IssuerAndSerialNumber,
2384 &ett_cms_OtherKeyAttribute,
2385 &ett_cms_Time,
2386 &ett_cms_RC2CBCParameter,
2387 &ett_cms_ExtendedCertificate,
2388 &ett_cms_ExtendedCertificateInfo,
2389 &ett_cms_SMIMECapabilities,
2390 &ett_cms_SMIMECapability,
2391 &ett_cms_SMIMEEncryptionKeyPreference,
2392 &ett_cms_RC2CBCParameters,
2393 &ett_cms_AttributeCertificateV1,
2394 &ett_cms_AttributeCertificateInfoV1,
2395 &ett_cms_T_subject,
2396 &ett_cms_SEQUENCE_OF_Attribute,
2398 /*--- End of included file: packet-cms-ettarr.c ---*/
2399 #line 153 "../../asn1/cms/packet-cms-template.c"
2402 /* Register protocol */
2403 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
2405 /* Register fields and subtrees */
2406 proto_register_field_array(proto_cms, hf, array_length(hf));
2407 proto_register_subtree_array(ett, array_length(ett));
2409 register_ber_syntax_dissector("ContentInfo", proto_cms, dissect_ContentInfo_PDU);
2410 register_ber_syntax_dissector("SignedData", proto_cms, dissect_SignedData_PDU);
2411 register_ber_oid_syntax(".p7s", NULL, "ContentInfo");
2412 register_ber_oid_syntax(".p7m", NULL, "ContentInfo");
2413 register_ber_oid_syntax(".p7c", NULL, "ContentInfo");
2419 /*--- proto_reg_handoff_cms -------------------------------------------*/
2420 void proto_reg_handoff_cms(void) {
2422 /*--- Included file: packet-cms-dis-tab.c ---*/
2423 #line 1 "../../asn1/cms/packet-cms-dis-tab.c"
2424 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.6", dissect_ContentInfo_PDU, proto_cms, "id-ct-contentInfo");
2425 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
2426 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
2427 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
2428 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
2429 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
2430 register_ber_oid_dissector("1.2.840.113549.1.9.3", dissect_ContentType_PDU, proto_cms, "id-contentType");
2431 register_ber_oid_dissector("1.2.840.113549.1.9.4", dissect_MessageDigest_PDU, proto_cms, "id-messageDigest");
2432 register_ber_oid_dissector("1.2.840.113549.1.9.5", dissect_SigningTime_PDU, proto_cms, "id-signingTime");
2433 register_ber_oid_dissector("1.2.840.113549.1.9.6", dissect_Countersignature_PDU, proto_cms, "id-counterSignature");
2434 register_ber_oid_dissector("2.6.1.4.18", dissect_ContentInfo_PDU, proto_cms, "id-et-pkcs7");
2435 register_ber_oid_dissector("1.3.6.1.4.1.311.16.4", dissect_IssuerAndSerialNumber_PDU, proto_cms, "ms-oe-encryption-key-preference");
2436 register_ber_oid_dissector("1.2.840.113549.1.9.15", dissect_SMIMECapabilities_PDU, proto_cms, "id-smime-capabilities");
2437 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.11", dissect_SMIMEEncryptionKeyPreference_PDU, proto_cms, "id-encryption-key-preference");
2438 register_ber_oid_dissector("1.2.840.113549.3.2", dissect_RC2CBCParameters_PDU, proto_cms, "id-alg-rc2-cbc");
2439 register_ber_oid_dissector("1.2.840.113549.3.4", dissect_RC2CBCParameters_PDU, proto_cms, "id-alg-rc4");
2440 register_ber_oid_dissector("1.2.840.113549.1.9.16.3.7", dissect_RC2WrapParameter_PDU, proto_cms, "id-alg-cmsrc2-wrap");
2441 register_ber_oid_dissector("2.16.840.1.113730.3.1.40", dissect_SignedData_PDU, proto_cms, "userSMIMECertificate");
2444 /*--- End of included file: packet-cms-dis-tab.c ---*/
2445 #line 175 "../../asn1/cms/packet-cms-template.c"
2447 oid_add_from_string("id-data","1.2.840.113549.1.7.1");
2448 oid_add_from_string("id-alg-des-ede3-cbc","1.2.840.113549.3.7");
2449 oid_add_from_string("id-alg-des-cbc","1.3.14.3.2.7");