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 12394 2004-10-26 13:54:09Z 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_keyAttr_id = -1;
55 static int hf_cms_ci_contentType = -1;
56 static int hf_cms_eci_eContentType = -1;
58 /*--- Included file: packet-cms-hf.c ---*/
60 static int hf_cms_SignedData_PDU = -1; /* SignedData */
61 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
62 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
63 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
64 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
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; /* ContentType */
74 static int hf_cms_eContent = -1; /* OCTET_STRING */
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_contentType = -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_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
130 static int hf_cms_signature = -1; /* Signature */
131 static int hf_cms_attributes = -1; /* UnauthAttributes */
133 /*--- End of included file: packet-cms-hf.c ---*/
136 /* Initialize the subtree pointers */
137 static gint ett_cms_ContentInfo = -1;
139 /*--- Included file: packet-cms-ett.c ---*/
141 static gint ett_cms_SignedData = -1;
142 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
143 static gint ett_cms_SignerInfos = -1;
144 static gint ett_cms_EncapsulatedContentInfo = -1;
145 static gint ett_cms_SignerInfo = -1;
146 static gint ett_cms_SignerIdentifier = -1;
147 static gint ett_cms_SignedAttributes = -1;
148 static gint ett_cms_UnsignedAttributes = -1;
149 static gint ett_cms_Attribute = -1;
150 static gint ett_cms_EnvelopedData = -1;
151 static gint ett_cms_OriginatorInfo = -1;
152 static gint ett_cms_RecipientInfos = -1;
153 static gint ett_cms_EncryptedContentInfo = -1;
154 static gint ett_cms_UnprotectedAttributes = -1;
155 static gint ett_cms_RecipientInfo = -1;
156 static gint ett_cms_KeyTransRecipientInfo = -1;
157 static gint ett_cms_RecipientIdentifier = -1;
158 static gint ett_cms_KeyAgreeRecipientInfo = -1;
159 static gint ett_cms_OriginatorIdentifierOrKey = -1;
160 static gint ett_cms_OriginatorPublicKey = -1;
161 static gint ett_cms_RecipientEncryptedKeys = -1;
162 static gint ett_cms_RecipientEncryptedKey = -1;
163 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
164 static gint ett_cms_RecipientKeyIdentifier = -1;
165 static gint ett_cms_KEKRecipientInfo = -1;
166 static gint ett_cms_KEKIdentifier = -1;
167 static gint ett_cms_DigestedData = -1;
168 static gint ett_cms_EncryptedData = -1;
169 static gint ett_cms_AuthenticatedData = -1;
170 static gint ett_cms_AuthAttributes = -1;
171 static gint ett_cms_UnauthAttributes = -1;
172 static gint ett_cms_CertificateRevocationLists = -1;
173 static gint ett_cms_CertificateChoices = -1;
174 static gint ett_cms_CertificateSet = -1;
175 static gint ett_cms_IssuerAndSerialNumber = -1;
176 static gint ett_cms_OtherKeyAttribute = -1;
177 static gint ett_cms_ExtendedCertificate = -1;
178 static gint ett_cms_ExtendedCertificateInfo = -1;
180 /*--- End of included file: packet-cms-ett.c ---*/
183 static int dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index);
187 /*--- Included file: packet-cms-fn.c ---*/
189 /*--- Fields for imported types ---*/
191 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
192 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm);
194 static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
195 return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item);
197 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
198 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate);
200 static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
201 return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert);
203 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
204 return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_cms_issuer);
206 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
207 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber);
212 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
213 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
218 static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
219 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
221 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
222 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType);
226 static const value_string CMSVersion_vals[] = {
237 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
238 offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL);
242 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
243 return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version);
248 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
249 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
253 static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
254 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item);
256 static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
257 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
259 static int dissect_digestAlgorithm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
260 return dissect_cms_DigestAlgorithmIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
263 static const ber_sequence DigestAlgorithmIdentifiers_set_of[1] = {
264 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item },
268 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
269 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
270 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
274 static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
275 return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms);
280 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
281 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
286 static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
287 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
289 static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
290 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
293 static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
294 return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
299 dissect_cms_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
300 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
305 static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
306 return dissect_cms_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType);
309 static const ber_sequence Attribute_sequence[] = {
310 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType },
315 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
316 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
317 Attribute_sequence, hf_index, ett_cms_Attribute);
321 static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
322 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item);
324 static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
325 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item);
327 static int dissect_UnprotectedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
328 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnprotectedAttributes_item);
330 static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
331 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item);
333 static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
334 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item);
337 static const ber_sequence UnauthAttributes_set_of[1] = {
338 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item },
342 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
343 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
344 UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
348 static int dissect_unauthenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
349 return dissect_cms_UnauthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unauthenticatedAttributes);
351 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
352 return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes);
355 static const ber_sequence ExtendedCertificateInfo_sequence[] = {
356 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
357 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
358 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes },
363 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
364 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
365 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
369 static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
370 return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo);
375 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
376 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
380 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
381 return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm);
386 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
387 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
393 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
394 return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature);
397 static const ber_sequence ExtendedCertificate_sequence[] = {
398 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo },
399 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
400 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
405 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
406 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
407 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
411 static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
412 return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate);
416 static const value_string CertificateChoices_vals[] = {
417 { 0, "certificate" },
418 { 1, "extendedCertificate" },
423 static const ber_choice CertificateChoices_choice[] = {
424 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
425 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl },
426 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl },
431 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
432 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
433 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices);
437 static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
438 return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item);
441 static const ber_sequence CertificateSet_set_of[1] = {
442 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item },
446 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
447 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
448 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
452 static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
453 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates);
455 static int dissect_certs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
456 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certs);
459 static const ber_sequence CertificateRevocationLists_set_of[1] = {
460 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item },
464 dissect_cms_CertificateRevocationLists(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
465 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
466 CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists);
470 static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
471 return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls);
474 static const ber_sequence IssuerAndSerialNumber_sequence[] = {
475 { BER_CLASS_ANY, -1, BER_FLAGS_NOOWNTAG, dissect_issuer },
476 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
481 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
482 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
483 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
487 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
488 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber);
493 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
494 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
499 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
500 return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
502 static int dissect_subjectKeyIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
503 return dissect_cms_SubjectKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
507 static const value_string SignerIdentifier_vals[] = {
508 { 0, "issuerAndSerialNumber" },
509 { 1, "subjectKeyIdentifier" },
513 static const ber_choice SignerIdentifier_choice[] = {
514 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
515 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
520 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
521 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
522 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier);
526 static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
527 return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid);
530 static const ber_sequence SignedAttributes_set_of[1] = {
531 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item },
535 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
536 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
537 SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
541 static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
542 return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs);
547 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
548 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
553 static int dissect_signatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
554 return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureValue);
557 static const ber_sequence UnsignedAttributes_set_of[1] = {
558 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item },
562 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
563 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
564 UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
568 static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
569 return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs);
572 static const ber_sequence SignerInfo_sequence[] = {
573 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
574 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid },
575 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
576 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl },
577 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
578 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signatureValue },
579 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl },
584 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
585 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
586 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
590 static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
591 return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item);
594 static const ber_sequence SignerInfos_set_of[1] = {
595 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item },
599 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
600 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
601 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
605 static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
606 return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos);
609 static const ber_sequence SignedData_sequence[] = {
610 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
611 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms },
612 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
613 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl },
614 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
615 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos },
620 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
621 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
622 SignedData_sequence, hf_index, ett_cms_SignedData);
627 static const ber_sequence OriginatorInfo_sequence[] = {
628 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certs_impl },
629 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
634 dissect_cms_OriginatorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
635 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
636 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
640 static int dissect_originatorInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
641 return dissect_cms_OriginatorInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorInfo);
645 static const value_string RecipientIdentifier_vals[] = {
646 { 0, "issuerAndSerialNumber" },
647 { 1, "subjectKeyIdentifier" },
651 static const ber_choice RecipientIdentifier_choice[] = {
652 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
653 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
658 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
659 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
660 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier);
664 static int dissect_rid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
665 return dissect_cms_RecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rid);
670 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
671 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
675 static int dissect_keyEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
676 return dissect_cms_KeyEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_keyEncryptionAlgorithm);
681 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
682 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
687 static int dissect_encryptedKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
688 return dissect_cms_EncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedKey);
691 static const ber_sequence KeyTransRecipientInfo_sequence[] = {
692 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
693 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rid },
694 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
695 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
700 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
701 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
702 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
706 static int dissect_ktri(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
707 return dissect_cms_KeyTransRecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_ktri);
712 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
713 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
719 static int dissect_publicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
720 return dissect_cms_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_publicKey);
723 static const ber_sequence OriginatorPublicKey_sequence[] = {
724 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
725 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_publicKey },
730 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
731 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
732 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
736 static int dissect_originatorKey_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
737 return dissect_cms_OriginatorPublicKey(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorKey);
741 static const value_string OriginatorIdentifierOrKey_vals[] = {
742 { 0, "issuerAndSerialNumber" },
743 { 1, "subjectKeyIdentifier" },
744 { 2, "originatorKey" },
748 static const ber_choice OriginatorIdentifierOrKey_choice[] = {
749 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
750 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
751 { 2, BER_CLASS_CON, 1, 0, dissect_originatorKey_impl },
756 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
757 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
758 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey);
762 static int dissect_originator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
763 return dissect_cms_OriginatorIdentifierOrKey(FALSE, tvb, offset, pinfo, tree, hf_cms_originator);
768 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
769 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
774 static int dissect_ukm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
775 return dissect_cms_UserKeyingMaterial(FALSE, tvb, offset, pinfo, tree, hf_cms_ukm);
780 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
781 offset = dissect_ber_generalized_time(pinfo, tree, tvb, offset, hf_index);
785 static int dissect_date(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
786 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_date);
789 static int dissect_other(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
790 return dissect_cms_OtherKeyAttribute(FALSE, tvb, offset, pinfo, tree, hf_cms_other);
793 static const ber_sequence RecipientKeyIdentifier_sequence[] = {
794 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
795 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
796 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
801 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
802 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
803 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
807 static int dissect_rKeyId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
808 return dissect_cms_RecipientKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_rKeyId);
812 static const value_string KeyAgreeRecipientIdentifier_vals[] = {
813 { 0, "issuerAndSerialNumber" },
818 static const ber_choice KeyAgreeRecipientIdentifier_choice[] = {
819 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
820 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_rKeyId_impl },
825 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
826 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
827 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier);
831 static int dissect_rekRid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
832 return dissect_cms_KeyAgreeRecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rekRid);
835 static const ber_sequence RecipientEncryptedKey_sequence[] = {
836 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rekRid },
837 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
842 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
843 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
844 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
848 static int dissect_RecipientEncryptedKeys_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
849 return dissect_cms_RecipientEncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientEncryptedKeys_item);
852 static const ber_sequence RecipientEncryptedKeys_sequence_of[1] = {
853 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RecipientEncryptedKeys_item },
857 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
858 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
859 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
863 static int dissect_recipientEncryptedKeys(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
864 return dissect_cms_RecipientEncryptedKeys(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientEncryptedKeys);
867 static const ber_sequence KeyAgreeRecipientInfo_sequence[] = {
868 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
869 { BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_originator },
870 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ukm },
871 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
872 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_recipientEncryptedKeys },
877 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
878 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
879 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
883 static int dissect_kari_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
884 return dissect_cms_KeyAgreeRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kari);
887 static const ber_sequence KEKIdentifier_sequence[] = {
888 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_keyIdentifier },
889 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
890 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
895 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
896 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
897 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
901 static int dissect_kekid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
902 return dissect_cms_KEKIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_kekid);
905 static const ber_sequence KEKRecipientInfo_sequence[] = {
906 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
907 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_kekid },
908 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
909 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
914 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
915 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
916 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
920 static int dissect_kekri_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
921 return dissect_cms_KEKRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kekri);
925 static const value_string RecipientInfo_vals[] = {
932 static const ber_choice RecipientInfo_choice[] = {
933 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ktri },
934 { 1, BER_CLASS_CON, 1, 0, dissect_kari_impl },
935 { 2, BER_CLASS_CON, 2, 0, dissect_kekri_impl },
940 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
941 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
942 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo);
946 static int dissect_RecipientInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
947 return dissect_cms_RecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientInfos_item);
950 static const ber_sequence RecipientInfos_set_of[1] = {
951 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_RecipientInfos_item },
955 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
956 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
957 RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
961 static int dissect_recipientInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
962 return dissect_cms_RecipientInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientInfos);
967 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
968 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
972 static int dissect_contentEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
973 return dissect_cms_ContentEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_contentEncryptionAlgorithm);
978 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
979 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
984 static int dissect_encryptedContent_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
985 return dissect_cms_EncryptedContent(TRUE, tvb, offset, pinfo, tree, hf_cms_encryptedContent);
988 static const ber_sequence EncryptedContentInfo_sequence[] = {
989 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
990 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_contentEncryptionAlgorithm },
991 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_encryptedContent_impl },
996 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
997 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
998 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1002 static int dissect_encryptedContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1003 return dissect_cms_EncryptedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentInfo);
1006 static const ber_sequence UnprotectedAttributes_set_of[1] = {
1007 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnprotectedAttributes_item },
1011 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1012 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1013 UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1017 static int dissect_unprotectedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1018 return dissect_cms_UnprotectedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unprotectedAttrs);
1021 static const ber_sequence EnvelopedData_sequence[] = {
1022 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1023 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1024 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1025 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1026 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1031 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1032 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1033 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1040 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1041 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1046 static int dissect_digest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1047 return dissect_cms_Digest(FALSE, tvb, offset, pinfo, tree, hf_cms_digest);
1050 static const ber_sequence DigestedData_sequence[] = {
1051 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1052 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
1053 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1054 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_digest },
1059 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1060 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1061 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1066 static const ber_sequence EncryptedData_sequence[] = {
1067 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1068 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1069 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1074 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1075 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1076 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1083 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1084 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1088 static int dissect_macAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1089 return dissect_cms_MessageAuthenticationCodeAlgorithm(FALSE, tvb, offset, pinfo, tree, hf_cms_macAlgorithm);
1092 static const ber_sequence AuthAttributes_set_of[1] = {
1093 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item },
1097 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1098 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1099 AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1103 static int dissect_authenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1104 return dissect_cms_AuthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_authenticatedAttributes);
1109 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1110 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1115 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1116 return dissect_cms_MessageAuthenticationCode(FALSE, tvb, offset, pinfo, tree, hf_cms_mac);
1119 static const ber_sequence AuthenticatedData_sequence[] = {
1120 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1121 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1122 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1123 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_macAlgorithm },
1124 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_digestAlgorithm_impl },
1125 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1126 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_authenticatedAttributes_impl },
1127 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mac },
1128 { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unauthenticatedAttributes_impl },
1133 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1134 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1135 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1142 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1143 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1150 static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1151 dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
1153 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1154 dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
1156 static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1157 dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
1159 static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1160 dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
1162 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1163 dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
1167 /*--- End of included file: packet-cms-fn.c ---*/
1171 static char keyAttr_id[64]; /*64 chars should be long enough? */
1173 dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1175 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1176 hf_cms_keyAttr_id, keyAttr_id);
1181 dissect_keyAttr_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1183 offset=call_ber_oid_callback(keyAttr_id, tvb, offset, pinfo, tree);
1188 static const ber_sequence OtherKeyAttribute_sequence[] = {
1189 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId },
1190 { BER_CLASS_ANY, 0, 0, dissect_keyAttr_type },
1195 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
1196 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1197 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
1204 /* ContentInfo can not yet be handled by the compiler */
1205 static char ci_contentType[64]; /*64 chars should be long enough? */
1207 dissect_hf_cms_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1209 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1210 hf_cms_ci_contentType, ci_contentType);
1214 dissect_hf_cms_contentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1216 offset=call_ber_oid_callback(ci_contentType, tvb, offset, pinfo, tree);
1221 static const ber_sequence ContentInfo_sequence[] = {
1222 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_cms_contentType },
1223 { BER_CLASS_ANY, 0, 0, dissect_hf_cms_contentType_content },
1228 dissect_cms_ContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
1229 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1230 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
1236 /* Do the same thing for EncapsulatedContentInfo */
1237 static char eci_eContentType[64]; /*64 chars should be long enough? */
1239 dissect_hf_cms_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1241 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
1242 hf_cms_eci_eContentType, eci_eContentType);
1246 dissect_hf_cms_eContentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
1251 int pdu_offset = offset;
1253 /* XXX Do we care about printing out the octet string? */
1254 offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
1256 pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
1257 pdu_offset = get_ber_length(tvb, pdu_offset, &len, &ind);
1258 pdu_offset = call_ber_oid_callback(eci_eContentType, tvb, pdu_offset, pinfo, tree);
1263 static const ber_sequence EncapsulatedContentInfo_sequence[] = {
1264 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_cms_eContentType },
1265 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_hf_cms_eContentType_content },
1270 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
1271 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1272 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
1278 /*--- proto_register_cms ----------------------------------------------*/
1279 void proto_register_cms(void) {
1281 /* List of fields */
1282 static hf_register_info hf[] = {
1283 { &hf_cms_ci_contentType,
1284 { "contentType", "cms.contentInfo.contentType",
1285 FT_STRING, BASE_NONE, NULL, 0,
1286 "ContentType", HFILL }},
1287 { &hf_cms_eci_eContentType,
1288 { "eContentType", "cms.encapContentInfo.eContentType",
1289 FT_STRING, BASE_NONE, NULL, 0,
1290 "EncapsulatedContentType", HFILL }},
1291 { &hf_cms_keyAttr_id,
1292 { "keyAttr_id", "cms.keyAttr_id",
1293 FT_STRING, BASE_NONE, NULL, 0,
1294 "keyAttr_id", HFILL }},
1296 /*--- Included file: packet-cms-hfarr.c ---*/
1298 { &hf_cms_SignedData_PDU,
1299 { "SignedData", "cms.SignedData",
1300 FT_NONE, BASE_NONE, NULL, 0,
1301 "SignedData", HFILL }},
1302 { &hf_cms_EnvelopedData_PDU,
1303 { "EnvelopedData", "cms.EnvelopedData",
1304 FT_NONE, BASE_NONE, NULL, 0,
1305 "EnvelopedData", HFILL }},
1306 { &hf_cms_DigestedData_PDU,
1307 { "DigestedData", "cms.DigestedData",
1308 FT_NONE, BASE_NONE, NULL, 0,
1309 "DigestedData", HFILL }},
1310 { &hf_cms_EncryptedData_PDU,
1311 { "EncryptedData", "cms.EncryptedData",
1312 FT_NONE, BASE_NONE, NULL, 0,
1313 "EncryptedData", HFILL }},
1314 { &hf_cms_AuthenticatedData_PDU,
1315 { "AuthenticatedData", "cms.AuthenticatedData",
1316 FT_NONE, BASE_NONE, NULL, 0,
1317 "AuthenticatedData", HFILL }},
1319 { "version", "cms.version",
1320 FT_INT32, BASE_DEC, VALS(CMSVersion_vals), 0,
1322 { &hf_cms_digestAlgorithms,
1323 { "digestAlgorithms", "cms.digestAlgorithms",
1324 FT_UINT32, BASE_DEC, NULL, 0,
1325 "SignedData/digestAlgorithms", HFILL }},
1326 { &hf_cms_encapContentInfo,
1327 { "encapContentInfo", "cms.encapContentInfo",
1328 FT_NONE, BASE_NONE, NULL, 0,
1330 { &hf_cms_certificates,
1331 { "certificates", "cms.certificates",
1332 FT_UINT32, BASE_DEC, NULL, 0,
1333 "SignedData/certificates", HFILL }},
1335 { "crls", "cms.crls",
1336 FT_UINT32, BASE_DEC, NULL, 0,
1338 { &hf_cms_signerInfos,
1339 { "signerInfos", "cms.signerInfos",
1340 FT_UINT32, BASE_DEC, NULL, 0,
1341 "SignedData/signerInfos", HFILL }},
1342 { &hf_cms_DigestAlgorithmIdentifiers_item,
1343 { "Item", "cms.DigestAlgorithmIdentifiers_item",
1344 FT_NONE, BASE_NONE, NULL, 0,
1345 "DigestAlgorithmIdentifiers/_item", HFILL }},
1346 { &hf_cms_SignerInfos_item,
1347 { "Item", "cms.SignerInfos_item",
1348 FT_NONE, BASE_NONE, NULL, 0,
1349 "SignerInfos/_item", HFILL }},
1350 { &hf_cms_eContentType,
1351 { "eContentType", "cms.eContentType",
1352 FT_STRING, BASE_NONE, NULL, 0,
1353 "EncapsulatedContentInfo/eContentType", HFILL }},
1355 { "eContent", "cms.eContent",
1356 FT_BYTES, BASE_HEX, NULL, 0,
1357 "EncapsulatedContentInfo/eContent", HFILL }},
1360 FT_UINT32, BASE_DEC, VALS(SignerIdentifier_vals), 0,
1361 "SignerInfo/sid", HFILL }},
1362 { &hf_cms_digestAlgorithm,
1363 { "digestAlgorithm", "cms.digestAlgorithm",
1364 FT_NONE, BASE_NONE, NULL, 0,
1366 { &hf_cms_signedAttrs,
1367 { "signedAttrs", "cms.signedAttrs",
1368 FT_UINT32, BASE_DEC, NULL, 0,
1369 "SignerInfo/signedAttrs", HFILL }},
1370 { &hf_cms_signatureAlgorithm,
1371 { "signatureAlgorithm", "cms.signatureAlgorithm",
1372 FT_NONE, BASE_NONE, NULL, 0,
1374 { &hf_cms_signatureValue,
1375 { "signature", "cms.signature",
1376 FT_BYTES, BASE_HEX, NULL, 0,
1377 "SignerInfo/signature", HFILL }},
1378 { &hf_cms_unsignedAttrs,
1379 { "unsignedAttrs", "cms.unsignedAttrs",
1380 FT_UINT32, BASE_DEC, NULL, 0,
1381 "SignerInfo/unsignedAttrs", HFILL }},
1382 { &hf_cms_issuerAndSerialNumber,
1383 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber",
1384 FT_NONE, BASE_NONE, NULL, 0,
1386 { &hf_cms_subjectKeyIdentifier,
1387 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1388 FT_BYTES, BASE_HEX, NULL, 0,
1390 { &hf_cms_SignedAttributes_item,
1391 { "Item", "cms.SignedAttributes_item",
1392 FT_NONE, BASE_NONE, NULL, 0,
1393 "SignedAttributes/_item", HFILL }},
1394 { &hf_cms_UnsignedAttributes_item,
1395 { "Item", "cms.UnsignedAttributes_item",
1396 FT_NONE, BASE_NONE, NULL, 0,
1397 "UnsignedAttributes/_item", HFILL }},
1399 { "attrType", "cms.attrType",
1400 FT_STRING, BASE_NONE, NULL, 0,
1401 "Attribute/attrType", HFILL }},
1402 { &hf_cms_originatorInfo,
1403 { "originatorInfo", "cms.originatorInfo",
1404 FT_NONE, BASE_NONE, NULL, 0,
1406 { &hf_cms_recipientInfos,
1407 { "recipientInfos", "cms.recipientInfos",
1408 FT_UINT32, BASE_DEC, NULL, 0,
1410 { &hf_cms_encryptedContentInfo,
1411 { "encryptedContentInfo", "cms.encryptedContentInfo",
1412 FT_NONE, BASE_NONE, NULL, 0,
1414 { &hf_cms_unprotectedAttrs,
1415 { "unprotectedAttrs", "cms.unprotectedAttrs",
1416 FT_UINT32, BASE_DEC, NULL, 0,
1419 { "certs", "cms.certs",
1420 FT_UINT32, BASE_DEC, NULL, 0,
1421 "OriginatorInfo/certs", HFILL }},
1422 { &hf_cms_RecipientInfos_item,
1423 { "Item", "cms.RecipientInfos_item",
1424 FT_UINT32, BASE_DEC, VALS(RecipientInfo_vals), 0,
1425 "RecipientInfos/_item", HFILL }},
1426 { &hf_cms_contentType,
1427 { "contentType", "cms.contentType",
1428 FT_STRING, BASE_NONE, NULL, 0,
1429 "EncryptedContentInfo/contentType", HFILL }},
1430 { &hf_cms_contentEncryptionAlgorithm,
1431 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm",
1432 FT_NONE, BASE_NONE, NULL, 0,
1433 "EncryptedContentInfo/contentEncryptionAlgorithm", HFILL }},
1434 { &hf_cms_encryptedContent,
1435 { "encryptedContent", "cms.encryptedContent",
1436 FT_BYTES, BASE_HEX, NULL, 0,
1437 "EncryptedContentInfo/encryptedContent", HFILL }},
1438 { &hf_cms_UnprotectedAttributes_item,
1439 { "Item", "cms.UnprotectedAttributes_item",
1440 FT_NONE, BASE_NONE, NULL, 0,
1441 "UnprotectedAttributes/_item", HFILL }},
1443 { "ktri", "cms.ktri",
1444 FT_NONE, BASE_NONE, NULL, 0,
1445 "RecipientInfo/ktri", HFILL }},
1447 { "kari", "cms.kari",
1448 FT_NONE, BASE_NONE, NULL, 0,
1449 "RecipientInfo/kari", HFILL }},
1451 { "kekri", "cms.kekri",
1452 FT_NONE, BASE_NONE, NULL, 0,
1453 "RecipientInfo/kekri", HFILL }},
1456 FT_UINT32, BASE_DEC, VALS(RecipientIdentifier_vals), 0,
1457 "KeyTransRecipientInfo/rid", HFILL }},
1458 { &hf_cms_keyEncryptionAlgorithm,
1459 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm",
1460 FT_NONE, BASE_NONE, NULL, 0,
1462 { &hf_cms_encryptedKey,
1463 { "encryptedKey", "cms.encryptedKey",
1464 FT_BYTES, BASE_HEX, NULL, 0,
1466 { &hf_cms_originator,
1467 { "originator", "cms.originator",
1468 FT_UINT32, BASE_DEC, VALS(OriginatorIdentifierOrKey_vals), 0,
1469 "KeyAgreeRecipientInfo/originator", HFILL }},
1472 FT_BYTES, BASE_HEX, NULL, 0,
1473 "KeyAgreeRecipientInfo/ukm", HFILL }},
1474 { &hf_cms_recipientEncryptedKeys,
1475 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
1476 FT_UINT32, BASE_DEC, NULL, 0,
1477 "KeyAgreeRecipientInfo/recipientEncryptedKeys", HFILL }},
1478 { &hf_cms_originatorKey,
1479 { "originatorKey", "cms.originatorKey",
1480 FT_NONE, BASE_NONE, NULL, 0,
1481 "OriginatorIdentifierOrKey/originatorKey", HFILL }},
1482 { &hf_cms_algorithm,
1483 { "algorithm", "cms.algorithm",
1484 FT_NONE, BASE_NONE, NULL, 0,
1485 "OriginatorPublicKey/algorithm", HFILL }},
1486 { &hf_cms_publicKey,
1487 { "publicKey", "cms.publicKey",
1488 FT_BYTES, BASE_HEX, NULL, 0,
1489 "OriginatorPublicKey/publicKey", HFILL }},
1490 { &hf_cms_RecipientEncryptedKeys_item,
1491 { "Item", "cms.RecipientEncryptedKeys_item",
1492 FT_NONE, BASE_NONE, NULL, 0,
1493 "RecipientEncryptedKeys/_item", HFILL }},
1496 FT_UINT32, BASE_DEC, VALS(KeyAgreeRecipientIdentifier_vals), 0,
1497 "RecipientEncryptedKey/rid", HFILL }},
1499 { "rKeyId", "cms.rKeyId",
1500 FT_NONE, BASE_NONE, NULL, 0,
1501 "KeyAgreeRecipientIdentifier/rKeyId", HFILL }},
1503 { "date", "cms.date",
1504 FT_STRING, BASE_NONE, NULL, 0,
1507 { "other", "cms.other",
1508 FT_NONE, BASE_NONE, NULL, 0,
1511 { "kekid", "cms.kekid",
1512 FT_NONE, BASE_NONE, NULL, 0,
1513 "KEKRecipientInfo/kekid", HFILL }},
1514 { &hf_cms_keyIdentifier,
1515 { "keyIdentifier", "cms.keyIdentifier",
1516 FT_BYTES, BASE_HEX, NULL, 0,
1517 "KEKIdentifier/keyIdentifier", HFILL }},
1519 { "digest", "cms.digest",
1520 FT_BYTES, BASE_HEX, NULL, 0,
1521 "DigestedData/digest", HFILL }},
1522 { &hf_cms_macAlgorithm,
1523 { "macAlgorithm", "cms.macAlgorithm",
1524 FT_NONE, BASE_NONE, NULL, 0,
1525 "AuthenticatedData/macAlgorithm", HFILL }},
1526 { &hf_cms_authenticatedAttributes,
1527 { "authenticatedAttributes", "cms.authenticatedAttributes",
1528 FT_UINT32, BASE_DEC, NULL, 0,
1529 "AuthenticatedData/authenticatedAttributes", HFILL }},
1532 FT_BYTES, BASE_HEX, NULL, 0,
1533 "AuthenticatedData/mac", HFILL }},
1534 { &hf_cms_unauthenticatedAttributes,
1535 { "unauthenticatedAttributes", "cms.unauthenticatedAttributes",
1536 FT_UINT32, BASE_DEC, NULL, 0,
1537 "AuthenticatedData/unauthenticatedAttributes", HFILL }},
1538 { &hf_cms_AuthAttributes_item,
1539 { "Item", "cms.AuthAttributes_item",
1540 FT_NONE, BASE_NONE, NULL, 0,
1541 "AuthAttributes/_item", HFILL }},
1542 { &hf_cms_UnauthAttributes_item,
1543 { "Item", "cms.UnauthAttributes_item",
1544 FT_NONE, BASE_NONE, NULL, 0,
1545 "UnauthAttributes/_item", HFILL }},
1546 { &hf_cms_CertificateRevocationLists_item,
1547 { "Item", "cms.CertificateRevocationLists_item",
1548 FT_NONE, BASE_NONE, NULL, 0,
1549 "CertificateRevocationLists/_item", HFILL }},
1550 { &hf_cms_certificate,
1551 { "certificate", "cms.certificate",
1552 FT_NONE, BASE_NONE, NULL, 0,
1554 { &hf_cms_extendedCertificate,
1555 { "extendedCertificate", "cms.extendedCertificate",
1556 FT_NONE, BASE_NONE, NULL, 0,
1557 "CertificateChoices/extendedCertificate", HFILL }},
1559 { "attrCert", "cms.attrCert",
1560 FT_NONE, BASE_NONE, NULL, 0,
1561 "CertificateChoices/attrCert", HFILL }},
1562 { &hf_cms_CertificateSet_item,
1563 { "Item", "cms.CertificateSet_item",
1564 FT_UINT32, BASE_DEC, VALS(CertificateChoices_vals), 0,
1565 "CertificateSet/_item", HFILL }},
1567 { "issuer", "cms.issuer",
1568 FT_UINT32, BASE_DEC, VALS(Name_vals), 0,
1569 "IssuerAndSerialNumber/issuer", HFILL }},
1570 { &hf_cms_serialNumber,
1571 { "serialNumber", "cms.serialNumber",
1572 FT_INT32, BASE_DEC, NULL, 0,
1573 "IssuerAndSerialNumber/serialNumber", HFILL }},
1574 { &hf_cms_extendedCertificateInfo,
1575 { "extendedCertificateInfo", "cms.extendedCertificateInfo",
1576 FT_NONE, BASE_NONE, NULL, 0,
1577 "ExtendedCertificate/extendedCertificateInfo", HFILL }},
1578 { &hf_cms_signature,
1579 { "signature", "cms.signature",
1580 FT_BYTES, BASE_HEX, NULL, 0,
1581 "ExtendedCertificate/signature", HFILL }},
1582 { &hf_cms_attributes,
1583 { "attributes", "cms.attributes",
1584 FT_UINT32, BASE_DEC, NULL, 0,
1585 "ExtendedCertificateInfo/attributes", HFILL }},
1587 /*--- End of included file: packet-cms-hfarr.c ---*/
1591 /* List of subtrees */
1592 static gint *ett[] = {
1593 &ett_cms_ContentInfo,
1594 &ett_cms_EncapsulatedContentInfo,
1596 /*--- Included file: packet-cms-ettarr.c ---*/
1598 &ett_cms_SignedData,
1599 &ett_cms_DigestAlgorithmIdentifiers,
1600 &ett_cms_SignerInfos,
1601 &ett_cms_EncapsulatedContentInfo,
1602 &ett_cms_SignerInfo,
1603 &ett_cms_SignerIdentifier,
1604 &ett_cms_SignedAttributes,
1605 &ett_cms_UnsignedAttributes,
1607 &ett_cms_EnvelopedData,
1608 &ett_cms_OriginatorInfo,
1609 &ett_cms_RecipientInfos,
1610 &ett_cms_EncryptedContentInfo,
1611 &ett_cms_UnprotectedAttributes,
1612 &ett_cms_RecipientInfo,
1613 &ett_cms_KeyTransRecipientInfo,
1614 &ett_cms_RecipientIdentifier,
1615 &ett_cms_KeyAgreeRecipientInfo,
1616 &ett_cms_OriginatorIdentifierOrKey,
1617 &ett_cms_OriginatorPublicKey,
1618 &ett_cms_RecipientEncryptedKeys,
1619 &ett_cms_RecipientEncryptedKey,
1620 &ett_cms_KeyAgreeRecipientIdentifier,
1621 &ett_cms_RecipientKeyIdentifier,
1622 &ett_cms_KEKRecipientInfo,
1623 &ett_cms_KEKIdentifier,
1624 &ett_cms_DigestedData,
1625 &ett_cms_EncryptedData,
1626 &ett_cms_AuthenticatedData,
1627 &ett_cms_AuthAttributes,
1628 &ett_cms_UnauthAttributes,
1629 &ett_cms_CertificateRevocationLists,
1630 &ett_cms_CertificateChoices,
1631 &ett_cms_CertificateSet,
1632 &ett_cms_IssuerAndSerialNumber,
1633 &ett_cms_OtherKeyAttribute,
1634 &ett_cms_ExtendedCertificate,
1635 &ett_cms_ExtendedCertificateInfo,
1637 /*--- End of included file: packet-cms-ettarr.c ---*/
1641 /* Register protocol */
1642 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
1644 /* Register fields and subtrees */
1645 proto_register_field_array(proto_cms, hf, array_length(hf));
1646 proto_register_subtree_array(ett, array_length(ett));
1651 /*--- proto_reg_handoff_cms -------------------------------------------*/
1652 void proto_reg_handoff_cms(void) {
1654 /*--- Included file: packet-cms-dis-tab.c ---*/
1656 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
1657 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
1658 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
1659 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
1660 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
1663 /*--- End of included file: packet-cms-dis-tab.c ---*/