1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler */
4 /* ../../tools/asn2eth.py -e -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */
6 /* Input file: packet-cms-template.c */
9 * Routines for RFC2630 Cryptographic Message Syntax packet dissection
11 * $Id: packet-cms-template.c 12434 2004-10-29 12:11:42Z sahlberg $
13 * Ethereal - Network traffic analyzer
14 * By Gerald Combs <gerald@ethereal.com>
15 * Copyright 1998 Gerald Combs
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
37 #include <epan/packet.h>
38 #include <epan/conversation.h>
43 #include "packet-ber.h"
44 #include "packet-cms.h"
45 #include "packet-x509af.h"
46 #include "packet-x509if.h"
48 #define PNAME "Cryptographic Message Syntax"
52 /* Initialize the protocol and registered fields */
54 static int hf_cms_ci_contentType = -1;
56 /*--- Included file: packet-cms-hf.c ---*/
58 static int hf_cms_SignedData_PDU = -1; /* SignedData */
59 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
60 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
61 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
62 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
63 static int hf_cms_contentType = -1; /* T_contentType */
64 static int hf_cms_content = -1; /* T_content */
65 static int hf_cms_version = -1; /* CMSVersion */
66 static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
67 static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
68 static int hf_cms_certificates = -1; /* CertificateSet */
69 static int hf_cms_crls = -1; /* CertificateRevocationLists */
70 static int hf_cms_signerInfos = -1; /* SignerInfos */
71 static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
72 static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
73 static int hf_cms_eContentType = -1; /* T_eContentType */
74 static int hf_cms_eContent = -1; /* T_eContent */
75 static int hf_cms_sid = -1; /* SignerIdentifier */
76 static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
77 static int hf_cms_signedAttrs = -1; /* SignedAttributes */
78 static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
79 static int hf_cms_signatureValue = -1; /* SignatureValue */
80 static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
81 static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
82 static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
83 static int hf_cms_SignedAttributes_item = -1; /* Attribute */
84 static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
85 static int hf_cms_attrType = -1; /* OBJECT_IDENTIFIER */
86 static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
87 static int hf_cms_recipientInfos = -1; /* RecipientInfos */
88 static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
89 static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
90 static int hf_cms_certs = -1; /* CertificateSet */
91 static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
92 static int hf_cms_contentType1 = -1; /* ContentType */
93 static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
94 static int hf_cms_encryptedContent = -1; /* EncryptedContent */
95 static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
96 static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
97 static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
98 static int hf_cms_kekri = -1; /* KEKRecipientInfo */
99 static int hf_cms_rid = -1; /* RecipientIdentifier */
100 static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
101 static int hf_cms_encryptedKey = -1; /* EncryptedKey */
102 static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
103 static int hf_cms_ukm = -1; /* UserKeyingMaterial */
104 static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
105 static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
106 static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
107 static int hf_cms_publicKey = -1; /* BIT_STRING */
108 static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
109 static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
110 static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
111 static int hf_cms_date = -1; /* GeneralizedTime */
112 static int hf_cms_other = -1; /* OtherKeyAttribute */
113 static int hf_cms_kekid = -1; /* KEKIdentifier */
114 static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
115 static int hf_cms_digest = -1; /* Digest */
116 static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
117 static int hf_cms_authenticatedAttributes = -1; /* AuthAttributes */
118 static int hf_cms_mac = -1; /* MessageAuthenticationCode */
119 static int hf_cms_unauthenticatedAttributes = -1; /* UnauthAttributes */
120 static int hf_cms_AuthAttributes_item = -1; /* Attribute */
121 static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
122 static int hf_cms_CertificateRevocationLists_item = -1; /* CertificateList */
123 static int hf_cms_certificate = -1; /* Certificate */
124 static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
125 static int hf_cms_attrCert = -1; /* AttributeCertificate */
126 static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
127 static int hf_cms_issuer = -1; /* Name */
128 static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
129 static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
130 static int hf_cms_keyAttr = -1; /* T_keyAttr */
131 static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
132 static int hf_cms_signature = -1; /* Signature */
133 static int hf_cms_attributes = -1; /* UnauthAttributes */
135 /*--- End of included file: packet-cms-hf.c ---*/
138 /* Initialize the subtree pointers */
140 /*--- Included file: packet-cms-ett.c ---*/
142 static gint ett_cms_ContentInfo = -1;
143 static gint ett_cms_SignedData = -1;
144 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
145 static gint ett_cms_SignerInfos = -1;
146 static gint ett_cms_EncapsulatedContentInfo = -1;
147 static gint ett_cms_SignerInfo = -1;
148 static gint ett_cms_SignerIdentifier = -1;
149 static gint ett_cms_SignedAttributes = -1;
150 static gint ett_cms_UnsignedAttributes = -1;
151 static gint ett_cms_Attribute = -1;
152 static gint ett_cms_EnvelopedData = -1;
153 static gint ett_cms_OriginatorInfo = -1;
154 static gint ett_cms_RecipientInfos = -1;
155 static gint ett_cms_EncryptedContentInfo = -1;
156 static gint ett_cms_UnprotectedAttributes = -1;
157 static gint ett_cms_RecipientInfo = -1;
158 static gint ett_cms_KeyTransRecipientInfo = -1;
159 static gint ett_cms_RecipientIdentifier = -1;
160 static gint ett_cms_KeyAgreeRecipientInfo = -1;
161 static gint ett_cms_OriginatorIdentifierOrKey = -1;
162 static gint ett_cms_OriginatorPublicKey = -1;
163 static gint ett_cms_RecipientEncryptedKeys = -1;
164 static gint ett_cms_RecipientEncryptedKey = -1;
165 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
166 static gint ett_cms_RecipientKeyIdentifier = -1;
167 static gint ett_cms_KEKRecipientInfo = -1;
168 static gint ett_cms_KEKIdentifier = -1;
169 static gint ett_cms_DigestedData = -1;
170 static gint ett_cms_EncryptedData = -1;
171 static gint ett_cms_AuthenticatedData = -1;
172 static gint ett_cms_AuthAttributes = -1;
173 static gint ett_cms_UnauthAttributes = -1;
174 static gint ett_cms_CertificateRevocationLists = -1;
175 static gint ett_cms_CertificateChoices = -1;
176 static gint ett_cms_CertificateSet = -1;
177 static gint ett_cms_IssuerAndSerialNumber = -1;
178 static gint ett_cms_OtherKeyAttribute = -1;
179 static gint ett_cms_ExtendedCertificate = -1;
180 static gint ett_cms_ExtendedCertificateInfo = -1;
182 /*--- End of included file: packet-cms-ett.c ---*/
185 static char object_identifier_id[64]; /*64 chars should be long enough? */
188 /*--- Included file: packet-cms-fn.c ---*/
190 /*--- Fields for imported types ---*/
192 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
193 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm);
195 static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
196 return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item);
198 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
199 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate);
201 static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
202 return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert);
204 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
205 return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_cms_issuer);
207 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
208 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber);
213 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
214 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
219 static int dissect_contentType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
220 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType1);
225 dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
226 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
227 hf_cms_ci_contentType, object_identifier_id);
232 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
233 return dissect_cms_T_contentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType);
239 dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
240 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
245 static int dissect_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
246 return dissect_cms_T_content(FALSE, tvb, offset, pinfo, tree, hf_cms_content);
249 static const ber_sequence ContentInfo_sequence[] = {
250 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
251 { BER_CLASS_CON, 0, 0, dissect_content },
256 dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
257 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
258 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
264 static const value_string CMSVersion_vals[] = {
275 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
276 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
280 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
281 return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version);
286 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
287 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
291 static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
292 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item);
294 static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
295 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
297 static int dissect_digestAlgorithm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
298 return dissect_cms_DigestAlgorithmIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
301 static const ber_sequence DigestAlgorithmIdentifiers_set_of[1] = {
302 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item },
306 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
307 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
308 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
312 static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
313 return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms);
318 dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
319 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
320 hf_cms_ci_contentType, object_identifier_id);
325 static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
326 return dissect_cms_T_eContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
331 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
335 int pdu_offset = offset;
337 /* XXX Do we care about printing out the octet string? */
338 offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
340 pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
341 pdu_offset = get_ber_length(tvb, pdu_offset, &len, &ind);
342 pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, tree);
347 static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
348 return dissect_cms_T_eContent(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
351 static const ber_sequence EncapsulatedContentInfo_sequence[] = {
352 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType },
353 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent },
358 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
359 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
360 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
364 static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
365 return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
370 dissect_cms_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
371 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
376 static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
377 return dissect_cms_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType);
380 static const ber_sequence Attribute_sequence[] = {
381 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType },
386 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
387 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
388 Attribute_sequence, hf_index, ett_cms_Attribute);
392 static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
393 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item);
395 static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
396 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item);
398 static int dissect_UnprotectedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
399 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnprotectedAttributes_item);
401 static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
402 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item);
404 static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
405 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item);
408 static const ber_sequence UnauthAttributes_set_of[1] = {
409 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item },
413 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
414 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
415 UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
419 static int dissect_unauthenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
420 return dissect_cms_UnauthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unauthenticatedAttributes);
422 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
423 return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes);
426 static const ber_sequence ExtendedCertificateInfo_sequence[] = {
427 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
428 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
429 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes },
434 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
435 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
436 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
440 static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
441 return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo);
446 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
447 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
451 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
452 return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm);
457 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
458 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
464 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
465 return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature);
468 static const ber_sequence ExtendedCertificate_sequence[] = {
469 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo },
470 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
471 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
476 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
477 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
478 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
482 static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
483 return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate);
487 static const value_string CertificateChoices_vals[] = {
488 { 0, "certificate" },
489 { 1, "extendedCertificate" },
494 static const ber_choice CertificateChoices_choice[] = {
495 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
496 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl },
497 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl },
502 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
503 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
504 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices);
508 static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
509 return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item);
512 static const ber_sequence CertificateSet_set_of[1] = {
513 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item },
517 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
518 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
519 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
523 static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
524 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates);
526 static int dissect_certs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
527 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certs);
530 static const ber_sequence CertificateRevocationLists_set_of[1] = {
531 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item },
535 dissect_cms_CertificateRevocationLists(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
536 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
537 CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists);
541 static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
542 return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls);
545 static const ber_sequence IssuerAndSerialNumber_sequence[] = {
546 { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
547 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
552 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
553 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
554 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
558 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
559 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber);
564 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
565 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
570 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
571 return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
573 static int dissect_subjectKeyIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
574 return dissect_cms_SubjectKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
578 static const value_string SignerIdentifier_vals[] = {
579 { 0, "issuerAndSerialNumber" },
580 { 1, "subjectKeyIdentifier" },
584 static const ber_choice SignerIdentifier_choice[] = {
585 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
586 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
591 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
592 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
593 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier);
597 static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
598 return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid);
601 static const ber_sequence SignedAttributes_set_of[1] = {
602 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item },
606 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
607 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
608 SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
612 static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
613 return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs);
618 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
619 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
624 static int dissect_signatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
625 return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureValue);
628 static const ber_sequence UnsignedAttributes_set_of[1] = {
629 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item },
633 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
634 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
635 UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
639 static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
640 return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs);
643 static const ber_sequence SignerInfo_sequence[] = {
644 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
645 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid },
646 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
647 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl },
648 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
649 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signatureValue },
650 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl },
655 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
656 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
657 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
661 static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
662 return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item);
665 static const ber_sequence SignerInfos_set_of[1] = {
666 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item },
670 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
671 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
672 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
676 static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
677 return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos);
680 static const ber_sequence SignedData_sequence[] = {
681 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
682 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms },
683 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
684 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl },
685 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
686 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos },
691 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
692 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
693 SignedData_sequence, hf_index, ett_cms_SignedData);
698 static const ber_sequence OriginatorInfo_sequence[] = {
699 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certs_impl },
700 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
705 dissect_cms_OriginatorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
706 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
707 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
711 static int dissect_originatorInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
712 return dissect_cms_OriginatorInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorInfo);
716 static const value_string RecipientIdentifier_vals[] = {
717 { 0, "issuerAndSerialNumber" },
718 { 1, "subjectKeyIdentifier" },
722 static const ber_choice RecipientIdentifier_choice[] = {
723 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
724 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
729 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
730 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
731 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier);
735 static int dissect_rid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
736 return dissect_cms_RecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rid);
741 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
742 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
746 static int dissect_keyEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
747 return dissect_cms_KeyEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_keyEncryptionAlgorithm);
752 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
753 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
758 static int dissect_encryptedKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
759 return dissect_cms_EncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedKey);
762 static const ber_sequence KeyTransRecipientInfo_sequence[] = {
763 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
764 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rid },
765 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
766 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
771 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
772 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
773 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
777 static int dissect_ktri(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
778 return dissect_cms_KeyTransRecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_ktri);
783 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
784 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
790 static int dissect_publicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
791 return dissect_cms_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_publicKey);
794 static const ber_sequence OriginatorPublicKey_sequence[] = {
795 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
796 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_publicKey },
801 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
802 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
803 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
807 static int dissect_originatorKey_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
808 return dissect_cms_OriginatorPublicKey(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorKey);
812 static const value_string OriginatorIdentifierOrKey_vals[] = {
813 { 0, "issuerAndSerialNumber" },
814 { 1, "subjectKeyIdentifier" },
815 { 2, "originatorKey" },
819 static const ber_choice OriginatorIdentifierOrKey_choice[] = {
820 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
821 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
822 { 2, BER_CLASS_CON, 1, 0, dissect_originatorKey_impl },
827 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
828 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
829 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey);
833 static int dissect_originator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
834 return dissect_cms_OriginatorIdentifierOrKey(FALSE, tvb, offset, pinfo, tree, hf_cms_originator);
839 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
840 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
845 static int dissect_ukm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
846 return dissect_cms_UserKeyingMaterial(FALSE, tvb, offset, pinfo, tree, hf_cms_ukm);
851 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
852 offset = dissect_ber_generalized_time(pinfo, tree, tvb, offset, hf_index);
856 static int dissect_date(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
857 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_date);
862 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
863 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
864 hf_cms_ci_contentType, object_identifier_id);
869 static int dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
870 return dissect_cms_T_keyAttrId(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttrId);
876 dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
877 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
882 static int dissect_keyAttr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
883 return dissect_cms_T_keyAttr(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttr);
886 static const ber_sequence OtherKeyAttribute_sequence[] = {
887 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId },
888 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_keyAttr },
893 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
894 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
895 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
899 static int dissect_other(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
900 return dissect_cms_OtherKeyAttribute(FALSE, tvb, offset, pinfo, tree, hf_cms_other);
903 static const ber_sequence RecipientKeyIdentifier_sequence[] = {
904 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
905 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
906 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
911 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
912 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
913 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
917 static int dissect_rKeyId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
918 return dissect_cms_RecipientKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_rKeyId);
922 static const value_string KeyAgreeRecipientIdentifier_vals[] = {
923 { 0, "issuerAndSerialNumber" },
928 static const ber_choice KeyAgreeRecipientIdentifier_choice[] = {
929 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
930 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_rKeyId_impl },
935 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
936 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
937 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier);
941 static int dissect_rekRid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
942 return dissect_cms_KeyAgreeRecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rekRid);
945 static const ber_sequence RecipientEncryptedKey_sequence[] = {
946 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rekRid },
947 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
952 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
953 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
954 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
958 static int dissect_RecipientEncryptedKeys_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
959 return dissect_cms_RecipientEncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientEncryptedKeys_item);
962 static const ber_sequence RecipientEncryptedKeys_sequence_of[1] = {
963 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RecipientEncryptedKeys_item },
967 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
968 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
969 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
973 static int dissect_recipientEncryptedKeys(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
974 return dissect_cms_RecipientEncryptedKeys(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientEncryptedKeys);
977 static const ber_sequence KeyAgreeRecipientInfo_sequence[] = {
978 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
979 { BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_originator },
980 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ukm },
981 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
982 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_recipientEncryptedKeys },
987 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
988 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
989 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
993 static int dissect_kari_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
994 return dissect_cms_KeyAgreeRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kari);
999 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1000 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1005 static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1006 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
1009 static const ber_sequence KEKIdentifier_sequence[] = {
1010 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_keyIdentifier },
1011 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1012 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1017 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1018 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1019 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1023 static int dissect_kekid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1024 return dissect_cms_KEKIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_kekid);
1027 static const ber_sequence KEKRecipientInfo_sequence[] = {
1028 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1029 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_kekid },
1030 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1031 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1036 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1037 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1038 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1042 static int dissect_kekri_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1043 return dissect_cms_KEKRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kekri);
1047 static const value_string RecipientInfo_vals[] = {
1054 static const ber_choice RecipientInfo_choice[] = {
1055 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ktri },
1056 { 1, BER_CLASS_CON, 1, 0, dissect_kari_impl },
1057 { 2, BER_CLASS_CON, 2, 0, dissect_kekri_impl },
1058 { 0, 0, 0, 0, NULL }
1062 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1063 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1064 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo);
1068 static int dissect_RecipientInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1069 return dissect_cms_RecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientInfos_item);
1072 static const ber_sequence RecipientInfos_set_of[1] = {
1073 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_RecipientInfos_item },
1077 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1078 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1079 RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1083 static int dissect_recipientInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1084 return dissect_cms_RecipientInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientInfos);
1089 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1090 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1094 static int dissect_contentEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1095 return dissect_cms_ContentEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_contentEncryptionAlgorithm);
1100 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1101 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1106 static int dissect_encryptedContent_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1107 return dissect_cms_EncryptedContent(TRUE, tvb, offset, pinfo, tree, hf_cms_encryptedContent);
1110 static const ber_sequence EncryptedContentInfo_sequence[] = {
1111 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType1 },
1112 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_contentEncryptionAlgorithm },
1113 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_encryptedContent_impl },
1118 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1119 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1120 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1124 static int dissect_encryptedContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1125 return dissect_cms_EncryptedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentInfo);
1128 static const ber_sequence UnprotectedAttributes_set_of[1] = {
1129 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnprotectedAttributes_item },
1133 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1134 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1135 UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1139 static int dissect_unprotectedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1140 return dissect_cms_UnprotectedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unprotectedAttrs);
1143 static const ber_sequence EnvelopedData_sequence[] = {
1144 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1145 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1146 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1147 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1148 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1153 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1154 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1155 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1162 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1163 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1168 static int dissect_digest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1169 return dissect_cms_Digest(FALSE, tvb, offset, pinfo, tree, hf_cms_digest);
1172 static const ber_sequence DigestedData_sequence[] = {
1173 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1174 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
1175 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1176 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_digest },
1181 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1182 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1183 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1188 static const ber_sequence EncryptedData_sequence[] = {
1189 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1190 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1191 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1196 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1197 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1198 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1205 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1206 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1210 static int dissect_macAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1211 return dissect_cms_MessageAuthenticationCodeAlgorithm(FALSE, tvb, offset, pinfo, tree, hf_cms_macAlgorithm);
1214 static const ber_sequence AuthAttributes_set_of[1] = {
1215 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item },
1219 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1220 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1221 AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1225 static int dissect_authenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1226 return dissect_cms_AuthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_authenticatedAttributes);
1231 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1232 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1237 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1238 return dissect_cms_MessageAuthenticationCode(FALSE, tvb, offset, pinfo, tree, hf_cms_mac);
1241 static const ber_sequence AuthenticatedData_sequence[] = {
1242 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1243 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1244 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1245 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_macAlgorithm },
1246 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_digestAlgorithm_impl },
1247 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1248 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_authenticatedAttributes_impl },
1249 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mac },
1250 { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unauthenticatedAttributes_impl },
1255 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1256 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1257 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1264 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1265 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1272 static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1273 dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
1275 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1276 dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
1278 static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1279 dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
1281 static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1282 dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
1284 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1285 dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
1289 /*--- End of included file: packet-cms-fn.c ---*/
1293 /*--- proto_register_cms ----------------------------------------------*/
1294 void proto_register_cms(void) {
1296 /* List of fields */
1297 static hf_register_info hf[] = {
1298 { &hf_cms_ci_contentType,
1299 { "contentType", "cms.contentInfo.contentType",
1300 FT_STRING, BASE_NONE, NULL, 0,
1301 "ContentType", HFILL }},
1303 /*--- Included file: packet-cms-hfarr.c ---*/
1305 { &hf_cms_SignedData_PDU,
1306 { "SignedData", "cms.SignedData",
1307 FT_NONE, BASE_NONE, NULL, 0,
1308 "SignedData", HFILL }},
1309 { &hf_cms_EnvelopedData_PDU,
1310 { "EnvelopedData", "cms.EnvelopedData",
1311 FT_NONE, BASE_NONE, NULL, 0,
1312 "EnvelopedData", HFILL }},
1313 { &hf_cms_DigestedData_PDU,
1314 { "DigestedData", "cms.DigestedData",
1315 FT_NONE, BASE_NONE, NULL, 0,
1316 "DigestedData", HFILL }},
1317 { &hf_cms_EncryptedData_PDU,
1318 { "EncryptedData", "cms.EncryptedData",
1319 FT_NONE, BASE_NONE, NULL, 0,
1320 "EncryptedData", HFILL }},
1321 { &hf_cms_AuthenticatedData_PDU,
1322 { "AuthenticatedData", "cms.AuthenticatedData",
1323 FT_NONE, BASE_NONE, NULL, 0,
1324 "AuthenticatedData", HFILL }},
1325 { &hf_cms_contentType,
1326 { "contentType", "cms.contentType",
1327 FT_STRING, BASE_NONE, NULL, 0,
1328 "ContentInfo/contentType", HFILL }},
1330 { "content", "cms.content",
1331 FT_NONE, BASE_NONE, NULL, 0,
1332 "ContentInfo/content", HFILL }},
1334 { "version", "cms.version",
1335 FT_INT32, BASE_DEC, VALS(CMSVersion_vals), 0,
1337 { &hf_cms_digestAlgorithms,
1338 { "digestAlgorithms", "cms.digestAlgorithms",
1339 FT_UINT32, BASE_DEC, NULL, 0,
1340 "SignedData/digestAlgorithms", HFILL }},
1341 { &hf_cms_encapContentInfo,
1342 { "encapContentInfo", "cms.encapContentInfo",
1343 FT_NONE, BASE_NONE, NULL, 0,
1345 { &hf_cms_certificates,
1346 { "certificates", "cms.certificates",
1347 FT_UINT32, BASE_DEC, NULL, 0,
1348 "SignedData/certificates", HFILL }},
1350 { "crls", "cms.crls",
1351 FT_UINT32, BASE_DEC, NULL, 0,
1353 { &hf_cms_signerInfos,
1354 { "signerInfos", "cms.signerInfos",
1355 FT_UINT32, BASE_DEC, NULL, 0,
1356 "SignedData/signerInfos", HFILL }},
1357 { &hf_cms_DigestAlgorithmIdentifiers_item,
1358 { "Item", "cms.DigestAlgorithmIdentifiers_item",
1359 FT_NONE, BASE_NONE, NULL, 0,
1360 "DigestAlgorithmIdentifiers/_item", HFILL }},
1361 { &hf_cms_SignerInfos_item,
1362 { "Item", "cms.SignerInfos_item",
1363 FT_NONE, BASE_NONE, NULL, 0,
1364 "SignerInfos/_item", HFILL }},
1365 { &hf_cms_eContentType,
1366 { "eContentType", "cms.eContentType",
1367 FT_STRING, BASE_NONE, NULL, 0,
1368 "EncapsulatedContentInfo/eContentType", HFILL }},
1370 { "eContent", "cms.eContent",
1371 FT_BYTES, BASE_HEX, NULL, 0,
1372 "EncapsulatedContentInfo/eContent", HFILL }},
1375 FT_UINT32, BASE_DEC, VALS(SignerIdentifier_vals), 0,
1376 "SignerInfo/sid", HFILL }},
1377 { &hf_cms_digestAlgorithm,
1378 { "digestAlgorithm", "cms.digestAlgorithm",
1379 FT_NONE, BASE_NONE, NULL, 0,
1381 { &hf_cms_signedAttrs,
1382 { "signedAttrs", "cms.signedAttrs",
1383 FT_UINT32, BASE_DEC, NULL, 0,
1384 "SignerInfo/signedAttrs", HFILL }},
1385 { &hf_cms_signatureAlgorithm,
1386 { "signatureAlgorithm", "cms.signatureAlgorithm",
1387 FT_NONE, BASE_NONE, NULL, 0,
1389 { &hf_cms_signatureValue,
1390 { "signature", "cms.signature",
1391 FT_BYTES, BASE_HEX, NULL, 0,
1392 "SignerInfo/signature", HFILL }},
1393 { &hf_cms_unsignedAttrs,
1394 { "unsignedAttrs", "cms.unsignedAttrs",
1395 FT_UINT32, BASE_DEC, NULL, 0,
1396 "SignerInfo/unsignedAttrs", HFILL }},
1397 { &hf_cms_issuerAndSerialNumber,
1398 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber",
1399 FT_NONE, BASE_NONE, NULL, 0,
1401 { &hf_cms_subjectKeyIdentifier,
1402 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1403 FT_BYTES, BASE_HEX, NULL, 0,
1405 { &hf_cms_SignedAttributes_item,
1406 { "Item", "cms.SignedAttributes_item",
1407 FT_NONE, BASE_NONE, NULL, 0,
1408 "SignedAttributes/_item", HFILL }},
1409 { &hf_cms_UnsignedAttributes_item,
1410 { "Item", "cms.UnsignedAttributes_item",
1411 FT_NONE, BASE_NONE, NULL, 0,
1412 "UnsignedAttributes/_item", HFILL }},
1414 { "attrType", "cms.attrType",
1415 FT_STRING, BASE_NONE, NULL, 0,
1416 "Attribute/attrType", HFILL }},
1417 { &hf_cms_originatorInfo,
1418 { "originatorInfo", "cms.originatorInfo",
1419 FT_NONE, BASE_NONE, NULL, 0,
1421 { &hf_cms_recipientInfos,
1422 { "recipientInfos", "cms.recipientInfos",
1423 FT_UINT32, BASE_DEC, NULL, 0,
1425 { &hf_cms_encryptedContentInfo,
1426 { "encryptedContentInfo", "cms.encryptedContentInfo",
1427 FT_NONE, BASE_NONE, NULL, 0,
1429 { &hf_cms_unprotectedAttrs,
1430 { "unprotectedAttrs", "cms.unprotectedAttrs",
1431 FT_UINT32, BASE_DEC, NULL, 0,
1434 { "certs", "cms.certs",
1435 FT_UINT32, BASE_DEC, NULL, 0,
1436 "OriginatorInfo/certs", HFILL }},
1437 { &hf_cms_RecipientInfos_item,
1438 { "Item", "cms.RecipientInfos_item",
1439 FT_UINT32, BASE_DEC, VALS(RecipientInfo_vals), 0,
1440 "RecipientInfos/_item", HFILL }},
1441 { &hf_cms_contentType1,
1442 { "contentType", "cms.contentType",
1443 FT_STRING, BASE_NONE, NULL, 0,
1444 "EncryptedContentInfo/contentType", HFILL }},
1445 { &hf_cms_contentEncryptionAlgorithm,
1446 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm",
1447 FT_NONE, BASE_NONE, NULL, 0,
1448 "EncryptedContentInfo/contentEncryptionAlgorithm", HFILL }},
1449 { &hf_cms_encryptedContent,
1450 { "encryptedContent", "cms.encryptedContent",
1451 FT_BYTES, BASE_HEX, NULL, 0,
1452 "EncryptedContentInfo/encryptedContent", HFILL }},
1453 { &hf_cms_UnprotectedAttributes_item,
1454 { "Item", "cms.UnprotectedAttributes_item",
1455 FT_NONE, BASE_NONE, NULL, 0,
1456 "UnprotectedAttributes/_item", HFILL }},
1458 { "ktri", "cms.ktri",
1459 FT_NONE, BASE_NONE, NULL, 0,
1460 "RecipientInfo/ktri", HFILL }},
1462 { "kari", "cms.kari",
1463 FT_NONE, BASE_NONE, NULL, 0,
1464 "RecipientInfo/kari", HFILL }},
1466 { "kekri", "cms.kekri",
1467 FT_NONE, BASE_NONE, NULL, 0,
1468 "RecipientInfo/kekri", HFILL }},
1471 FT_UINT32, BASE_DEC, VALS(RecipientIdentifier_vals), 0,
1472 "KeyTransRecipientInfo/rid", HFILL }},
1473 { &hf_cms_keyEncryptionAlgorithm,
1474 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm",
1475 FT_NONE, BASE_NONE, NULL, 0,
1477 { &hf_cms_encryptedKey,
1478 { "encryptedKey", "cms.encryptedKey",
1479 FT_BYTES, BASE_HEX, NULL, 0,
1481 { &hf_cms_originator,
1482 { "originator", "cms.originator",
1483 FT_UINT32, BASE_DEC, VALS(OriginatorIdentifierOrKey_vals), 0,
1484 "KeyAgreeRecipientInfo/originator", HFILL }},
1487 FT_BYTES, BASE_HEX, NULL, 0,
1488 "KeyAgreeRecipientInfo/ukm", HFILL }},
1489 { &hf_cms_recipientEncryptedKeys,
1490 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
1491 FT_UINT32, BASE_DEC, NULL, 0,
1492 "KeyAgreeRecipientInfo/recipientEncryptedKeys", HFILL }},
1493 { &hf_cms_originatorKey,
1494 { "originatorKey", "cms.originatorKey",
1495 FT_NONE, BASE_NONE, NULL, 0,
1496 "OriginatorIdentifierOrKey/originatorKey", HFILL }},
1497 { &hf_cms_algorithm,
1498 { "algorithm", "cms.algorithm",
1499 FT_NONE, BASE_NONE, NULL, 0,
1500 "OriginatorPublicKey/algorithm", HFILL }},
1501 { &hf_cms_publicKey,
1502 { "publicKey", "cms.publicKey",
1503 FT_BYTES, BASE_HEX, NULL, 0,
1504 "OriginatorPublicKey/publicKey", HFILL }},
1505 { &hf_cms_RecipientEncryptedKeys_item,
1506 { "Item", "cms.RecipientEncryptedKeys_item",
1507 FT_NONE, BASE_NONE, NULL, 0,
1508 "RecipientEncryptedKeys/_item", HFILL }},
1511 FT_UINT32, BASE_DEC, VALS(KeyAgreeRecipientIdentifier_vals), 0,
1512 "RecipientEncryptedKey/rid", HFILL }},
1514 { "rKeyId", "cms.rKeyId",
1515 FT_NONE, BASE_NONE, NULL, 0,
1516 "KeyAgreeRecipientIdentifier/rKeyId", HFILL }},
1518 { "date", "cms.date",
1519 FT_STRING, BASE_NONE, NULL, 0,
1522 { "other", "cms.other",
1523 FT_NONE, BASE_NONE, NULL, 0,
1526 { "kekid", "cms.kekid",
1527 FT_NONE, BASE_NONE, NULL, 0,
1528 "KEKRecipientInfo/kekid", HFILL }},
1529 { &hf_cms_keyIdentifier,
1530 { "keyIdentifier", "cms.keyIdentifier",
1531 FT_BYTES, BASE_HEX, NULL, 0,
1532 "KEKIdentifier/keyIdentifier", HFILL }},
1534 { "digest", "cms.digest",
1535 FT_BYTES, BASE_HEX, NULL, 0,
1536 "DigestedData/digest", HFILL }},
1537 { &hf_cms_macAlgorithm,
1538 { "macAlgorithm", "cms.macAlgorithm",
1539 FT_NONE, BASE_NONE, NULL, 0,
1540 "AuthenticatedData/macAlgorithm", HFILL }},
1541 { &hf_cms_authenticatedAttributes,
1542 { "authenticatedAttributes", "cms.authenticatedAttributes",
1543 FT_UINT32, BASE_DEC, NULL, 0,
1544 "AuthenticatedData/authenticatedAttributes", HFILL }},
1547 FT_BYTES, BASE_HEX, NULL, 0,
1548 "AuthenticatedData/mac", HFILL }},
1549 { &hf_cms_unauthenticatedAttributes,
1550 { "unauthenticatedAttributes", "cms.unauthenticatedAttributes",
1551 FT_UINT32, BASE_DEC, NULL, 0,
1552 "AuthenticatedData/unauthenticatedAttributes", HFILL }},
1553 { &hf_cms_AuthAttributes_item,
1554 { "Item", "cms.AuthAttributes_item",
1555 FT_NONE, BASE_NONE, NULL, 0,
1556 "AuthAttributes/_item", HFILL }},
1557 { &hf_cms_UnauthAttributes_item,
1558 { "Item", "cms.UnauthAttributes_item",
1559 FT_NONE, BASE_NONE, NULL, 0,
1560 "UnauthAttributes/_item", HFILL }},
1561 { &hf_cms_CertificateRevocationLists_item,
1562 { "Item", "cms.CertificateRevocationLists_item",
1563 FT_NONE, BASE_NONE, NULL, 0,
1564 "CertificateRevocationLists/_item", HFILL }},
1565 { &hf_cms_certificate,
1566 { "certificate", "cms.certificate",
1567 FT_NONE, BASE_NONE, NULL, 0,
1569 { &hf_cms_extendedCertificate,
1570 { "extendedCertificate", "cms.extendedCertificate",
1571 FT_NONE, BASE_NONE, NULL, 0,
1572 "CertificateChoices/extendedCertificate", HFILL }},
1574 { "attrCert", "cms.attrCert",
1575 FT_NONE, BASE_NONE, NULL, 0,
1576 "CertificateChoices/attrCert", HFILL }},
1577 { &hf_cms_CertificateSet_item,
1578 { "Item", "cms.CertificateSet_item",
1579 FT_UINT32, BASE_DEC, VALS(CertificateChoices_vals), 0,
1580 "CertificateSet/_item", HFILL }},
1582 { "issuer", "cms.issuer",
1583 FT_UINT32, BASE_DEC, VALS(Name_vals), 0,
1584 "IssuerAndSerialNumber/issuer", HFILL }},
1585 { &hf_cms_serialNumber,
1586 { "serialNumber", "cms.serialNumber",
1587 FT_INT32, BASE_DEC, NULL, 0,
1588 "IssuerAndSerialNumber/serialNumber", HFILL }},
1589 { &hf_cms_keyAttrId,
1590 { "keyAttrId", "cms.keyAttrId",
1591 FT_STRING, BASE_NONE, NULL, 0,
1592 "OtherKeyAttribute/keyAttrId", HFILL }},
1594 { "keyAttr", "cms.keyAttr",
1595 FT_NONE, BASE_NONE, NULL, 0,
1596 "OtherKeyAttribute/keyAttr", HFILL }},
1597 { &hf_cms_extendedCertificateInfo,
1598 { "extendedCertificateInfo", "cms.extendedCertificateInfo",
1599 FT_NONE, BASE_NONE, NULL, 0,
1600 "ExtendedCertificate/extendedCertificateInfo", HFILL }},
1601 { &hf_cms_signature,
1602 { "signature", "cms.signature",
1603 FT_BYTES, BASE_HEX, NULL, 0,
1604 "ExtendedCertificate/signature", HFILL }},
1605 { &hf_cms_attributes,
1606 { "attributes", "cms.attributes",
1607 FT_UINT32, BASE_DEC, NULL, 0,
1608 "ExtendedCertificateInfo/attributes", HFILL }},
1610 /*--- End of included file: packet-cms-hfarr.c ---*/
1614 /* List of subtrees */
1615 static gint *ett[] = {
1617 /*--- Included file: packet-cms-ettarr.c ---*/
1619 &ett_cms_ContentInfo,
1620 &ett_cms_SignedData,
1621 &ett_cms_DigestAlgorithmIdentifiers,
1622 &ett_cms_SignerInfos,
1623 &ett_cms_EncapsulatedContentInfo,
1624 &ett_cms_SignerInfo,
1625 &ett_cms_SignerIdentifier,
1626 &ett_cms_SignedAttributes,
1627 &ett_cms_UnsignedAttributes,
1629 &ett_cms_EnvelopedData,
1630 &ett_cms_OriginatorInfo,
1631 &ett_cms_RecipientInfos,
1632 &ett_cms_EncryptedContentInfo,
1633 &ett_cms_UnprotectedAttributes,
1634 &ett_cms_RecipientInfo,
1635 &ett_cms_KeyTransRecipientInfo,
1636 &ett_cms_RecipientIdentifier,
1637 &ett_cms_KeyAgreeRecipientInfo,
1638 &ett_cms_OriginatorIdentifierOrKey,
1639 &ett_cms_OriginatorPublicKey,
1640 &ett_cms_RecipientEncryptedKeys,
1641 &ett_cms_RecipientEncryptedKey,
1642 &ett_cms_KeyAgreeRecipientIdentifier,
1643 &ett_cms_RecipientKeyIdentifier,
1644 &ett_cms_KEKRecipientInfo,
1645 &ett_cms_KEKIdentifier,
1646 &ett_cms_DigestedData,
1647 &ett_cms_EncryptedData,
1648 &ett_cms_AuthenticatedData,
1649 &ett_cms_AuthAttributes,
1650 &ett_cms_UnauthAttributes,
1651 &ett_cms_CertificateRevocationLists,
1652 &ett_cms_CertificateChoices,
1653 &ett_cms_CertificateSet,
1654 &ett_cms_IssuerAndSerialNumber,
1655 &ett_cms_OtherKeyAttribute,
1656 &ett_cms_ExtendedCertificate,
1657 &ett_cms_ExtendedCertificateInfo,
1659 /*--- End of included file: packet-cms-ettarr.c ---*/
1663 /* Register protocol */
1664 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
1666 /* Register fields and subtrees */
1667 proto_register_field_array(proto_cms, hf, array_length(hf));
1668 proto_register_subtree_array(ett, array_length(ett));
1673 /*--- proto_reg_handoff_cms -------------------------------------------*/
1674 void proto_reg_handoff_cms(void) {
1676 /*--- Included file: packet-cms-dis-tab.c ---*/
1678 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
1679 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
1680 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
1681 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
1682 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
1685 /*--- End of included file: packet-cms-dis-tab.c ---*/