1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2wrs.py -b -e -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */
6 /* Input file: packet-cms-template.c */
8 #line 1 "packet-cms-template.c"
10 * Routines for RFC2630 Cryptographic Message Syntax packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
40 #include <epan/conversation.h>
45 #include "packet-ber.h"
46 #include "packet-cms.h"
47 #include "packet-x509af.h"
48 #include "packet-x509if.h"
50 #include <epan/sha1.h>
51 #include <epan/crypt-md5.h>
53 #define PNAME "Cryptographic Message Syntax"
57 /* Initialize the protocol and registered fields */
59 static int hf_cms_ci_contentType = -1;
61 /*--- Included file: packet-cms-hf.c ---*/
62 #line 1 "packet-cms-hf.c"
63 static int hf_cms_ContentInfo_PDU = -1; /* ContentInfo */
64 static int hf_cms_ContentType_PDU = -1; /* ContentType */
65 static int hf_cms_SignedData_PDU = -1; /* SignedData */
66 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
67 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
68 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
69 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
70 static int hf_cms_MessageDigest_PDU = -1; /* MessageDigest */
71 static int hf_cms_SigningTime_PDU = -1; /* SigningTime */
72 static int hf_cms_Countersignature_PDU = -1; /* Countersignature */
73 static int hf_cms_contentType = -1; /* T_contentType */
74 static int hf_cms_content = -1; /* T_content */
75 static int hf_cms_version = -1; /* CMSVersion */
76 static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
77 static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
78 static int hf_cms_certificates = -1; /* CertificateSet */
79 static int hf_cms_crls = -1; /* CertificateRevocationLists */
80 static int hf_cms_signerInfos = -1; /* SignerInfos */
81 static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
82 static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
83 static int hf_cms_eContentType = -1; /* T_eContentType */
84 static int hf_cms_eContent = -1; /* T_eContent */
85 static int hf_cms_sid = -1; /* SignerIdentifier */
86 static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
87 static int hf_cms_signedAttrs = -1; /* SignedAttributes */
88 static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
89 static int hf_cms_signatureValue = -1; /* SignatureValue */
90 static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
91 static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
92 static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
93 static int hf_cms_SignedAttributes_item = -1; /* Attribute */
94 static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
95 static int hf_cms_attrType = -1; /* T_attrType */
96 static int hf_cms_attrValues = -1; /* SET_OF_AttributeValue */
97 static int hf_cms_attrValues_item = -1; /* AttributeValue */
98 static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
99 static int hf_cms_recipientInfos = -1; /* RecipientInfos */
100 static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
101 static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
102 static int hf_cms_certs = -1; /* CertificateSet */
103 static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
104 static int hf_cms_encryptedContentType = -1; /* ContentType */
105 static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
106 static int hf_cms_encryptedContent = -1; /* EncryptedContent */
107 static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
108 static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
109 static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
110 static int hf_cms_kekri = -1; /* KEKRecipientInfo */
111 static int hf_cms_rid = -1; /* RecipientIdentifier */
112 static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
113 static int hf_cms_encryptedKey = -1; /* EncryptedKey */
114 static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
115 static int hf_cms_ukm = -1; /* UserKeyingMaterial */
116 static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
117 static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
118 static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
119 static int hf_cms_publicKey = -1; /* BIT_STRING */
120 static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
121 static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
122 static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
123 static int hf_cms_date = -1; /* GeneralizedTime */
124 static int hf_cms_other = -1; /* OtherKeyAttribute */
125 static int hf_cms_kekid = -1; /* KEKIdentifier */
126 static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
127 static int hf_cms_digest = -1; /* Digest */
128 static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
129 static int hf_cms_authenticatedAttributes = -1; /* AuthAttributes */
130 static int hf_cms_mac = -1; /* MessageAuthenticationCode */
131 static int hf_cms_unauthenticatedAttributes = -1; /* UnauthAttributes */
132 static int hf_cms_AuthAttributes_item = -1; /* Attribute */
133 static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
134 static int hf_cms_CertificateRevocationLists_item = -1; /* CertificateList */
135 static int hf_cms_certificate = -1; /* Certificate */
136 static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
137 static int hf_cms_attrCert = -1; /* AttributeCertificate */
138 static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
139 static int hf_cms_issuer = -1; /* Name */
140 static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
141 static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
142 static int hf_cms_keyAttr = -1; /* T_keyAttr */
143 static int hf_cms_utcTime = -1; /* UTCTime */
144 static int hf_cms_generalTime = -1; /* GeneralizedTime */
145 static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
146 static int hf_cms_signature = -1; /* Signature */
147 static int hf_cms_attributes = -1; /* UnauthAttributes */
149 /*--- End of included file: packet-cms-hf.c ---*/
150 #line 53 "packet-cms-template.c"
152 /* Initialize the subtree pointers */
154 /*--- Included file: packet-cms-ett.c ---*/
155 #line 1 "packet-cms-ett.c"
156 static gint ett_cms_ContentInfo = -1;
157 static gint ett_cms_SignedData = -1;
158 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
159 static gint ett_cms_SignerInfos = -1;
160 static gint ett_cms_EncapsulatedContentInfo = -1;
161 static gint ett_cms_SignerInfo = -1;
162 static gint ett_cms_SignerIdentifier = -1;
163 static gint ett_cms_SignedAttributes = -1;
164 static gint ett_cms_UnsignedAttributes = -1;
165 static gint ett_cms_Attribute = -1;
166 static gint ett_cms_SET_OF_AttributeValue = -1;
167 static gint ett_cms_EnvelopedData = -1;
168 static gint ett_cms_OriginatorInfo = -1;
169 static gint ett_cms_RecipientInfos = -1;
170 static gint ett_cms_EncryptedContentInfo = -1;
171 static gint ett_cms_UnprotectedAttributes = -1;
172 static gint ett_cms_RecipientInfo = -1;
173 static gint ett_cms_KeyTransRecipientInfo = -1;
174 static gint ett_cms_RecipientIdentifier = -1;
175 static gint ett_cms_KeyAgreeRecipientInfo = -1;
176 static gint ett_cms_OriginatorIdentifierOrKey = -1;
177 static gint ett_cms_OriginatorPublicKey = -1;
178 static gint ett_cms_RecipientEncryptedKeys = -1;
179 static gint ett_cms_RecipientEncryptedKey = -1;
180 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
181 static gint ett_cms_RecipientKeyIdentifier = -1;
182 static gint ett_cms_KEKRecipientInfo = -1;
183 static gint ett_cms_KEKIdentifier = -1;
184 static gint ett_cms_DigestedData = -1;
185 static gint ett_cms_EncryptedData = -1;
186 static gint ett_cms_AuthenticatedData = -1;
187 static gint ett_cms_AuthAttributes = -1;
188 static gint ett_cms_UnauthAttributes = -1;
189 static gint ett_cms_CertificateRevocationLists = -1;
190 static gint ett_cms_CertificateChoices = -1;
191 static gint ett_cms_CertificateSet = -1;
192 static gint ett_cms_IssuerAndSerialNumber = -1;
193 static gint ett_cms_OtherKeyAttribute = -1;
194 static gint ett_cms_Time = -1;
195 static gint ett_cms_ExtendedCertificate = -1;
196 static gint ett_cms_ExtendedCertificateInfo = -1;
198 /*--- End of included file: packet-cms-ett.c ---*/
199 #line 56 "packet-cms-template.c"
201 static int dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
204 static const char *object_identifier_id;
205 static tvbuff_t *content_tvb = NULL;
207 static proto_tree *top_tree=NULL;
209 #define HASH_SHA1 "1.3.14.3.2.26"
210 #define SHA1_BUFFER_SIZE 20
212 #define HASH_MD5 "1.2.840.113549.2.5"
213 #define MD5_BUFFER_SIZE 16
217 #define HASH_SHA224 "2.16.840.1.101.3.4.2.4"
218 #define SHA224_BUFFER_SIZE 32 /* actually 28 */
219 #define HASH_SHA256 "2.16.840.1.101.3.4.2.1"
220 #define SHA256_BUFFER_SIZE 32
222 unsigned char digest_buf[MAX(SHA1_BUFFER_SIZE, MD5_BUFFER_SIZE)];
225 cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff_t *tvb, int offset)
227 sha1_context sha1_ctx;
229 int i= 0, buffer_size = 0;
231 /* we only support two algorithms at the moment - if we do add SHA2
232 we should add a registration process to use a registration process */
234 if(strcmp(alg, HASH_SHA1) == 0) {
236 sha1_starts(&sha1_ctx);
238 sha1_update(&sha1_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
239 tvb_length(content));
241 sha1_finish(&sha1_ctx, digest_buf);
243 buffer_size = SHA1_BUFFER_SIZE;
245 } else if(strcmp(alg, HASH_MD5) == 0) {
249 md5_append(&md5_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
250 tvb_length(content));
252 md5_finish(&md5_ctx, digest_buf);
254 buffer_size = MD5_BUFFER_SIZE;
258 /* compare our computed hash with what we have received */
260 if(tvb_bytes_exist(tvb, offset, buffer_size) &&
261 (memcmp(tvb_get_ptr(tvb, offset, buffer_size), digest_buf, buffer_size) != 0)) {
262 proto_item_append_text(pi, " [incorrect, should be ");
263 for(i = 0; i < buffer_size; i++)
264 proto_item_append_text(pi, "%02X", digest_buf[i]);
266 proto_item_append_text(pi, "]");
269 proto_item_append_text(pi, " [correct]");
271 proto_item_append_text(pi, " [unable to verify]");
277 /*--- Included file: packet-cms-fn.c ---*/
278 #line 1 "packet-cms-fn.c"
279 /*--- Fields for imported types ---*/
281 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
282 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm);
284 static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
285 return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item);
287 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
288 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate);
290 static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
291 return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert);
293 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
294 return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_cms_issuer);
296 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
297 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber);
303 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
304 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
308 static int dissect_encryptedContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
309 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentType);
315 dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
317 offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
318 hf_cms_ci_contentType, &object_identifier_id);
324 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
325 return dissect_cms_T_contentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType);
331 dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
333 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
339 static int dissect_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
340 return dissect_cms_T_content(FALSE, tvb, offset, pinfo, tree, hf_cms_content);
344 static const ber_sequence_t ContentInfo_sequence[] = {
345 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
346 { BER_CLASS_CON, 0, 0, dissect_content },
351 dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
354 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
355 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
366 static const value_string cms_CMSVersion_vals[] = {
377 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
378 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
383 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
384 return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version);
390 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
391 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
395 static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
396 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item);
398 static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
399 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
401 static int dissect_digestAlgorithm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
402 return dissect_cms_DigestAlgorithmIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
406 static const ber_sequence_t DigestAlgorithmIdentifiers_set_of[1] = {
407 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item },
411 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
412 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
413 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
417 static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
418 return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms);
424 dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
426 offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
427 hf_cms_ci_contentType, &object_identifier_id);
433 static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
434 return dissect_cms_T_eContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
440 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
446 int pdu_offset = offset;
449 /* XXX Do we care about printing out the octet string? */
450 offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, NULL, hf_cms_eContent);
452 pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
453 content_offset = pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind);
454 pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, top_tree ? top_tree : tree);
456 content_tvb = tvb_new_subset(tvb, content_offset, len, -1);
462 static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
463 return dissect_cms_T_eContent(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
467 static const ber_sequence_t EncapsulatedContentInfo_sequence[] = {
468 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType },
469 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent },
474 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
475 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
476 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
480 static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
481 return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
487 dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
489 const char *name = NULL;
491 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
494 if(object_identifier_id) {
495 name = get_oid_str_name(object_identifier_id);
496 proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
503 static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
504 return dissect_cms_T_attrType(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType);
510 dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
513 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
519 static int dissect_attrValues_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
520 return dissect_cms_AttributeValue(FALSE, tvb, offset, pinfo, tree, hf_cms_attrValues_item);
524 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
525 { BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_attrValues_item },
529 dissect_cms_SET_OF_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
530 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
531 SET_OF_AttributeValue_set_of, hf_index, ett_cms_SET_OF_AttributeValue);
535 static int dissect_attrValues(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
536 return dissect_cms_SET_OF_AttributeValue(FALSE, tvb, offset, pinfo, tree, hf_cms_attrValues);
540 static const ber_sequence_t Attribute_sequence[] = {
541 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType },
542 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attrValues },
547 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
548 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
549 Attribute_sequence, hf_index, ett_cms_Attribute);
553 static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
554 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item);
556 static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
557 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item);
559 static int dissect_UnprotectedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
560 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnprotectedAttributes_item);
562 static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
563 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item);
565 static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
566 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item);
570 static const ber_sequence_t UnauthAttributes_set_of[1] = {
571 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item },
575 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
576 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
577 UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
581 static int dissect_unauthenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
582 return dissect_cms_UnauthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unauthenticatedAttributes);
584 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
585 return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes);
589 static const ber_sequence_t ExtendedCertificateInfo_sequence[] = {
590 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
591 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
592 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes },
597 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
598 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
599 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
603 static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
604 return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo);
610 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
611 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
615 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
616 return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm);
622 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
623 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
629 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
630 return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature);
634 static const ber_sequence_t ExtendedCertificate_sequence[] = {
635 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo },
636 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
637 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
642 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
643 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
644 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
648 static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
649 return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate);
653 static const value_string cms_CertificateChoices_vals[] = {
654 { 0, "certificate" },
655 { 1, "extendedCertificate" },
660 static const ber_choice_t CertificateChoices_choice[] = {
661 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
662 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl },
663 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl },
668 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
669 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
670 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices,
675 static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
676 return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item);
680 static const ber_sequence_t CertificateSet_set_of[1] = {
681 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item },
685 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
686 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
687 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
691 static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
692 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates);
694 static int dissect_certs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
695 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certs);
699 static const ber_sequence_t CertificateRevocationLists_set_of[1] = {
700 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item },
704 dissect_cms_CertificateRevocationLists(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
705 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
706 CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists);
710 static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
711 return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls);
715 static const ber_sequence_t IssuerAndSerialNumber_sequence[] = {
716 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
717 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
722 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
723 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
724 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
728 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
729 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber);
735 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
736 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
741 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
742 return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
744 static int dissect_subjectKeyIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
745 return dissect_cms_SubjectKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
749 const value_string cms_SignerIdentifier_vals[] = {
750 { 0, "issuerAndSerialNumber" },
751 { 1, "subjectKeyIdentifier" },
755 static const ber_choice_t SignerIdentifier_choice[] = {
756 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
757 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_subjectKeyIdentifier_impl },
762 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
763 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
764 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier,
769 static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
770 return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid);
774 static const ber_sequence_t SignedAttributes_set_of[1] = {
775 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item },
779 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
780 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
781 SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
785 static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
786 return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs);
792 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
793 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
798 static int dissect_signatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
799 return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureValue);
803 static const ber_sequence_t UnsignedAttributes_set_of[1] = {
804 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item },
808 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
809 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
810 UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
814 static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
815 return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs);
819 static const ber_sequence_t SignerInfo_sequence[] = {
820 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
821 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid },
822 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
823 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl },
824 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
825 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signatureValue },
826 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl },
831 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
832 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
833 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
837 static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
838 return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item);
842 static const ber_sequence_t SignerInfos_set_of[1] = {
843 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item },
847 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
848 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
849 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
853 static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
854 return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos);
858 static const ber_sequence_t SignedData_sequence[] = {
859 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
860 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms },
861 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
862 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl },
863 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
864 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos },
869 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
870 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
871 SignedData_sequence, hf_index, ett_cms_SignedData);
877 static const ber_sequence_t OriginatorInfo_sequence[] = {
878 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certs_impl },
879 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
884 dissect_cms_OriginatorInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
885 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
886 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
890 static int dissect_originatorInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
891 return dissect_cms_OriginatorInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorInfo);
895 static const value_string cms_RecipientIdentifier_vals[] = {
896 { 0, "issuerAndSerialNumber" },
897 { 1, "subjectKeyIdentifier" },
901 static const ber_choice_t RecipientIdentifier_choice[] = {
902 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
903 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_subjectKeyIdentifier_impl },
908 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
909 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
910 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier,
915 static int dissect_rid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
916 return dissect_cms_RecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rid);
922 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
923 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
927 static int dissect_keyEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
928 return dissect_cms_KeyEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_keyEncryptionAlgorithm);
934 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
935 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
940 static int dissect_encryptedKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
941 return dissect_cms_EncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedKey);
945 static const ber_sequence_t KeyTransRecipientInfo_sequence[] = {
946 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
947 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rid },
948 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
949 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
954 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
955 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
956 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
960 static int dissect_ktri(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
961 return dissect_cms_KeyTransRecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_ktri);
967 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
968 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
974 static int dissect_publicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
975 return dissect_cms_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_publicKey);
979 static const ber_sequence_t OriginatorPublicKey_sequence[] = {
980 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
981 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_publicKey },
986 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
987 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
988 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
992 static int dissect_originatorKey_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
993 return dissect_cms_OriginatorPublicKey(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorKey);
997 static const value_string cms_OriginatorIdentifierOrKey_vals[] = {
998 { 0, "issuerAndSerialNumber" },
999 { 1, "subjectKeyIdentifier" },
1000 { 2, "originatorKey" },
1004 static const ber_choice_t OriginatorIdentifierOrKey_choice[] = {
1005 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
1006 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_subjectKeyIdentifier_impl },
1007 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_originatorKey_impl },
1008 { 0, 0, 0, 0, NULL }
1012 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1013 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1014 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey,
1019 static int dissect_originator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1020 return dissect_cms_OriginatorIdentifierOrKey(FALSE, tvb, offset, pinfo, tree, hf_cms_originator);
1026 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1027 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1032 static int dissect_ukm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1033 return dissect_cms_UserKeyingMaterial(FALSE, tvb, offset, pinfo, tree, hf_cms_ukm);
1039 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1040 offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
1044 static int dissect_date(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1045 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_date);
1047 static int dissect_generalTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1048 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_generalTime);
1054 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1055 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_ci_contentType, &object_identifier_id);
1059 static int dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1060 return dissect_cms_T_keyAttrId(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttrId);
1066 dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1068 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
1075 static int dissect_keyAttr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1076 return dissect_cms_T_keyAttr(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttr);
1080 static const ber_sequence_t OtherKeyAttribute_sequence[] = {
1081 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId },
1082 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_keyAttr },
1087 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1088 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1089 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
1093 static int dissect_other(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1094 return dissect_cms_OtherKeyAttribute(FALSE, tvb, offset, pinfo, tree, hf_cms_other);
1098 static const ber_sequence_t RecipientKeyIdentifier_sequence[] = {
1099 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
1100 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1101 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1106 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1107 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1108 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
1112 static int dissect_rKeyId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1113 return dissect_cms_RecipientKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_rKeyId);
1117 static const value_string cms_KeyAgreeRecipientIdentifier_vals[] = {
1118 { 0, "issuerAndSerialNumber" },
1123 static const ber_choice_t KeyAgreeRecipientIdentifier_choice[] = {
1124 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
1125 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_rKeyId_impl },
1126 { 0, 0, 0, 0, NULL }
1130 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1131 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1132 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier,
1137 static int dissect_rekRid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1138 return dissect_cms_KeyAgreeRecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rekRid);
1142 static const ber_sequence_t RecipientEncryptedKey_sequence[] = {
1143 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rekRid },
1144 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1149 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1150 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1151 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
1155 static int dissect_RecipientEncryptedKeys_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1156 return dissect_cms_RecipientEncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientEncryptedKeys_item);
1160 static const ber_sequence_t RecipientEncryptedKeys_sequence_of[1] = {
1161 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RecipientEncryptedKeys_item },
1165 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1166 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1167 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
1171 static int dissect_recipientEncryptedKeys(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1172 return dissect_cms_RecipientEncryptedKeys(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientEncryptedKeys);
1176 static const ber_sequence_t KeyAgreeRecipientInfo_sequence[] = {
1177 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1178 { BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_originator },
1179 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ukm },
1180 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1181 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_recipientEncryptedKeys },
1186 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1187 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1188 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
1192 static int dissect_kari_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1193 return dissect_cms_KeyAgreeRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kari);
1199 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1200 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1205 static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1206 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
1210 static const ber_sequence_t KEKIdentifier_sequence[] = {
1211 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_keyIdentifier },
1212 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1213 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1218 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1219 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1220 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1224 static int dissect_kekid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1225 return dissect_cms_KEKIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_kekid);
1229 static const ber_sequence_t KEKRecipientInfo_sequence[] = {
1230 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1231 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_kekid },
1232 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1233 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1238 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1239 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1240 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1244 static int dissect_kekri_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1245 return dissect_cms_KEKRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kekri);
1249 static const value_string cms_RecipientInfo_vals[] = {
1256 static const ber_choice_t RecipientInfo_choice[] = {
1257 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ktri },
1258 { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_kari_impl },
1259 { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_kekri_impl },
1260 { 0, 0, 0, 0, NULL }
1264 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1265 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1266 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo,
1271 static int dissect_RecipientInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1272 return dissect_cms_RecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientInfos_item);
1276 static const ber_sequence_t RecipientInfos_set_of[1] = {
1277 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_RecipientInfos_item },
1281 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1282 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1283 RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1287 static int dissect_recipientInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1288 return dissect_cms_RecipientInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientInfos);
1294 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1295 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1299 static int dissect_contentEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1300 return dissect_cms_ContentEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_contentEncryptionAlgorithm);
1306 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1307 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1312 static int dissect_encryptedContent_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1313 return dissect_cms_EncryptedContent(TRUE, tvb, offset, pinfo, tree, hf_cms_encryptedContent);
1317 static const ber_sequence_t EncryptedContentInfo_sequence[] = {
1318 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_encryptedContentType },
1319 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_contentEncryptionAlgorithm },
1320 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_encryptedContent_impl },
1325 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1326 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1327 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1331 static int dissect_encryptedContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1332 return dissect_cms_EncryptedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentInfo);
1336 static const ber_sequence_t UnprotectedAttributes_set_of[1] = {
1337 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnprotectedAttributes_item },
1341 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1342 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1343 UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1347 static int dissect_unprotectedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1348 return dissect_cms_UnprotectedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unprotectedAttrs);
1352 static const ber_sequence_t EnvelopedData_sequence[] = {
1353 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1354 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1355 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1356 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1357 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1362 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1363 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1364 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1372 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1373 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1378 static int dissect_digest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1379 return dissect_cms_Digest(FALSE, tvb, offset, pinfo, tree, hf_cms_digest);
1383 static const ber_sequence_t DigestedData_sequence[] = {
1384 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1385 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
1386 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1387 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_digest },
1392 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1393 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1394 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1400 static const ber_sequence_t EncryptedData_sequence[] = {
1401 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1402 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1403 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1408 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1409 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1410 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1418 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1419 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1423 static int dissect_macAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1424 return dissect_cms_MessageAuthenticationCodeAlgorithm(FALSE, tvb, offset, pinfo, tree, hf_cms_macAlgorithm);
1428 static const ber_sequence_t AuthAttributes_set_of[1] = {
1429 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item },
1433 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1434 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1435 AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1439 static int dissect_authenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1440 return dissect_cms_AuthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_authenticatedAttributes);
1446 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1447 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1452 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1453 return dissect_cms_MessageAuthenticationCode(FALSE, tvb, offset, pinfo, tree, hf_cms_mac);
1457 static const ber_sequence_t AuthenticatedData_sequence[] = {
1458 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1459 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1460 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1461 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_macAlgorithm },
1462 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_digestAlgorithm_impl },
1463 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1464 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_authenticatedAttributes_impl },
1465 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mac },
1466 { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unauthenticatedAttributes_impl },
1471 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1472 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1473 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1481 dissect_cms_MessageDigest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1484 int old_offset = offset;
1486 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1490 pi = get_ber_last_created_item();
1493 old_offset = get_ber_identifier(tvb, old_offset, NULL, NULL, NULL);
1494 old_offset = get_ber_length(tree, tvb, old_offset, NULL, NULL);
1497 cms_verify_msg_digest(pi, content_tvb, x509af_get_last_algorithm_id(), tvb, old_offset);
1507 dissect_cms_UTCTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1508 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime,
1509 pinfo, tree, tvb, offset, hf_index,
1514 static int dissect_utcTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1515 return dissect_cms_UTCTime(FALSE, tvb, offset, pinfo, tree, hf_cms_utcTime);
1519 static const value_string cms_Time_vals[] = {
1521 { 1, "generalTime" },
1525 static const ber_choice_t Time_choice[] = {
1526 { 0, BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_utcTime },
1527 { 1, BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_generalTime },
1528 { 0, 0, 0, 0, NULL }
1532 dissect_cms_Time(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1533 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1534 Time_choice, hf_index, ett_cms_Time,
1543 dissect_cms_SigningTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1544 offset = dissect_cms_Time(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1552 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1553 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1560 static void dissect_ContentInfo_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1561 dissect_cms_ContentInfo(FALSE, tvb, 0, pinfo, tree, hf_cms_ContentInfo_PDU);
1563 static void dissect_ContentType_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1564 dissect_cms_ContentType(FALSE, tvb, 0, pinfo, tree, hf_cms_ContentType_PDU);
1566 static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1567 dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
1569 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1570 dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
1572 static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1573 dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
1575 static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1576 dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
1578 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1579 dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
1581 static void dissect_MessageDigest_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1582 dissect_cms_MessageDigest(FALSE, tvb, 0, pinfo, tree, hf_cms_MessageDigest_PDU);
1584 static void dissect_SigningTime_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1585 dissect_cms_SigningTime(FALSE, tvb, 0, pinfo, tree, hf_cms_SigningTime_PDU);
1587 static void dissect_Countersignature_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1588 dissect_cms_Countersignature(FALSE, tvb, 0, pinfo, tree, hf_cms_Countersignature_PDU);
1592 /*--- End of included file: packet-cms-fn.c ---*/
1593 #line 133 "packet-cms-template.c"
1595 /*--- proto_register_cms ----------------------------------------------*/
1596 void proto_register_cms(void) {
1598 /* List of fields */
1599 static hf_register_info hf[] = {
1600 { &hf_cms_ci_contentType,
1601 { "contentType", "cms.contentInfo.contentType",
1602 FT_OID, BASE_NONE, NULL, 0,
1603 "ContentType", HFILL }},
1605 /*--- Included file: packet-cms-hfarr.c ---*/
1606 #line 1 "packet-cms-hfarr.c"
1607 { &hf_cms_ContentInfo_PDU,
1608 { "ContentInfo", "cms.ContentInfo",
1609 FT_NONE, BASE_NONE, NULL, 0,
1610 "ContentInfo", HFILL }},
1611 { &hf_cms_ContentType_PDU,
1612 { "ContentType", "cms.ContentType",
1613 FT_OID, BASE_NONE, NULL, 0,
1614 "ContentType", HFILL }},
1615 { &hf_cms_SignedData_PDU,
1616 { "SignedData", "cms.SignedData",
1617 FT_NONE, BASE_NONE, NULL, 0,
1618 "SignedData", HFILL }},
1619 { &hf_cms_EnvelopedData_PDU,
1620 { "EnvelopedData", "cms.EnvelopedData",
1621 FT_NONE, BASE_NONE, NULL, 0,
1622 "EnvelopedData", HFILL }},
1623 { &hf_cms_DigestedData_PDU,
1624 { "DigestedData", "cms.DigestedData",
1625 FT_NONE, BASE_NONE, NULL, 0,
1626 "DigestedData", HFILL }},
1627 { &hf_cms_EncryptedData_PDU,
1628 { "EncryptedData", "cms.EncryptedData",
1629 FT_NONE, BASE_NONE, NULL, 0,
1630 "EncryptedData", HFILL }},
1631 { &hf_cms_AuthenticatedData_PDU,
1632 { "AuthenticatedData", "cms.AuthenticatedData",
1633 FT_NONE, BASE_NONE, NULL, 0,
1634 "AuthenticatedData", HFILL }},
1635 { &hf_cms_MessageDigest_PDU,
1636 { "MessageDigest", "cms.MessageDigest",
1637 FT_BYTES, BASE_HEX, NULL, 0,
1638 "MessageDigest", HFILL }},
1639 { &hf_cms_SigningTime_PDU,
1640 { "SigningTime", "cms.SigningTime",
1641 FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1642 "SigningTime", HFILL }},
1643 { &hf_cms_Countersignature_PDU,
1644 { "Countersignature", "cms.Countersignature",
1645 FT_NONE, BASE_NONE, NULL, 0,
1646 "Countersignature", HFILL }},
1647 { &hf_cms_contentType,
1648 { "contentType", "cms.contentType",
1649 FT_OID, BASE_NONE, NULL, 0,
1650 "ContentInfo/contentType", HFILL }},
1652 { "content", "cms.content",
1653 FT_NONE, BASE_NONE, NULL, 0,
1654 "ContentInfo/content", HFILL }},
1656 { "version", "cms.version",
1657 FT_INT32, BASE_DEC, VALS(cms_CMSVersion_vals), 0,
1659 { &hf_cms_digestAlgorithms,
1660 { "digestAlgorithms", "cms.digestAlgorithms",
1661 FT_UINT32, BASE_DEC, NULL, 0,
1662 "SignedData/digestAlgorithms", HFILL }},
1663 { &hf_cms_encapContentInfo,
1664 { "encapContentInfo", "cms.encapContentInfo",
1665 FT_NONE, BASE_NONE, NULL, 0,
1667 { &hf_cms_certificates,
1668 { "certificates", "cms.certificates",
1669 FT_UINT32, BASE_DEC, NULL, 0,
1670 "SignedData/certificates", HFILL }},
1672 { "crls", "cms.crls",
1673 FT_UINT32, BASE_DEC, NULL, 0,
1675 { &hf_cms_signerInfos,
1676 { "signerInfos", "cms.signerInfos",
1677 FT_UINT32, BASE_DEC, NULL, 0,
1678 "SignedData/signerInfos", HFILL }},
1679 { &hf_cms_DigestAlgorithmIdentifiers_item,
1680 { "Item", "cms.DigestAlgorithmIdentifiers_item",
1681 FT_NONE, BASE_NONE, NULL, 0,
1682 "DigestAlgorithmIdentifiers/_item", HFILL }},
1683 { &hf_cms_SignerInfos_item,
1684 { "Item", "cms.SignerInfos_item",
1685 FT_NONE, BASE_NONE, NULL, 0,
1686 "SignerInfos/_item", HFILL }},
1687 { &hf_cms_eContentType,
1688 { "eContentType", "cms.eContentType",
1689 FT_OID, BASE_NONE, NULL, 0,
1690 "EncapsulatedContentInfo/eContentType", HFILL }},
1692 { "eContent", "cms.eContent",
1693 FT_BYTES, BASE_HEX, NULL, 0,
1694 "EncapsulatedContentInfo/eContent", HFILL }},
1697 FT_UINT32, BASE_DEC, VALS(cms_SignerIdentifier_vals), 0,
1698 "SignerInfo/sid", HFILL }},
1699 { &hf_cms_digestAlgorithm,
1700 { "digestAlgorithm", "cms.digestAlgorithm",
1701 FT_NONE, BASE_NONE, NULL, 0,
1703 { &hf_cms_signedAttrs,
1704 { "signedAttrs", "cms.signedAttrs",
1705 FT_UINT32, BASE_DEC, NULL, 0,
1706 "SignerInfo/signedAttrs", HFILL }},
1707 { &hf_cms_signatureAlgorithm,
1708 { "signatureAlgorithm", "cms.signatureAlgorithm",
1709 FT_NONE, BASE_NONE, NULL, 0,
1711 { &hf_cms_signatureValue,
1712 { "signature", "cms.signature",
1713 FT_BYTES, BASE_HEX, NULL, 0,
1714 "SignerInfo/signature", HFILL }},
1715 { &hf_cms_unsignedAttrs,
1716 { "unsignedAttrs", "cms.unsignedAttrs",
1717 FT_UINT32, BASE_DEC, NULL, 0,
1718 "SignerInfo/unsignedAttrs", HFILL }},
1719 { &hf_cms_issuerAndSerialNumber,
1720 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber",
1721 FT_NONE, BASE_NONE, NULL, 0,
1723 { &hf_cms_subjectKeyIdentifier,
1724 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1725 FT_BYTES, BASE_HEX, NULL, 0,
1727 { &hf_cms_SignedAttributes_item,
1728 { "Item", "cms.SignedAttributes_item",
1729 FT_NONE, BASE_NONE, NULL, 0,
1730 "SignedAttributes/_item", HFILL }},
1731 { &hf_cms_UnsignedAttributes_item,
1732 { "Item", "cms.UnsignedAttributes_item",
1733 FT_NONE, BASE_NONE, NULL, 0,
1734 "UnsignedAttributes/_item", HFILL }},
1736 { "attrType", "cms.attrType",
1737 FT_OID, BASE_NONE, NULL, 0,
1738 "Attribute/attrType", HFILL }},
1739 { &hf_cms_attrValues,
1740 { "attrValues", "cms.attrValues",
1741 FT_UINT32, BASE_DEC, NULL, 0,
1742 "Attribute/attrValues", HFILL }},
1743 { &hf_cms_attrValues_item,
1744 { "Item", "cms.attrValues_item",
1745 FT_NONE, BASE_NONE, NULL, 0,
1746 "Attribute/attrValues/_item", HFILL }},
1747 { &hf_cms_originatorInfo,
1748 { "originatorInfo", "cms.originatorInfo",
1749 FT_NONE, BASE_NONE, NULL, 0,
1751 { &hf_cms_recipientInfos,
1752 { "recipientInfos", "cms.recipientInfos",
1753 FT_UINT32, BASE_DEC, NULL, 0,
1755 { &hf_cms_encryptedContentInfo,
1756 { "encryptedContentInfo", "cms.encryptedContentInfo",
1757 FT_NONE, BASE_NONE, NULL, 0,
1759 { &hf_cms_unprotectedAttrs,
1760 { "unprotectedAttrs", "cms.unprotectedAttrs",
1761 FT_UINT32, BASE_DEC, NULL, 0,
1764 { "certs", "cms.certs",
1765 FT_UINT32, BASE_DEC, NULL, 0,
1766 "OriginatorInfo/certs", HFILL }},
1767 { &hf_cms_RecipientInfos_item,
1768 { "Item", "cms.RecipientInfos_item",
1769 FT_UINT32, BASE_DEC, VALS(cms_RecipientInfo_vals), 0,
1770 "RecipientInfos/_item", HFILL }},
1771 { &hf_cms_encryptedContentType,
1772 { "contentType", "cms.contentType",
1773 FT_OID, BASE_NONE, NULL, 0,
1774 "EncryptedContentInfo/contentType", HFILL }},
1775 { &hf_cms_contentEncryptionAlgorithm,
1776 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm",
1777 FT_NONE, BASE_NONE, NULL, 0,
1778 "EncryptedContentInfo/contentEncryptionAlgorithm", HFILL }},
1779 { &hf_cms_encryptedContent,
1780 { "encryptedContent", "cms.encryptedContent",
1781 FT_BYTES, BASE_HEX, NULL, 0,
1782 "EncryptedContentInfo/encryptedContent", HFILL }},
1783 { &hf_cms_UnprotectedAttributes_item,
1784 { "Item", "cms.UnprotectedAttributes_item",
1785 FT_NONE, BASE_NONE, NULL, 0,
1786 "UnprotectedAttributes/_item", HFILL }},
1788 { "ktri", "cms.ktri",
1789 FT_NONE, BASE_NONE, NULL, 0,
1790 "RecipientInfo/ktri", HFILL }},
1792 { "kari", "cms.kari",
1793 FT_NONE, BASE_NONE, NULL, 0,
1794 "RecipientInfo/kari", HFILL }},
1796 { "kekri", "cms.kekri",
1797 FT_NONE, BASE_NONE, NULL, 0,
1798 "RecipientInfo/kekri", HFILL }},
1801 FT_UINT32, BASE_DEC, VALS(cms_RecipientIdentifier_vals), 0,
1802 "KeyTransRecipientInfo/rid", HFILL }},
1803 { &hf_cms_keyEncryptionAlgorithm,
1804 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm",
1805 FT_NONE, BASE_NONE, NULL, 0,
1807 { &hf_cms_encryptedKey,
1808 { "encryptedKey", "cms.encryptedKey",
1809 FT_BYTES, BASE_HEX, NULL, 0,
1811 { &hf_cms_originator,
1812 { "originator", "cms.originator",
1813 FT_UINT32, BASE_DEC, VALS(cms_OriginatorIdentifierOrKey_vals), 0,
1814 "KeyAgreeRecipientInfo/originator", HFILL }},
1817 FT_BYTES, BASE_HEX, NULL, 0,
1818 "KeyAgreeRecipientInfo/ukm", HFILL }},
1819 { &hf_cms_recipientEncryptedKeys,
1820 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
1821 FT_UINT32, BASE_DEC, NULL, 0,
1822 "KeyAgreeRecipientInfo/recipientEncryptedKeys", HFILL }},
1823 { &hf_cms_originatorKey,
1824 { "originatorKey", "cms.originatorKey",
1825 FT_NONE, BASE_NONE, NULL, 0,
1826 "OriginatorIdentifierOrKey/originatorKey", HFILL }},
1827 { &hf_cms_algorithm,
1828 { "algorithm", "cms.algorithm",
1829 FT_NONE, BASE_NONE, NULL, 0,
1830 "OriginatorPublicKey/algorithm", HFILL }},
1831 { &hf_cms_publicKey,
1832 { "publicKey", "cms.publicKey",
1833 FT_BYTES, BASE_HEX, NULL, 0,
1834 "OriginatorPublicKey/publicKey", HFILL }},
1835 { &hf_cms_RecipientEncryptedKeys_item,
1836 { "Item", "cms.RecipientEncryptedKeys_item",
1837 FT_NONE, BASE_NONE, NULL, 0,
1838 "RecipientEncryptedKeys/_item", HFILL }},
1841 FT_UINT32, BASE_DEC, VALS(cms_KeyAgreeRecipientIdentifier_vals), 0,
1842 "RecipientEncryptedKey/rid", HFILL }},
1844 { "rKeyId", "cms.rKeyId",
1845 FT_NONE, BASE_NONE, NULL, 0,
1846 "KeyAgreeRecipientIdentifier/rKeyId", HFILL }},
1848 { "date", "cms.date",
1849 FT_STRING, BASE_NONE, NULL, 0,
1852 { "other", "cms.other",
1853 FT_NONE, BASE_NONE, NULL, 0,
1856 { "kekid", "cms.kekid",
1857 FT_NONE, BASE_NONE, NULL, 0,
1858 "KEKRecipientInfo/kekid", HFILL }},
1859 { &hf_cms_keyIdentifier,
1860 { "keyIdentifier", "cms.keyIdentifier",
1861 FT_BYTES, BASE_HEX, NULL, 0,
1862 "KEKIdentifier/keyIdentifier", HFILL }},
1864 { "digest", "cms.digest",
1865 FT_BYTES, BASE_HEX, NULL, 0,
1866 "DigestedData/digest", HFILL }},
1867 { &hf_cms_macAlgorithm,
1868 { "macAlgorithm", "cms.macAlgorithm",
1869 FT_NONE, BASE_NONE, NULL, 0,
1870 "AuthenticatedData/macAlgorithm", HFILL }},
1871 { &hf_cms_authenticatedAttributes,
1872 { "authenticatedAttributes", "cms.authenticatedAttributes",
1873 FT_UINT32, BASE_DEC, NULL, 0,
1874 "AuthenticatedData/authenticatedAttributes", HFILL }},
1877 FT_BYTES, BASE_HEX, NULL, 0,
1878 "AuthenticatedData/mac", HFILL }},
1879 { &hf_cms_unauthenticatedAttributes,
1880 { "unauthenticatedAttributes", "cms.unauthenticatedAttributes",
1881 FT_UINT32, BASE_DEC, NULL, 0,
1882 "AuthenticatedData/unauthenticatedAttributes", HFILL }},
1883 { &hf_cms_AuthAttributes_item,
1884 { "Item", "cms.AuthAttributes_item",
1885 FT_NONE, BASE_NONE, NULL, 0,
1886 "AuthAttributes/_item", HFILL }},
1887 { &hf_cms_UnauthAttributes_item,
1888 { "Item", "cms.UnauthAttributes_item",
1889 FT_NONE, BASE_NONE, NULL, 0,
1890 "UnauthAttributes/_item", HFILL }},
1891 { &hf_cms_CertificateRevocationLists_item,
1892 { "Item", "cms.CertificateRevocationLists_item",
1893 FT_NONE, BASE_NONE, NULL, 0,
1894 "CertificateRevocationLists/_item", HFILL }},
1895 { &hf_cms_certificate,
1896 { "certificate", "cms.certificate",
1897 FT_NONE, BASE_NONE, NULL, 0,
1899 { &hf_cms_extendedCertificate,
1900 { "extendedCertificate", "cms.extendedCertificate",
1901 FT_NONE, BASE_NONE, NULL, 0,
1902 "CertificateChoices/extendedCertificate", HFILL }},
1904 { "attrCert", "cms.attrCert",
1905 FT_NONE, BASE_NONE, NULL, 0,
1906 "CertificateChoices/attrCert", HFILL }},
1907 { &hf_cms_CertificateSet_item,
1908 { "Item", "cms.CertificateSet_item",
1909 FT_UINT32, BASE_DEC, VALS(cms_CertificateChoices_vals), 0,
1910 "CertificateSet/_item", HFILL }},
1912 { "issuer", "cms.issuer",
1913 FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
1914 "IssuerAndSerialNumber/issuer", HFILL }},
1915 { &hf_cms_serialNumber,
1916 { "serialNumber", "cms.serialNumber",
1917 FT_INT32, BASE_DEC, NULL, 0,
1918 "IssuerAndSerialNumber/serialNumber", HFILL }},
1919 { &hf_cms_keyAttrId,
1920 { "keyAttrId", "cms.keyAttrId",
1921 FT_OID, BASE_NONE, NULL, 0,
1922 "OtherKeyAttribute/keyAttrId", HFILL }},
1924 { "keyAttr", "cms.keyAttr",
1925 FT_NONE, BASE_NONE, NULL, 0,
1926 "OtherKeyAttribute/keyAttr", HFILL }},
1928 { "utcTime", "cms.utcTime",
1929 FT_STRING, BASE_NONE, NULL, 0,
1930 "Time/utcTime", HFILL }},
1931 { &hf_cms_generalTime,
1932 { "generalTime", "cms.generalTime",
1933 FT_STRING, BASE_NONE, NULL, 0,
1934 "Time/generalTime", HFILL }},
1935 { &hf_cms_extendedCertificateInfo,
1936 { "extendedCertificateInfo", "cms.extendedCertificateInfo",
1937 FT_NONE, BASE_NONE, NULL, 0,
1938 "ExtendedCertificate/extendedCertificateInfo", HFILL }},
1939 { &hf_cms_signature,
1940 { "signature", "cms.signature",
1941 FT_BYTES, BASE_HEX, NULL, 0,
1942 "ExtendedCertificate/signature", HFILL }},
1943 { &hf_cms_attributes,
1944 { "attributes", "cms.attributes",
1945 FT_UINT32, BASE_DEC, NULL, 0,
1946 "ExtendedCertificateInfo/attributes", HFILL }},
1948 /*--- End of included file: packet-cms-hfarr.c ---*/
1949 #line 144 "packet-cms-template.c"
1952 /* List of subtrees */
1953 static gint *ett[] = {
1955 /*--- Included file: packet-cms-ettarr.c ---*/
1956 #line 1 "packet-cms-ettarr.c"
1957 &ett_cms_ContentInfo,
1958 &ett_cms_SignedData,
1959 &ett_cms_DigestAlgorithmIdentifiers,
1960 &ett_cms_SignerInfos,
1961 &ett_cms_EncapsulatedContentInfo,
1962 &ett_cms_SignerInfo,
1963 &ett_cms_SignerIdentifier,
1964 &ett_cms_SignedAttributes,
1965 &ett_cms_UnsignedAttributes,
1967 &ett_cms_SET_OF_AttributeValue,
1968 &ett_cms_EnvelopedData,
1969 &ett_cms_OriginatorInfo,
1970 &ett_cms_RecipientInfos,
1971 &ett_cms_EncryptedContentInfo,
1972 &ett_cms_UnprotectedAttributes,
1973 &ett_cms_RecipientInfo,
1974 &ett_cms_KeyTransRecipientInfo,
1975 &ett_cms_RecipientIdentifier,
1976 &ett_cms_KeyAgreeRecipientInfo,
1977 &ett_cms_OriginatorIdentifierOrKey,
1978 &ett_cms_OriginatorPublicKey,
1979 &ett_cms_RecipientEncryptedKeys,
1980 &ett_cms_RecipientEncryptedKey,
1981 &ett_cms_KeyAgreeRecipientIdentifier,
1982 &ett_cms_RecipientKeyIdentifier,
1983 &ett_cms_KEKRecipientInfo,
1984 &ett_cms_KEKIdentifier,
1985 &ett_cms_DigestedData,
1986 &ett_cms_EncryptedData,
1987 &ett_cms_AuthenticatedData,
1988 &ett_cms_AuthAttributes,
1989 &ett_cms_UnauthAttributes,
1990 &ett_cms_CertificateRevocationLists,
1991 &ett_cms_CertificateChoices,
1992 &ett_cms_CertificateSet,
1993 &ett_cms_IssuerAndSerialNumber,
1994 &ett_cms_OtherKeyAttribute,
1996 &ett_cms_ExtendedCertificate,
1997 &ett_cms_ExtendedCertificateInfo,
1999 /*--- End of included file: packet-cms-ettarr.c ---*/
2000 #line 149 "packet-cms-template.c"
2003 /* Register protocol */
2004 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
2006 /* Register fields and subtrees */
2007 proto_register_field_array(proto_cms, hf, array_length(hf));
2008 proto_register_subtree_array(ett, array_length(ett));
2013 /*--- proto_reg_handoff_cms -------------------------------------------*/
2014 void proto_reg_handoff_cms(void) {
2016 /*--- Included file: packet-cms-dis-tab.c ---*/
2017 #line 1 "packet-cms-dis-tab.c"
2018 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.6", dissect_ContentInfo_PDU, proto_cms, "id-ct-contentInfo");
2019 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
2020 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
2021 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
2022 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
2023 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
2024 register_ber_oid_dissector("1.2.840.113549.1.9.3", dissect_ContentType_PDU, proto_cms, "id-contentType");
2025 register_ber_oid_dissector("1.2.840.113549.1.9.4", dissect_MessageDigest_PDU, proto_cms, "id-messageDigest");
2026 register_ber_oid_dissector("1.2.840.113549.1.9.5", dissect_SigningTime_PDU, proto_cms, "id-signingTime");
2027 register_ber_oid_dissector("1.2.840.113549.1.9.6", dissect_Countersignature_PDU, proto_cms, "id-counterSignature");
2028 register_ber_oid_dissector("2.6.1.4.18", dissect_ContentInfo_PDU, proto_cms, "id-et-pkcs7");
2031 /*--- End of included file: packet-cms-dis-tab.c ---*/
2032 #line 164 "packet-cms-template.c"