1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler */
4 /* ../../tools/asn2eth.py -X -b -k -e -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
10 * Ronnie Sahlberg 2004
12 * $Id: packet-cms-template.c 12434 2004-10-29 12:11:42Z sahlberg $
14 * Ethereal - Network traffic analyzer
15 * By Gerald Combs <gerald@ethereal.com>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
39 #include <epan/conversation.h>
44 #include "packet-ber.h"
45 #include "packet-cms.h"
46 #include "packet-x509af.h"
47 #include "packet-x509if.h"
49 #define PNAME "Cryptographic Message Syntax"
53 /* Initialize the protocol and registered fields */
55 static int hf_cms_ci_contentType = -1;
57 /*--- Included file: packet-cms-hf.c ---*/
59 static int hf_cms_SignedData_PDU = -1; /* SignedData */
60 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
61 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
62 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
63 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
64 static int hf_cms_contentType = -1; /* T_contentType */
65 static int hf_cms_content = -1; /* T_content */
66 static int hf_cms_version = -1; /* CMSVersion */
67 static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
68 static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
69 static int hf_cms_certificates = -1; /* CertificateSet */
70 static int hf_cms_crls = -1; /* CertificateRevocationLists */
71 static int hf_cms_signerInfos = -1; /* SignerInfos */
72 static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
73 static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
74 static int hf_cms_eContentType = -1; /* T_eContentType */
75 static int hf_cms_eContent = -1; /* T_eContent */
76 static int hf_cms_sid = -1; /* SignerIdentifier */
77 static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
78 static int hf_cms_signedAttrs = -1; /* SignedAttributes */
79 static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
80 static int hf_cms_signatureValue = -1; /* SignatureValue */
81 static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
82 static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
83 static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
84 static int hf_cms_SignedAttributes_item = -1; /* Attribute */
85 static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
86 static int hf_cms_attrType = -1; /* OBJECT_IDENTIFIER */
87 static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
88 static int hf_cms_recipientInfos = -1; /* RecipientInfos */
89 static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
90 static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
91 static int hf_cms_certs = -1; /* CertificateSet */
92 static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
93 static int hf_cms_contentType1 = -1; /* ContentType */
94 static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
95 static int hf_cms_encryptedContent = -1; /* EncryptedContent */
96 static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
97 static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
98 static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
99 static int hf_cms_kekri = -1; /* KEKRecipientInfo */
100 static int hf_cms_rid = -1; /* RecipientIdentifier */
101 static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
102 static int hf_cms_encryptedKey = -1; /* EncryptedKey */
103 static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
104 static int hf_cms_ukm = -1; /* UserKeyingMaterial */
105 static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
106 static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
107 static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
108 static int hf_cms_publicKey = -1; /* BIT_STRING */
109 static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
110 static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
111 static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
112 static int hf_cms_date = -1; /* GeneralizedTime */
113 static int hf_cms_other = -1; /* OtherKeyAttribute */
114 static int hf_cms_kekid = -1; /* KEKIdentifier */
115 static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
116 static int hf_cms_digest = -1; /* Digest */
117 static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
118 static int hf_cms_authenticatedAttributes = -1; /* AuthAttributes */
119 static int hf_cms_mac = -1; /* MessageAuthenticationCode */
120 static int hf_cms_unauthenticatedAttributes = -1; /* UnauthAttributes */
121 static int hf_cms_AuthAttributes_item = -1; /* Attribute */
122 static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
123 static int hf_cms_CertificateRevocationLists_item = -1; /* CertificateList */
124 static int hf_cms_certificate = -1; /* Certificate */
125 static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
126 static int hf_cms_attrCert = -1; /* AttributeCertificate */
127 static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
128 static int hf_cms_issuer = -1; /* Name */
129 static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
130 static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
131 static int hf_cms_keyAttr = -1; /* T_keyAttr */
132 static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
133 static int hf_cms_signature = -1; /* Signature */
134 static int hf_cms_attributes = -1; /* UnauthAttributes */
136 /*--- End of included file: packet-cms-hf.c ---*/
139 /* Initialize the subtree pointers */
141 /*--- Included file: packet-cms-ett.c ---*/
143 static gint ett_cms_ContentInfo = -1;
144 static gint ett_cms_SignedData = -1;
145 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
146 static gint ett_cms_SignerInfos = -1;
147 static gint ett_cms_EncapsulatedContentInfo = -1;
148 static gint ett_cms_SignerInfo = -1;
149 static gint ett_cms_SignerIdentifier = -1;
150 static gint ett_cms_SignedAttributes = -1;
151 static gint ett_cms_UnsignedAttributes = -1;
152 static gint ett_cms_Attribute = -1;
153 static gint ett_cms_EnvelopedData = -1;
154 static gint ett_cms_OriginatorInfo = -1;
155 static gint ett_cms_RecipientInfos = -1;
156 static gint ett_cms_EncryptedContentInfo = -1;
157 static gint ett_cms_UnprotectedAttributes = -1;
158 static gint ett_cms_RecipientInfo = -1;
159 static gint ett_cms_KeyTransRecipientInfo = -1;
160 static gint ett_cms_RecipientIdentifier = -1;
161 static gint ett_cms_KeyAgreeRecipientInfo = -1;
162 static gint ett_cms_OriginatorIdentifierOrKey = -1;
163 static gint ett_cms_OriginatorPublicKey = -1;
164 static gint ett_cms_RecipientEncryptedKeys = -1;
165 static gint ett_cms_RecipientEncryptedKey = -1;
166 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
167 static gint ett_cms_RecipientKeyIdentifier = -1;
168 static gint ett_cms_KEKRecipientInfo = -1;
169 static gint ett_cms_KEKIdentifier = -1;
170 static gint ett_cms_DigestedData = -1;
171 static gint ett_cms_EncryptedData = -1;
172 static gint ett_cms_AuthenticatedData = -1;
173 static gint ett_cms_AuthAttributes = -1;
174 static gint ett_cms_UnauthAttributes = -1;
175 static gint ett_cms_CertificateRevocationLists = -1;
176 static gint ett_cms_CertificateChoices = -1;
177 static gint ett_cms_CertificateSet = -1;
178 static gint ett_cms_IssuerAndSerialNumber = -1;
179 static gint ett_cms_OtherKeyAttribute = -1;
180 static gint ett_cms_ExtendedCertificate = -1;
181 static gint ett_cms_ExtendedCertificateInfo = -1;
183 /*--- End of included file: packet-cms-ett.c ---*/
186 static char object_identifier_id[64]; /*64 chars should be long enough? */
189 /*--- Included file: packet-cms-fn.c ---*/
191 /*--- Fields for imported types ---*/
193 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
194 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm);
196 static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
197 return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item);
199 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
200 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate);
202 static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
203 return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert);
205 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
206 return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_cms_issuer);
208 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
209 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber);
214 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
215 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
220 static int dissect_contentType1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
221 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType1);
226 dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
227 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
228 hf_cms_ci_contentType, object_identifier_id);
233 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
234 return dissect_cms_T_contentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType);
240 dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
241 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
246 static int dissect_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
247 return dissect_cms_T_content(FALSE, tvb, offset, pinfo, tree, hf_cms_content);
250 static const ber_sequence ContentInfo_sequence[] = {
251 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
252 { BER_CLASS_CON, 0, 0, dissect_content },
257 dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
258 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
259 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
265 static const value_string CMSVersion_vals[] = {
276 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
277 offset = dissect_ber_integer_new(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
281 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
282 return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version);
287 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
288 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
292 static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
293 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item);
295 static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
296 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
298 static int dissect_digestAlgorithm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
299 return dissect_cms_DigestAlgorithmIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
302 static const ber_sequence DigestAlgorithmIdentifiers_set_of[1] = {
303 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item },
307 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
308 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
309 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
313 static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
314 return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms);
319 dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
320 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
321 hf_cms_ci_contentType, object_identifier_id);
326 static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
327 return dissect_cms_T_eContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
332 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
336 int pdu_offset = offset;
338 /* XXX Do we care about printing out the octet string? */
339 offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
341 pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
342 pdu_offset = get_ber_length(tvb, pdu_offset, &len, &ind);
343 pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, tree);
348 static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
349 return dissect_cms_T_eContent(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
352 static const ber_sequence EncapsulatedContentInfo_sequence[] = {
353 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType },
354 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent },
359 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
360 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
361 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
365 static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
366 return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
371 dissect_cms_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
372 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
377 static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
378 return dissect_cms_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType);
381 static const ber_sequence Attribute_sequence[] = {
382 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType },
387 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
388 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
389 Attribute_sequence, hf_index, ett_cms_Attribute);
393 static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
394 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item);
396 static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
397 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item);
399 static int dissect_UnprotectedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
400 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnprotectedAttributes_item);
402 static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
403 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item);
405 static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
406 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item);
409 static const ber_sequence UnauthAttributes_set_of[1] = {
410 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item },
414 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
415 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
416 UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
420 static int dissect_unauthenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
421 return dissect_cms_UnauthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unauthenticatedAttributes);
423 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
424 return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes);
427 static const ber_sequence ExtendedCertificateInfo_sequence[] = {
428 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
429 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
430 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes },
435 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
436 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
437 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
441 static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
442 return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo);
447 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
448 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
452 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
453 return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm);
458 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
459 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
465 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
466 return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature);
469 static const ber_sequence ExtendedCertificate_sequence[] = {
470 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo },
471 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
472 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
477 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
478 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
479 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
483 static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
484 return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate);
488 static const value_string CertificateChoices_vals[] = {
489 { 0, "certificate" },
490 { 1, "extendedCertificate" },
495 static const ber_choice CertificateChoices_choice[] = {
496 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
497 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl },
498 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl },
503 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
504 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
505 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices);
509 static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
510 return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item);
513 static const ber_sequence CertificateSet_set_of[1] = {
514 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item },
518 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
519 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
520 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
524 static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
525 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates);
527 static int dissect_certs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
528 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certs);
531 static const ber_sequence CertificateRevocationLists_set_of[1] = {
532 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item },
536 dissect_cms_CertificateRevocationLists(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
537 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
538 CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists);
542 static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
543 return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls);
546 static const ber_sequence IssuerAndSerialNumber_sequence[] = {
547 { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
548 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
553 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
554 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
555 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
559 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
560 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber);
565 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
566 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
571 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
572 return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
574 static int dissect_subjectKeyIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
575 return dissect_cms_SubjectKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
579 const value_string SignerIdentifier_vals[] = {
580 { 0, "issuerAndSerialNumber" },
581 { 1, "subjectKeyIdentifier" },
585 static const ber_choice SignerIdentifier_choice[] = {
586 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
587 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
592 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
593 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
594 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier);
598 static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
599 return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid);
602 static const ber_sequence SignedAttributes_set_of[1] = {
603 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item },
607 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
608 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
609 SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
613 static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
614 return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs);
619 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
620 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
625 static int dissect_signatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
626 return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureValue);
629 static const ber_sequence UnsignedAttributes_set_of[1] = {
630 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item },
634 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
635 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
636 UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
640 static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
641 return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs);
644 static const ber_sequence SignerInfo_sequence[] = {
645 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
646 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid },
647 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
648 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl },
649 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
650 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signatureValue },
651 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl },
656 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
657 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
658 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
662 static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
663 return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item);
666 static const ber_sequence SignerInfos_set_of[1] = {
667 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item },
671 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
672 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
673 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
677 static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
678 return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos);
681 static const ber_sequence SignedData_sequence[] = {
682 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
683 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms },
684 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
685 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl },
686 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
687 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos },
692 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
693 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
694 SignedData_sequence, hf_index, ett_cms_SignedData);
699 static const ber_sequence OriginatorInfo_sequence[] = {
700 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certs_impl },
701 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
706 dissect_cms_OriginatorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
707 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
708 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
712 static int dissect_originatorInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
713 return dissect_cms_OriginatorInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorInfo);
717 static const value_string RecipientIdentifier_vals[] = {
718 { 0, "issuerAndSerialNumber" },
719 { 1, "subjectKeyIdentifier" },
723 static const ber_choice RecipientIdentifier_choice[] = {
724 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
725 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
730 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
731 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
732 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier);
736 static int dissect_rid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
737 return dissect_cms_RecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rid);
742 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
743 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
747 static int dissect_keyEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
748 return dissect_cms_KeyEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_keyEncryptionAlgorithm);
753 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
754 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
759 static int dissect_encryptedKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
760 return dissect_cms_EncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedKey);
763 static const ber_sequence KeyTransRecipientInfo_sequence[] = {
764 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
765 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rid },
766 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
767 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
772 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
773 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
774 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
778 static int dissect_ktri(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
779 return dissect_cms_KeyTransRecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_ktri);
784 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
785 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
791 static int dissect_publicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
792 return dissect_cms_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_publicKey);
795 static const ber_sequence OriginatorPublicKey_sequence[] = {
796 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
797 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_publicKey },
802 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
803 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
804 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
808 static int dissect_originatorKey_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
809 return dissect_cms_OriginatorPublicKey(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorKey);
813 static const value_string OriginatorIdentifierOrKey_vals[] = {
814 { 0, "issuerAndSerialNumber" },
815 { 1, "subjectKeyIdentifier" },
816 { 2, "originatorKey" },
820 static const ber_choice OriginatorIdentifierOrKey_choice[] = {
821 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
822 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
823 { 2, BER_CLASS_CON, 1, 0, dissect_originatorKey_impl },
828 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
829 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
830 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey);
834 static int dissect_originator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
835 return dissect_cms_OriginatorIdentifierOrKey(FALSE, tvb, offset, pinfo, tree, hf_cms_originator);
840 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
841 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
846 static int dissect_ukm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
847 return dissect_cms_UserKeyingMaterial(FALSE, tvb, offset, pinfo, tree, hf_cms_ukm);
852 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
853 offset = dissect_ber_generalized_time(pinfo, tree, tvb, offset, hf_index);
857 static int dissect_date(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
858 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_date);
863 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
864 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
865 hf_cms_ci_contentType, object_identifier_id);
870 static int dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
871 return dissect_cms_T_keyAttrId(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttrId);
877 dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
878 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
883 static int dissect_keyAttr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
884 return dissect_cms_T_keyAttr(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttr);
887 static const ber_sequence OtherKeyAttribute_sequence[] = {
888 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId },
889 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_keyAttr },
894 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
895 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
896 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
900 static int dissect_other(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
901 return dissect_cms_OtherKeyAttribute(FALSE, tvb, offset, pinfo, tree, hf_cms_other);
904 static const ber_sequence RecipientKeyIdentifier_sequence[] = {
905 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
906 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
907 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
912 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
913 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
914 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
918 static int dissect_rKeyId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
919 return dissect_cms_RecipientKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_rKeyId);
923 static const value_string KeyAgreeRecipientIdentifier_vals[] = {
924 { 0, "issuerAndSerialNumber" },
929 static const ber_choice KeyAgreeRecipientIdentifier_choice[] = {
930 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
931 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_rKeyId_impl },
936 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
937 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
938 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier);
942 static int dissect_rekRid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
943 return dissect_cms_KeyAgreeRecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rekRid);
946 static const ber_sequence RecipientEncryptedKey_sequence[] = {
947 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rekRid },
948 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
953 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
954 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
955 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
959 static int dissect_RecipientEncryptedKeys_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
960 return dissect_cms_RecipientEncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientEncryptedKeys_item);
963 static const ber_sequence RecipientEncryptedKeys_sequence_of[1] = {
964 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RecipientEncryptedKeys_item },
968 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
969 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
970 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
974 static int dissect_recipientEncryptedKeys(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
975 return dissect_cms_RecipientEncryptedKeys(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientEncryptedKeys);
978 static const ber_sequence KeyAgreeRecipientInfo_sequence[] = {
979 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
980 { BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_originator },
981 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ukm },
982 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
983 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_recipientEncryptedKeys },
988 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
989 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
990 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
994 static int dissect_kari_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
995 return dissect_cms_KeyAgreeRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kari);
1000 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1001 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1006 static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1007 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
1010 static const ber_sequence KEKIdentifier_sequence[] = {
1011 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_keyIdentifier },
1012 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1013 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1018 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1019 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1020 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1024 static int dissect_kekid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1025 return dissect_cms_KEKIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_kekid);
1028 static const ber_sequence KEKRecipientInfo_sequence[] = {
1029 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1030 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_kekid },
1031 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1032 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1037 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1038 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1039 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1043 static int dissect_kekri_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1044 return dissect_cms_KEKRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kekri);
1048 static const value_string RecipientInfo_vals[] = {
1055 static const ber_choice RecipientInfo_choice[] = {
1056 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ktri },
1057 { 1, BER_CLASS_CON, 1, 0, dissect_kari_impl },
1058 { 2, BER_CLASS_CON, 2, 0, dissect_kekri_impl },
1059 { 0, 0, 0, 0, NULL }
1063 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1064 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1065 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo);
1069 static int dissect_RecipientInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1070 return dissect_cms_RecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientInfos_item);
1073 static const ber_sequence RecipientInfos_set_of[1] = {
1074 { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_RecipientInfos_item },
1078 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1079 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1080 RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1084 static int dissect_recipientInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1085 return dissect_cms_RecipientInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientInfos);
1090 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1091 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1095 static int dissect_contentEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1096 return dissect_cms_ContentEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_contentEncryptionAlgorithm);
1101 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1102 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1107 static int dissect_encryptedContent_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1108 return dissect_cms_EncryptedContent(TRUE, tvb, offset, pinfo, tree, hf_cms_encryptedContent);
1111 static const ber_sequence EncryptedContentInfo_sequence[] = {
1112 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType1 },
1113 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_contentEncryptionAlgorithm },
1114 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_encryptedContent_impl },
1119 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1120 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1121 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1125 static int dissect_encryptedContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1126 return dissect_cms_EncryptedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentInfo);
1129 static const ber_sequence UnprotectedAttributes_set_of[1] = {
1130 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnprotectedAttributes_item },
1134 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1135 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1136 UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1140 static int dissect_unprotectedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1141 return dissect_cms_UnprotectedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unprotectedAttrs);
1144 static const ber_sequence EnvelopedData_sequence[] = {
1145 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1146 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1147 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1148 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1149 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1154 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1155 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1156 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1163 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1164 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1169 static int dissect_digest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1170 return dissect_cms_Digest(FALSE, tvb, offset, pinfo, tree, hf_cms_digest);
1173 static const ber_sequence DigestedData_sequence[] = {
1174 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1175 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
1176 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1177 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_digest },
1182 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1183 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1184 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1189 static const ber_sequence EncryptedData_sequence[] = {
1190 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1191 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1192 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1197 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1198 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1199 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1206 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1207 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1211 static int dissect_macAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1212 return dissect_cms_MessageAuthenticationCodeAlgorithm(FALSE, tvb, offset, pinfo, tree, hf_cms_macAlgorithm);
1215 static const ber_sequence AuthAttributes_set_of[1] = {
1216 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item },
1220 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1221 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1222 AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1226 static int dissect_authenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1227 return dissect_cms_AuthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_authenticatedAttributes);
1232 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1233 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1238 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1239 return dissect_cms_MessageAuthenticationCode(FALSE, tvb, offset, pinfo, tree, hf_cms_mac);
1242 static const ber_sequence AuthenticatedData_sequence[] = {
1243 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1244 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1245 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1246 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_macAlgorithm },
1247 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_digestAlgorithm_impl },
1248 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1249 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_authenticatedAttributes_impl },
1250 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mac },
1251 { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unauthenticatedAttributes_impl },
1256 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1257 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1258 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1265 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1266 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1273 static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1274 dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
1276 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1277 dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
1279 static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1280 dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
1282 static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1283 dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
1285 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1286 dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
1290 /*--- End of included file: packet-cms-fn.c ---*/
1294 /*--- proto_register_cms ----------------------------------------------*/
1295 void proto_register_cms(void) {
1297 /* List of fields */
1298 static hf_register_info hf[] = {
1299 { &hf_cms_ci_contentType,
1300 { "contentType", "cms.contentInfo.contentType",
1301 FT_STRING, BASE_NONE, NULL, 0,
1302 "ContentType", HFILL }},
1304 /*--- Included file: packet-cms-hfarr.c ---*/
1306 { &hf_cms_SignedData_PDU,
1307 { "SignedData", "cms.SignedData",
1308 FT_NONE, BASE_NONE, NULL, 0,
1309 "SignedData", HFILL }},
1310 { &hf_cms_EnvelopedData_PDU,
1311 { "EnvelopedData", "cms.EnvelopedData",
1312 FT_NONE, BASE_NONE, NULL, 0,
1313 "EnvelopedData", HFILL }},
1314 { &hf_cms_DigestedData_PDU,
1315 { "DigestedData", "cms.DigestedData",
1316 FT_NONE, BASE_NONE, NULL, 0,
1317 "DigestedData", HFILL }},
1318 { &hf_cms_EncryptedData_PDU,
1319 { "EncryptedData", "cms.EncryptedData",
1320 FT_NONE, BASE_NONE, NULL, 0,
1321 "EncryptedData", HFILL }},
1322 { &hf_cms_AuthenticatedData_PDU,
1323 { "AuthenticatedData", "cms.AuthenticatedData",
1324 FT_NONE, BASE_NONE, NULL, 0,
1325 "AuthenticatedData", HFILL }},
1326 { &hf_cms_contentType,
1327 { "contentType", "cms.contentType",
1328 FT_STRING, BASE_NONE, NULL, 0,
1329 "ContentInfo/contentType", HFILL }},
1331 { "content", "cms.content",
1332 FT_NONE, BASE_NONE, NULL, 0,
1333 "ContentInfo/content", HFILL }},
1335 { "version", "cms.version",
1336 FT_INT32, BASE_DEC, VALS(CMSVersion_vals), 0,
1338 { &hf_cms_digestAlgorithms,
1339 { "digestAlgorithms", "cms.digestAlgorithms",
1340 FT_UINT32, BASE_DEC, NULL, 0,
1341 "SignedData/digestAlgorithms", HFILL }},
1342 { &hf_cms_encapContentInfo,
1343 { "encapContentInfo", "cms.encapContentInfo",
1344 FT_NONE, BASE_NONE, NULL, 0,
1346 { &hf_cms_certificates,
1347 { "certificates", "cms.certificates",
1348 FT_UINT32, BASE_DEC, NULL, 0,
1349 "SignedData/certificates", HFILL }},
1351 { "crls", "cms.crls",
1352 FT_UINT32, BASE_DEC, NULL, 0,
1354 { &hf_cms_signerInfos,
1355 { "signerInfos", "cms.signerInfos",
1356 FT_UINT32, BASE_DEC, NULL, 0,
1357 "SignedData/signerInfos", HFILL }},
1358 { &hf_cms_DigestAlgorithmIdentifiers_item,
1359 { "Item", "cms.DigestAlgorithmIdentifiers_item",
1360 FT_NONE, BASE_NONE, NULL, 0,
1361 "DigestAlgorithmIdentifiers/_item", HFILL }},
1362 { &hf_cms_SignerInfos_item,
1363 { "Item", "cms.SignerInfos_item",
1364 FT_NONE, BASE_NONE, NULL, 0,
1365 "SignerInfos/_item", HFILL }},
1366 { &hf_cms_eContentType,
1367 { "eContentType", "cms.eContentType",
1368 FT_STRING, BASE_NONE, NULL, 0,
1369 "EncapsulatedContentInfo/eContentType", HFILL }},
1371 { "eContent", "cms.eContent",
1372 FT_BYTES, BASE_HEX, NULL, 0,
1373 "EncapsulatedContentInfo/eContent", HFILL }},
1376 FT_UINT32, BASE_DEC, VALS(SignerIdentifier_vals), 0,
1377 "SignerInfo/sid", HFILL }},
1378 { &hf_cms_digestAlgorithm,
1379 { "digestAlgorithm", "cms.digestAlgorithm",
1380 FT_NONE, BASE_NONE, NULL, 0,
1382 { &hf_cms_signedAttrs,
1383 { "signedAttrs", "cms.signedAttrs",
1384 FT_UINT32, BASE_DEC, NULL, 0,
1385 "SignerInfo/signedAttrs", HFILL }},
1386 { &hf_cms_signatureAlgorithm,
1387 { "signatureAlgorithm", "cms.signatureAlgorithm",
1388 FT_NONE, BASE_NONE, NULL, 0,
1390 { &hf_cms_signatureValue,
1391 { "signature", "cms.signature",
1392 FT_BYTES, BASE_HEX, NULL, 0,
1393 "SignerInfo/signature", HFILL }},
1394 { &hf_cms_unsignedAttrs,
1395 { "unsignedAttrs", "cms.unsignedAttrs",
1396 FT_UINT32, BASE_DEC, NULL, 0,
1397 "SignerInfo/unsignedAttrs", HFILL }},
1398 { &hf_cms_issuerAndSerialNumber,
1399 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber",
1400 FT_NONE, BASE_NONE, NULL, 0,
1402 { &hf_cms_subjectKeyIdentifier,
1403 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1404 FT_BYTES, BASE_HEX, NULL, 0,
1406 { &hf_cms_SignedAttributes_item,
1407 { "Item", "cms.SignedAttributes_item",
1408 FT_NONE, BASE_NONE, NULL, 0,
1409 "SignedAttributes/_item", HFILL }},
1410 { &hf_cms_UnsignedAttributes_item,
1411 { "Item", "cms.UnsignedAttributes_item",
1412 FT_NONE, BASE_NONE, NULL, 0,
1413 "UnsignedAttributes/_item", HFILL }},
1415 { "attrType", "cms.attrType",
1416 FT_STRING, BASE_NONE, NULL, 0,
1417 "Attribute/attrType", HFILL }},
1418 { &hf_cms_originatorInfo,
1419 { "originatorInfo", "cms.originatorInfo",
1420 FT_NONE, BASE_NONE, NULL, 0,
1422 { &hf_cms_recipientInfos,
1423 { "recipientInfos", "cms.recipientInfos",
1424 FT_UINT32, BASE_DEC, NULL, 0,
1426 { &hf_cms_encryptedContentInfo,
1427 { "encryptedContentInfo", "cms.encryptedContentInfo",
1428 FT_NONE, BASE_NONE, NULL, 0,
1430 { &hf_cms_unprotectedAttrs,
1431 { "unprotectedAttrs", "cms.unprotectedAttrs",
1432 FT_UINT32, BASE_DEC, NULL, 0,
1435 { "certs", "cms.certs",
1436 FT_UINT32, BASE_DEC, NULL, 0,
1437 "OriginatorInfo/certs", HFILL }},
1438 { &hf_cms_RecipientInfos_item,
1439 { "Item", "cms.RecipientInfos_item",
1440 FT_UINT32, BASE_DEC, VALS(RecipientInfo_vals), 0,
1441 "RecipientInfos/_item", HFILL }},
1442 { &hf_cms_contentType1,
1443 { "contentType", "cms.contentType",
1444 FT_STRING, BASE_NONE, NULL, 0,
1445 "EncryptedContentInfo/contentType", HFILL }},
1446 { &hf_cms_contentEncryptionAlgorithm,
1447 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm",
1448 FT_NONE, BASE_NONE, NULL, 0,
1449 "EncryptedContentInfo/contentEncryptionAlgorithm", HFILL }},
1450 { &hf_cms_encryptedContent,
1451 { "encryptedContent", "cms.encryptedContent",
1452 FT_BYTES, BASE_HEX, NULL, 0,
1453 "EncryptedContentInfo/encryptedContent", HFILL }},
1454 { &hf_cms_UnprotectedAttributes_item,
1455 { "Item", "cms.UnprotectedAttributes_item",
1456 FT_NONE, BASE_NONE, NULL, 0,
1457 "UnprotectedAttributes/_item", HFILL }},
1459 { "ktri", "cms.ktri",
1460 FT_NONE, BASE_NONE, NULL, 0,
1461 "RecipientInfo/ktri", HFILL }},
1463 { "kari", "cms.kari",
1464 FT_NONE, BASE_NONE, NULL, 0,
1465 "RecipientInfo/kari", HFILL }},
1467 { "kekri", "cms.kekri",
1468 FT_NONE, BASE_NONE, NULL, 0,
1469 "RecipientInfo/kekri", HFILL }},
1472 FT_UINT32, BASE_DEC, VALS(RecipientIdentifier_vals), 0,
1473 "KeyTransRecipientInfo/rid", HFILL }},
1474 { &hf_cms_keyEncryptionAlgorithm,
1475 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm",
1476 FT_NONE, BASE_NONE, NULL, 0,
1478 { &hf_cms_encryptedKey,
1479 { "encryptedKey", "cms.encryptedKey",
1480 FT_BYTES, BASE_HEX, NULL, 0,
1482 { &hf_cms_originator,
1483 { "originator", "cms.originator",
1484 FT_UINT32, BASE_DEC, VALS(OriginatorIdentifierOrKey_vals), 0,
1485 "KeyAgreeRecipientInfo/originator", HFILL }},
1488 FT_BYTES, BASE_HEX, NULL, 0,
1489 "KeyAgreeRecipientInfo/ukm", HFILL }},
1490 { &hf_cms_recipientEncryptedKeys,
1491 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
1492 FT_UINT32, BASE_DEC, NULL, 0,
1493 "KeyAgreeRecipientInfo/recipientEncryptedKeys", HFILL }},
1494 { &hf_cms_originatorKey,
1495 { "originatorKey", "cms.originatorKey",
1496 FT_NONE, BASE_NONE, NULL, 0,
1497 "OriginatorIdentifierOrKey/originatorKey", HFILL }},
1498 { &hf_cms_algorithm,
1499 { "algorithm", "cms.algorithm",
1500 FT_NONE, BASE_NONE, NULL, 0,
1501 "OriginatorPublicKey/algorithm", HFILL }},
1502 { &hf_cms_publicKey,
1503 { "publicKey", "cms.publicKey",
1504 FT_BYTES, BASE_HEX, NULL, 0,
1505 "OriginatorPublicKey/publicKey", HFILL }},
1506 { &hf_cms_RecipientEncryptedKeys_item,
1507 { "Item", "cms.RecipientEncryptedKeys_item",
1508 FT_NONE, BASE_NONE, NULL, 0,
1509 "RecipientEncryptedKeys/_item", HFILL }},
1512 FT_UINT32, BASE_DEC, VALS(KeyAgreeRecipientIdentifier_vals), 0,
1513 "RecipientEncryptedKey/rid", HFILL }},
1515 { "rKeyId", "cms.rKeyId",
1516 FT_NONE, BASE_NONE, NULL, 0,
1517 "KeyAgreeRecipientIdentifier/rKeyId", HFILL }},
1519 { "date", "cms.date",
1520 FT_STRING, BASE_NONE, NULL, 0,
1523 { "other", "cms.other",
1524 FT_NONE, BASE_NONE, NULL, 0,
1527 { "kekid", "cms.kekid",
1528 FT_NONE, BASE_NONE, NULL, 0,
1529 "KEKRecipientInfo/kekid", HFILL }},
1530 { &hf_cms_keyIdentifier,
1531 { "keyIdentifier", "cms.keyIdentifier",
1532 FT_BYTES, BASE_HEX, NULL, 0,
1533 "KEKIdentifier/keyIdentifier", HFILL }},
1535 { "digest", "cms.digest",
1536 FT_BYTES, BASE_HEX, NULL, 0,
1537 "DigestedData/digest", HFILL }},
1538 { &hf_cms_macAlgorithm,
1539 { "macAlgorithm", "cms.macAlgorithm",
1540 FT_NONE, BASE_NONE, NULL, 0,
1541 "AuthenticatedData/macAlgorithm", HFILL }},
1542 { &hf_cms_authenticatedAttributes,
1543 { "authenticatedAttributes", "cms.authenticatedAttributes",
1544 FT_UINT32, BASE_DEC, NULL, 0,
1545 "AuthenticatedData/authenticatedAttributes", HFILL }},
1548 FT_BYTES, BASE_HEX, NULL, 0,
1549 "AuthenticatedData/mac", HFILL }},
1550 { &hf_cms_unauthenticatedAttributes,
1551 { "unauthenticatedAttributes", "cms.unauthenticatedAttributes",
1552 FT_UINT32, BASE_DEC, NULL, 0,
1553 "AuthenticatedData/unauthenticatedAttributes", HFILL }},
1554 { &hf_cms_AuthAttributes_item,
1555 { "Item", "cms.AuthAttributes_item",
1556 FT_NONE, BASE_NONE, NULL, 0,
1557 "AuthAttributes/_item", HFILL }},
1558 { &hf_cms_UnauthAttributes_item,
1559 { "Item", "cms.UnauthAttributes_item",
1560 FT_NONE, BASE_NONE, NULL, 0,
1561 "UnauthAttributes/_item", HFILL }},
1562 { &hf_cms_CertificateRevocationLists_item,
1563 { "Item", "cms.CertificateRevocationLists_item",
1564 FT_NONE, BASE_NONE, NULL, 0,
1565 "CertificateRevocationLists/_item", HFILL }},
1566 { &hf_cms_certificate,
1567 { "certificate", "cms.certificate",
1568 FT_NONE, BASE_NONE, NULL, 0,
1570 { &hf_cms_extendedCertificate,
1571 { "extendedCertificate", "cms.extendedCertificate",
1572 FT_NONE, BASE_NONE, NULL, 0,
1573 "CertificateChoices/extendedCertificate", HFILL }},
1575 { "attrCert", "cms.attrCert",
1576 FT_NONE, BASE_NONE, NULL, 0,
1577 "CertificateChoices/attrCert", HFILL }},
1578 { &hf_cms_CertificateSet_item,
1579 { "Item", "cms.CertificateSet_item",
1580 FT_UINT32, BASE_DEC, VALS(CertificateChoices_vals), 0,
1581 "CertificateSet/_item", HFILL }},
1583 { "issuer", "cms.issuer",
1584 FT_UINT32, BASE_DEC, VALS(Name_vals), 0,
1585 "IssuerAndSerialNumber/issuer", HFILL }},
1586 { &hf_cms_serialNumber,
1587 { "serialNumber", "cms.serialNumber",
1588 FT_INT32, BASE_DEC, NULL, 0,
1589 "IssuerAndSerialNumber/serialNumber", HFILL }},
1590 { &hf_cms_keyAttrId,
1591 { "keyAttrId", "cms.keyAttrId",
1592 FT_STRING, BASE_NONE, NULL, 0,
1593 "OtherKeyAttribute/keyAttrId", HFILL }},
1595 { "keyAttr", "cms.keyAttr",
1596 FT_NONE, BASE_NONE, NULL, 0,
1597 "OtherKeyAttribute/keyAttr", HFILL }},
1598 { &hf_cms_extendedCertificateInfo,
1599 { "extendedCertificateInfo", "cms.extendedCertificateInfo",
1600 FT_NONE, BASE_NONE, NULL, 0,
1601 "ExtendedCertificate/extendedCertificateInfo", HFILL }},
1602 { &hf_cms_signature,
1603 { "signature", "cms.signature",
1604 FT_BYTES, BASE_HEX, NULL, 0,
1605 "ExtendedCertificate/signature", HFILL }},
1606 { &hf_cms_attributes,
1607 { "attributes", "cms.attributes",
1608 FT_UINT32, BASE_DEC, NULL, 0,
1609 "ExtendedCertificateInfo/attributes", HFILL }},
1611 /*--- End of included file: packet-cms-hfarr.c ---*/
1615 /* List of subtrees */
1616 static gint *ett[] = {
1618 /*--- Included file: packet-cms-ettarr.c ---*/
1620 &ett_cms_ContentInfo,
1621 &ett_cms_SignedData,
1622 &ett_cms_DigestAlgorithmIdentifiers,
1623 &ett_cms_SignerInfos,
1624 &ett_cms_EncapsulatedContentInfo,
1625 &ett_cms_SignerInfo,
1626 &ett_cms_SignerIdentifier,
1627 &ett_cms_SignedAttributes,
1628 &ett_cms_UnsignedAttributes,
1630 &ett_cms_EnvelopedData,
1631 &ett_cms_OriginatorInfo,
1632 &ett_cms_RecipientInfos,
1633 &ett_cms_EncryptedContentInfo,
1634 &ett_cms_UnprotectedAttributes,
1635 &ett_cms_RecipientInfo,
1636 &ett_cms_KeyTransRecipientInfo,
1637 &ett_cms_RecipientIdentifier,
1638 &ett_cms_KeyAgreeRecipientInfo,
1639 &ett_cms_OriginatorIdentifierOrKey,
1640 &ett_cms_OriginatorPublicKey,
1641 &ett_cms_RecipientEncryptedKeys,
1642 &ett_cms_RecipientEncryptedKey,
1643 &ett_cms_KeyAgreeRecipientIdentifier,
1644 &ett_cms_RecipientKeyIdentifier,
1645 &ett_cms_KEKRecipientInfo,
1646 &ett_cms_KEKIdentifier,
1647 &ett_cms_DigestedData,
1648 &ett_cms_EncryptedData,
1649 &ett_cms_AuthenticatedData,
1650 &ett_cms_AuthAttributes,
1651 &ett_cms_UnauthAttributes,
1652 &ett_cms_CertificateRevocationLists,
1653 &ett_cms_CertificateChoices,
1654 &ett_cms_CertificateSet,
1655 &ett_cms_IssuerAndSerialNumber,
1656 &ett_cms_OtherKeyAttribute,
1657 &ett_cms_ExtendedCertificate,
1658 &ett_cms_ExtendedCertificateInfo,
1660 /*--- End of included file: packet-cms-ettarr.c ---*/
1664 /* Register protocol */
1665 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
1667 /* Register fields and subtrees */
1668 proto_register_field_array(proto_cms, hf, array_length(hf));
1669 proto_register_subtree_array(ett, array_length(ett));
1674 /*--- proto_reg_handoff_cms -------------------------------------------*/
1675 void proto_reg_handoff_cms(void) {
1677 /*--- Included file: packet-cms-dis-tab.c ---*/
1679 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
1680 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
1681 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
1682 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
1683 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
1686 /*--- End of included file: packet-cms-dis-tab.c ---*/