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 -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
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 #include <epan/sha1.h>
50 #include <epan/crypt-md5.h>
52 #define PNAME "Cryptographic Message Syntax"
56 /* Initialize the protocol and registered fields */
58 static int hf_cms_ci_contentType = -1;
60 /*--- Included file: packet-cms-hf.c ---*/
62 static int hf_cms_ContentInfo_PDU = -1; /* ContentInfo */
63 static int hf_cms_ContentType_PDU = -1; /* ContentType */
64 static int hf_cms_SignedData_PDU = -1; /* SignedData */
65 static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
66 static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
67 static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
68 static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
69 static int hf_cms_MessageDigest_PDU = -1; /* MessageDigest */
70 static int hf_cms_SigningTime_PDU = -1; /* SigningTime */
71 static int hf_cms_Countersignature_PDU = -1; /* Countersignature */
72 static int hf_cms_contentType = -1; /* T_contentType */
73 static int hf_cms_content = -1; /* T_content */
74 static int hf_cms_version = -1; /* CMSVersion */
75 static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
76 static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
77 static int hf_cms_certificates = -1; /* CertificateSet */
78 static int hf_cms_crls = -1; /* CertificateRevocationLists */
79 static int hf_cms_signerInfos = -1; /* SignerInfos */
80 static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */
81 static int hf_cms_SignerInfos_item = -1; /* SignerInfo */
82 static int hf_cms_eContentType = -1; /* T_eContentType */
83 static int hf_cms_eContent = -1; /* T_eContent */
84 static int hf_cms_sid = -1; /* SignerIdentifier */
85 static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */
86 static int hf_cms_signedAttrs = -1; /* SignedAttributes */
87 static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */
88 static int hf_cms_signatureValue = -1; /* SignatureValue */
89 static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */
90 static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
91 static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
92 static int hf_cms_SignedAttributes_item = -1; /* Attribute */
93 static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */
94 static int hf_cms_attrType = -1; /* T_attrType */
95 static int hf_cms_attrValues = -1; /* SET_OF_AttributeValue */
96 static int hf_cms_attrValues_item = -1; /* AttributeValue */
97 static int hf_cms_originatorInfo = -1; /* OriginatorInfo */
98 static int hf_cms_recipientInfos = -1; /* RecipientInfos */
99 static int hf_cms_encryptedContentInfo = -1; /* EncryptedContentInfo */
100 static int hf_cms_unprotectedAttrs = -1; /* UnprotectedAttributes */
101 static int hf_cms_certs = -1; /* CertificateSet */
102 static int hf_cms_RecipientInfos_item = -1; /* RecipientInfo */
103 static int hf_cms_encryptedContentType = -1; /* ContentType */
104 static int hf_cms_contentEncryptionAlgorithm = -1; /* ContentEncryptionAlgorithmIdentifier */
105 static int hf_cms_encryptedContent = -1; /* EncryptedContent */
106 static int hf_cms_UnprotectedAttributes_item = -1; /* Attribute */
107 static int hf_cms_ktri = -1; /* KeyTransRecipientInfo */
108 static int hf_cms_kari = -1; /* KeyAgreeRecipientInfo */
109 static int hf_cms_kekri = -1; /* KEKRecipientInfo */
110 static int hf_cms_rid = -1; /* RecipientIdentifier */
111 static int hf_cms_keyEncryptionAlgorithm = -1; /* KeyEncryptionAlgorithmIdentifier */
112 static int hf_cms_encryptedKey = -1; /* EncryptedKey */
113 static int hf_cms_originator = -1; /* OriginatorIdentifierOrKey */
114 static int hf_cms_ukm = -1; /* UserKeyingMaterial */
115 static int hf_cms_recipientEncryptedKeys = -1; /* RecipientEncryptedKeys */
116 static int hf_cms_originatorKey = -1; /* OriginatorPublicKey */
117 static int hf_cms_algorithm = -1; /* AlgorithmIdentifier */
118 static int hf_cms_publicKey = -1; /* BIT_STRING */
119 static int hf_cms_RecipientEncryptedKeys_item = -1; /* RecipientEncryptedKey */
120 static int hf_cms_rekRid = -1; /* KeyAgreeRecipientIdentifier */
121 static int hf_cms_rKeyId = -1; /* RecipientKeyIdentifier */
122 static int hf_cms_date = -1; /* GeneralizedTime */
123 static int hf_cms_other = -1; /* OtherKeyAttribute */
124 static int hf_cms_kekid = -1; /* KEKIdentifier */
125 static int hf_cms_keyIdentifier = -1; /* OCTET_STRING */
126 static int hf_cms_digest = -1; /* Digest */
127 static int hf_cms_macAlgorithm = -1; /* MessageAuthenticationCodeAlgorithm */
128 static int hf_cms_authenticatedAttributes = -1; /* AuthAttributes */
129 static int hf_cms_mac = -1; /* MessageAuthenticationCode */
130 static int hf_cms_unauthenticatedAttributes = -1; /* UnauthAttributes */
131 static int hf_cms_AuthAttributes_item = -1; /* Attribute */
132 static int hf_cms_UnauthAttributes_item = -1; /* Attribute */
133 static int hf_cms_CertificateRevocationLists_item = -1; /* CertificateList */
134 static int hf_cms_certificate = -1; /* Certificate */
135 static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */
136 static int hf_cms_attrCert = -1; /* AttributeCertificate */
137 static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */
138 static int hf_cms_issuer = -1; /* Name */
139 static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */
140 static int hf_cms_keyAttrId = -1; /* T_keyAttrId */
141 static int hf_cms_keyAttr = -1; /* T_keyAttr */
142 static int hf_cms_utcTime = -1; /* UTCTime */
143 static int hf_cms_generalTime = -1; /* GeneralizedTime */
144 static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */
145 static int hf_cms_signature = -1; /* Signature */
146 static int hf_cms_attributes = -1; /* UnauthAttributes */
148 /*--- End of included file: packet-cms-hf.c ---*/
151 /* Initialize the subtree pointers */
153 /*--- Included file: packet-cms-ett.c ---*/
155 static gint ett_cms_ContentInfo = -1;
156 static gint ett_cms_SignedData = -1;
157 static gint ett_cms_DigestAlgorithmIdentifiers = -1;
158 static gint ett_cms_SignerInfos = -1;
159 static gint ett_cms_EncapsulatedContentInfo = -1;
160 static gint ett_cms_SignerInfo = -1;
161 static gint ett_cms_SignerIdentifier = -1;
162 static gint ett_cms_SignedAttributes = -1;
163 static gint ett_cms_UnsignedAttributes = -1;
164 static gint ett_cms_Attribute = -1;
165 static gint ett_cms_SET_OF_AttributeValue = -1;
166 static gint ett_cms_EnvelopedData = -1;
167 static gint ett_cms_OriginatorInfo = -1;
168 static gint ett_cms_RecipientInfos = -1;
169 static gint ett_cms_EncryptedContentInfo = -1;
170 static gint ett_cms_UnprotectedAttributes = -1;
171 static gint ett_cms_RecipientInfo = -1;
172 static gint ett_cms_KeyTransRecipientInfo = -1;
173 static gint ett_cms_RecipientIdentifier = -1;
174 static gint ett_cms_KeyAgreeRecipientInfo = -1;
175 static gint ett_cms_OriginatorIdentifierOrKey = -1;
176 static gint ett_cms_OriginatorPublicKey = -1;
177 static gint ett_cms_RecipientEncryptedKeys = -1;
178 static gint ett_cms_RecipientEncryptedKey = -1;
179 static gint ett_cms_KeyAgreeRecipientIdentifier = -1;
180 static gint ett_cms_RecipientKeyIdentifier = -1;
181 static gint ett_cms_KEKRecipientInfo = -1;
182 static gint ett_cms_KEKIdentifier = -1;
183 static gint ett_cms_DigestedData = -1;
184 static gint ett_cms_EncryptedData = -1;
185 static gint ett_cms_AuthenticatedData = -1;
186 static gint ett_cms_AuthAttributes = -1;
187 static gint ett_cms_UnauthAttributes = -1;
188 static gint ett_cms_CertificateRevocationLists = -1;
189 static gint ett_cms_CertificateChoices = -1;
190 static gint ett_cms_CertificateSet = -1;
191 static gint ett_cms_IssuerAndSerialNumber = -1;
192 static gint ett_cms_OtherKeyAttribute = -1;
193 static gint ett_cms_Time = -1;
194 static gint ett_cms_ExtendedCertificate = -1;
195 static gint ett_cms_ExtendedCertificateInfo = -1;
197 /*--- End of included file: packet-cms-ett.c ---*/
200 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 asn2eth stops generating these silly wrappers */
203 static const char *object_identifier_id;
204 static tvbuff_t *content_tvb = NULL;
206 static proto_tree *top_tree=NULL;
208 #define HASH_SHA1 "1.3.14.3.2.26"
209 #define SHA1_BUFFER_SIZE 20
211 #define HASH_MD5 "1.2.840.113549.2.5"
212 #define MD5_BUFFER_SIZE 16
216 #define HASH_SHA224 "2.16.840.1.101.3.4.2.4"
217 #define SHA224_BUFFER_SIZE 32 /* actually 28 */
218 #define HASH_SHA256 "2.16.840.1.101.3.4.2.1"
219 #define SHA256_BUFFER_SIZE 32
221 unsigned char digest_buf[MAX(SHA1_BUFFER_SIZE, MD5_BUFFER_SIZE)];
224 cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff_t *tvb, int offset)
226 sha1_context sha1_ctx;
228 int i= 0, buffer_size = 0;
230 /* we only support two algorithms at the moment - if we do add SHA2
231 we should add a registration process to use a registration process */
233 if(strcmp(alg, HASH_SHA1) == 0) {
235 sha1_starts(&sha1_ctx);
237 sha1_update(&sha1_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
238 tvb_length(content));
240 sha1_finish(&sha1_ctx, digest_buf);
242 buffer_size = SHA1_BUFFER_SIZE;
244 } else if(strcmp(alg, HASH_MD5) == 0) {
248 md5_append(&md5_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
249 tvb_length(content));
251 md5_finish(&md5_ctx, digest_buf);
253 buffer_size = MD5_BUFFER_SIZE;
257 /* compare our computed hash with what we have received */
259 if(tvb_bytes_exist(tvb, offset, buffer_size) &&
260 (memcmp(tvb_get_ptr(tvb, offset, buffer_size), digest_buf, buffer_size) != 0)) {
261 proto_item_append_text(pi, " [incorrect, should be ");
262 for(i = 0; i < buffer_size; i++)
263 proto_item_append_text(pi, "%02X", digest_buf[i]);
265 proto_item_append_text(pi, "]");
268 proto_item_append_text(pi, " [correct]");
270 proto_item_append_text(pi, " [unable to verify]");
276 /*--- Included file: packet-cms-fn.c ---*/
278 /*--- Fields for imported types ---*/
280 static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
281 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm);
283 static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
284 return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item);
286 static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
287 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate);
289 static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
290 return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert);
292 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
293 return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_cms_issuer);
295 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
296 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber);
302 dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
303 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
307 static int dissect_encryptedContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
308 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentType);
314 dissect_cms_T_contentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
315 offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
316 hf_cms_ci_contentType, &object_identifier_id);
321 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
322 return dissect_cms_T_contentType(FALSE, tvb, offset, pinfo, tree, hf_cms_contentType);
328 dissect_cms_T_content(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
329 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
334 static int dissect_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
335 return dissect_cms_T_content(FALSE, tvb, offset, pinfo, tree, hf_cms_content);
339 static const ber_sequence_t ContentInfo_sequence[] = {
340 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
341 { BER_CLASS_CON, 0, 0, dissect_content },
346 dissect_cms_ContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
348 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
349 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
359 static const value_string cms_CMSVersion_vals[] = {
370 dissect_cms_CMSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
371 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
376 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
377 return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version);
383 dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
384 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
388 static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
389 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item);
391 static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
392 return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
394 static int dissect_digestAlgorithm_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
395 return dissect_cms_DigestAlgorithmIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm);
399 static const ber_sequence_t DigestAlgorithmIdentifiers_set_of[1] = {
400 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item },
404 dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
405 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
406 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
410 static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
411 return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms);
417 dissect_cms_T_eContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
418 offset = dissect_ber_object_identifier_str(FALSE, pinfo, tree, tvb, offset,
419 hf_cms_ci_contentType, &object_identifier_id);
424 static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
425 return dissect_cms_T_eContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType);
431 dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
436 int pdu_offset = offset;
439 /* XXX Do we care about printing out the octet string? */
440 offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, NULL, hf_cms_eContent);
442 pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
443 content_offset = pdu_offset = get_ber_length(tree, tvb, pdu_offset, &len, &ind);
444 pdu_offset = call_ber_oid_callback(object_identifier_id, tvb, pdu_offset, pinfo, top_tree ? top_tree : tree);
446 content_tvb = tvb_new_subset(tvb, content_offset, len, -1);
451 static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
452 return dissect_cms_T_eContent(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
456 static const ber_sequence_t EncapsulatedContentInfo_sequence[] = {
457 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType },
458 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent },
463 dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
464 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
465 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
469 static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
470 return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
476 dissect_cms_T_attrType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
479 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_attrType, &object_identifier_id);
482 if(object_identifier_id) {
483 name = get_ber_oid_name(object_identifier_id);
484 proto_item_append_text(tree, " (%s)", name ? name : object_identifier_id);
490 static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
491 return dissect_cms_T_attrType(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType);
497 dissect_cms_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
499 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
504 static int dissect_attrValues_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
505 return dissect_cms_AttributeValue(FALSE, tvb, offset, pinfo, tree, hf_cms_attrValues_item);
509 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
510 { BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_attrValues_item },
514 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_) {
515 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
516 SET_OF_AttributeValue_set_of, hf_index, ett_cms_SET_OF_AttributeValue);
520 static int dissect_attrValues(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
521 return dissect_cms_SET_OF_AttributeValue(FALSE, tvb, offset, pinfo, tree, hf_cms_attrValues);
525 static const ber_sequence_t Attribute_sequence[] = {
526 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType },
527 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attrValues },
532 dissect_cms_Attribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
533 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
534 Attribute_sequence, hf_index, ett_cms_Attribute);
538 static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
539 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item);
541 static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
542 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item);
544 static int dissect_UnprotectedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
545 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnprotectedAttributes_item);
547 static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
548 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item);
550 static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
551 return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item);
555 static const ber_sequence_t UnauthAttributes_set_of[1] = {
556 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item },
560 dissect_cms_UnauthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
561 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
562 UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
566 static int dissect_unauthenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
567 return dissect_cms_UnauthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unauthenticatedAttributes);
569 static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
570 return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes);
574 static const ber_sequence_t ExtendedCertificateInfo_sequence[] = {
575 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
576 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
577 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes },
582 dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
583 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
584 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
588 static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
589 return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo);
595 dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
596 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
600 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
601 return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm);
607 dissect_cms_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
608 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
614 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
615 return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature);
619 static const ber_sequence_t ExtendedCertificate_sequence[] = {
620 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo },
621 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
622 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
627 dissect_cms_ExtendedCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
628 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
629 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
633 static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
634 return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate);
638 static const value_string cms_CertificateChoices_vals[] = {
639 { 0, "certificate" },
640 { 1, "extendedCertificate" },
645 static const ber_choice_t CertificateChoices_choice[] = {
646 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate },
647 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl },
648 { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl },
653 dissect_cms_CertificateChoices(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
654 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
655 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices,
660 static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
661 return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item);
665 static const ber_sequence_t CertificateSet_set_of[1] = {
666 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item },
670 dissect_cms_CertificateSet(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
671 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
672 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
676 static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
677 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates);
679 static int dissect_certs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
680 return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certs);
684 static const ber_sequence_t CertificateRevocationLists_set_of[1] = {
685 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item },
689 dissect_cms_CertificateRevocationLists(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
690 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
691 CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists);
695 static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
696 return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls);
700 static const ber_sequence_t IssuerAndSerialNumber_sequence[] = {
701 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_issuer },
702 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
707 dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
708 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
709 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
713 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
714 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber);
720 dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
721 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
726 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
727 return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
729 static int dissect_subjectKeyIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
730 return dissect_cms_SubjectKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier);
734 const value_string cms_SignerIdentifier_vals[] = {
735 { 0, "issuerAndSerialNumber" },
736 { 1, "subjectKeyIdentifier" },
740 static const ber_choice_t SignerIdentifier_choice[] = {
741 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
742 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
747 dissect_cms_SignerIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
748 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
749 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier,
754 static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
755 return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid);
759 static const ber_sequence_t SignedAttributes_set_of[1] = {
760 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item },
764 dissect_cms_SignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
765 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
766 SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
770 static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
771 return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs);
777 dissect_cms_SignatureValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
778 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
783 static int dissect_signatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
784 return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureValue);
788 static const ber_sequence_t UnsignedAttributes_set_of[1] = {
789 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item },
793 dissect_cms_UnsignedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
794 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
795 UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
799 static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
800 return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs);
804 static const ber_sequence_t SignerInfo_sequence[] = {
805 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
806 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid },
807 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
808 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl },
809 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
810 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signatureValue },
811 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl },
816 dissect_cms_SignerInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
817 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
818 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
822 static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
823 return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item);
827 static const ber_sequence_t SignerInfos_set_of[1] = {
828 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item },
832 dissect_cms_SignerInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
833 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
834 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
838 static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
839 return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos);
843 static const ber_sequence_t SignedData_sequence[] = {
844 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
845 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms },
846 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
847 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl },
848 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
849 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos },
854 dissect_cms_SignedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
855 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
856 SignedData_sequence, hf_index, ett_cms_SignedData);
862 static const ber_sequence_t OriginatorInfo_sequence[] = {
863 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certs_impl },
864 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl },
869 dissect_cms_OriginatorInfo(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 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
875 static int dissect_originatorInfo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
876 return dissect_cms_OriginatorInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorInfo);
880 static const value_string cms_RecipientIdentifier_vals[] = {
881 { 0, "issuerAndSerialNumber" },
882 { 1, "subjectKeyIdentifier" },
886 static const ber_choice_t RecipientIdentifier_choice[] = {
887 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
888 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
893 dissect_cms_RecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
894 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
895 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier,
900 static int dissect_rid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
901 return dissect_cms_RecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rid);
907 dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
908 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
912 static int dissect_keyEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
913 return dissect_cms_KeyEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_keyEncryptionAlgorithm);
919 dissect_cms_EncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
920 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
925 static int dissect_encryptedKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
926 return dissect_cms_EncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedKey);
930 static const ber_sequence_t KeyTransRecipientInfo_sequence[] = {
931 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
932 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rid },
933 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
934 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
939 dissect_cms_KeyTransRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
940 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
941 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
945 static int dissect_ktri(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
946 return dissect_cms_KeyTransRecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_ktri);
952 dissect_cms_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
953 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
959 static int dissect_publicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
960 return dissect_cms_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_publicKey);
964 static const ber_sequence_t OriginatorPublicKey_sequence[] = {
965 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm },
966 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_publicKey },
971 dissect_cms_OriginatorPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
972 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
973 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
977 static int dissect_originatorKey_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
978 return dissect_cms_OriginatorPublicKey(TRUE, tvb, offset, pinfo, tree, hf_cms_originatorKey);
982 static const value_string cms_OriginatorIdentifierOrKey_vals[] = {
983 { 0, "issuerAndSerialNumber" },
984 { 1, "subjectKeyIdentifier" },
985 { 2, "originatorKey" },
989 static const ber_choice_t OriginatorIdentifierOrKey_choice[] = {
990 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
991 { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier_impl },
992 { 2, BER_CLASS_CON, 1, 0, dissect_originatorKey_impl },
997 dissect_cms_OriginatorIdentifierOrKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
998 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
999 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey,
1004 static int dissect_originator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1005 return dissect_cms_OriginatorIdentifierOrKey(FALSE, tvb, offset, pinfo, tree, hf_cms_originator);
1011 dissect_cms_UserKeyingMaterial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1012 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1017 static int dissect_ukm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1018 return dissect_cms_UserKeyingMaterial(FALSE, tvb, offset, pinfo, tree, hf_cms_ukm);
1024 dissect_cms_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1025 offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
1029 static int dissect_date(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1030 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_date);
1032 static int dissect_generalTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1033 return dissect_cms_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_cms_generalTime);
1039 dissect_cms_T_keyAttrId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1040 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_cms_ci_contentType, &object_identifier_id);
1044 static int dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1045 return dissect_cms_T_keyAttrId(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttrId);
1051 dissect_cms_T_keyAttr(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1052 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
1058 static int dissect_keyAttr(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1059 return dissect_cms_T_keyAttr(FALSE, tvb, offset, pinfo, tree, hf_cms_keyAttr);
1063 static const ber_sequence_t OtherKeyAttribute_sequence[] = {
1064 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId },
1065 { BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_keyAttr },
1070 dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1071 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1072 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
1076 static int dissect_other(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1077 return dissect_cms_OtherKeyAttribute(FALSE, tvb, offset, pinfo, tree, hf_cms_other);
1081 static const ber_sequence_t RecipientKeyIdentifier_sequence[] = {
1082 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
1083 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1084 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1089 dissect_cms_RecipientKeyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1090 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1091 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
1095 static int dissect_rKeyId_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1096 return dissect_cms_RecipientKeyIdentifier(TRUE, tvb, offset, pinfo, tree, hf_cms_rKeyId);
1100 static const value_string cms_KeyAgreeRecipientIdentifier_vals[] = {
1101 { 0, "issuerAndSerialNumber" },
1106 static const ber_choice_t KeyAgreeRecipientIdentifier_choice[] = {
1107 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
1108 { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_rKeyId_impl },
1109 { 0, 0, 0, 0, NULL }
1113 dissect_cms_KeyAgreeRecipientIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1114 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1115 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier,
1120 static int dissect_rekRid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1121 return dissect_cms_KeyAgreeRecipientIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_rekRid);
1125 static const ber_sequence_t RecipientEncryptedKey_sequence[] = {
1126 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_rekRid },
1127 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1132 dissect_cms_RecipientEncryptedKey(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1133 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1134 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
1138 static int dissect_RecipientEncryptedKeys_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1139 return dissect_cms_RecipientEncryptedKey(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientEncryptedKeys_item);
1143 static const ber_sequence_t RecipientEncryptedKeys_sequence_of[1] = {
1144 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RecipientEncryptedKeys_item },
1148 dissect_cms_RecipientEncryptedKeys(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1149 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
1150 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
1154 static int dissect_recipientEncryptedKeys(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1155 return dissect_cms_RecipientEncryptedKeys(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientEncryptedKeys);
1159 static const ber_sequence_t KeyAgreeRecipientInfo_sequence[] = {
1160 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1161 { BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_originator },
1162 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ukm },
1163 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1164 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_recipientEncryptedKeys },
1169 dissect_cms_KeyAgreeRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1170 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1171 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
1175 static int dissect_kari_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1176 return dissect_cms_KeyAgreeRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kari);
1182 dissect_cms_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1183 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1188 static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1189 return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
1193 static const ber_sequence_t KEKIdentifier_sequence[] = {
1194 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_keyIdentifier },
1195 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_date },
1196 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_other },
1201 dissect_cms_KEKIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1202 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1203 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1207 static int dissect_kekid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1208 return dissect_cms_KEKIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_kekid);
1212 static const ber_sequence_t KEKRecipientInfo_sequence[] = {
1213 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1214 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_kekid },
1215 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_keyEncryptionAlgorithm },
1216 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_encryptedKey },
1221 dissect_cms_KEKRecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1222 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1223 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1227 static int dissect_kekri_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1228 return dissect_cms_KEKRecipientInfo(TRUE, tvb, offset, pinfo, tree, hf_cms_kekri);
1232 static const value_string cms_RecipientInfo_vals[] = {
1239 static const ber_choice_t RecipientInfo_choice[] = {
1240 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ktri },
1241 { 1, BER_CLASS_CON, 1, 0, dissect_kari_impl },
1242 { 2, BER_CLASS_CON, 2, 0, dissect_kekri_impl },
1243 { 0, 0, 0, 0, NULL }
1247 dissect_cms_RecipientInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1248 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1249 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo,
1254 static int dissect_RecipientInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1255 return dissect_cms_RecipientInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_RecipientInfos_item);
1259 static const ber_sequence_t RecipientInfos_set_of[1] = {
1260 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_RecipientInfos_item },
1264 dissect_cms_RecipientInfos(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1265 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1266 RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1270 static int dissect_recipientInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1271 return dissect_cms_RecipientInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_recipientInfos);
1277 dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1278 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1282 static int dissect_contentEncryptionAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1283 return dissect_cms_ContentEncryptionAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_contentEncryptionAlgorithm);
1289 dissect_cms_EncryptedContent(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1290 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1295 static int dissect_encryptedContent_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1296 return dissect_cms_EncryptedContent(TRUE, tvb, offset, pinfo, tree, hf_cms_encryptedContent);
1300 static const ber_sequence_t EncryptedContentInfo_sequence[] = {
1301 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_encryptedContentType },
1302 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_contentEncryptionAlgorithm },
1303 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_encryptedContent_impl },
1308 dissect_cms_EncryptedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1309 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1310 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1314 static int dissect_encryptedContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1315 return dissect_cms_EncryptedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encryptedContentInfo);
1319 static const ber_sequence_t UnprotectedAttributes_set_of[1] = {
1320 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnprotectedAttributes_item },
1324 dissect_cms_UnprotectedAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1325 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1326 UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1330 static int dissect_unprotectedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1331 return dissect_cms_UnprotectedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unprotectedAttrs);
1335 static const ber_sequence_t EnvelopedData_sequence[] = {
1336 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1337 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1338 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1339 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encryptedContentInfo },
1340 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1345 dissect_cms_EnvelopedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1346 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1347 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1355 dissect_cms_Digest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1356 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1361 static int dissect_digest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1362 return dissect_cms_Digest(FALSE, tvb, offset, pinfo, tree, hf_cms_digest);
1366 static const ber_sequence_t DigestedData_sequence[] = {
1367 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1368 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm },
1369 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1370 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_digest },
1375 dissect_cms_DigestedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1376 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1377 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1383 static const ber_sequence_t EncryptedData_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_encryptedContentInfo },
1386 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unprotectedAttrs_impl },
1391 dissect_cms_EncryptedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1392 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1393 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1401 dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1402 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1406 static int dissect_macAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1407 return dissect_cms_MessageAuthenticationCodeAlgorithm(FALSE, tvb, offset, pinfo, tree, hf_cms_macAlgorithm);
1411 static const ber_sequence_t AuthAttributes_set_of[1] = {
1412 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item },
1416 dissect_cms_AuthAttributes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1417 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
1418 AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1422 static int dissect_authenticatedAttributes_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1423 return dissect_cms_AuthAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_authenticatedAttributes);
1429 dissect_cms_MessageAuthenticationCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1430 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1435 static int dissect_mac(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1436 return dissect_cms_MessageAuthenticationCode(FALSE, tvb, offset, pinfo, tree, hf_cms_mac);
1440 static const ber_sequence_t AuthenticatedData_sequence[] = {
1441 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
1442 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_originatorInfo_impl },
1443 { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_recipientInfos },
1444 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_macAlgorithm },
1445 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_digestAlgorithm_impl },
1446 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo },
1447 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_authenticatedAttributes_impl },
1448 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_mac },
1449 { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unauthenticatedAttributes_impl },
1454 dissect_cms_AuthenticatedData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1455 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
1456 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1464 dissect_cms_MessageDigest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1466 int old_offset = offset;
1468 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
1472 pi = get_ber_last_created_item();
1475 old_offset = get_ber_identifier(tvb, old_offset, NULL, NULL, NULL);
1476 old_offset = get_ber_length(tree, tvb, old_offset, NULL, NULL);
1479 cms_verify_msg_digest(pi, content_tvb, x509af_get_last_algorithm_id(), tvb, old_offset);
1488 dissect_cms_UTCTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1489 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime,
1490 pinfo, tree, tvb, offset, hf_index,
1495 static int dissect_utcTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
1496 return dissect_cms_UTCTime(FALSE, tvb, offset, pinfo, tree, hf_cms_utcTime);
1500 static const value_string cms_Time_vals[] = {
1502 { 1, "generalTime" },
1506 static const ber_choice_t Time_choice[] = {
1507 { 0, BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_utcTime },
1508 { 1, BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_generalTime },
1509 { 0, 0, 0, 0, NULL }
1513 dissect_cms_Time(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1514 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
1515 Time_choice, hf_index, ett_cms_Time,
1524 dissect_cms_SigningTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1525 offset = dissect_cms_Time(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1533 dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
1534 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index);
1541 static void dissect_ContentInfo_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1542 dissect_cms_ContentInfo(FALSE, tvb, 0, pinfo, tree, hf_cms_ContentInfo_PDU);
1544 static void dissect_ContentType_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1545 dissect_cms_ContentType(FALSE, tvb, 0, pinfo, tree, hf_cms_ContentType_PDU);
1547 static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1548 dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
1550 static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1551 dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
1553 static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1554 dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
1556 static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1557 dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
1559 static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1560 dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
1562 static void dissect_MessageDigest_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1563 dissect_cms_MessageDigest(FALSE, tvb, 0, pinfo, tree, hf_cms_MessageDigest_PDU);
1565 static void dissect_SigningTime_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1566 dissect_cms_SigningTime(FALSE, tvb, 0, pinfo, tree, hf_cms_SigningTime_PDU);
1568 static void dissect_Countersignature_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
1569 dissect_cms_Countersignature(FALSE, tvb, 0, pinfo, tree, hf_cms_Countersignature_PDU);
1573 /*--- End of included file: packet-cms-fn.c ---*/
1576 /*--- proto_register_cms ----------------------------------------------*/
1577 void proto_register_cms(void) {
1579 /* List of fields */
1580 static hf_register_info hf[] = {
1581 { &hf_cms_ci_contentType,
1582 { "contentType", "cms.contentInfo.contentType",
1583 FT_STRING, BASE_NONE, NULL, 0,
1584 "ContentType", HFILL }},
1586 /*--- Included file: packet-cms-hfarr.c ---*/
1588 { &hf_cms_ContentInfo_PDU,
1589 { "ContentInfo", "cms.ContentInfo",
1590 FT_NONE, BASE_NONE, NULL, 0,
1591 "ContentInfo", HFILL }},
1592 { &hf_cms_ContentType_PDU,
1593 { "ContentType", "cms.ContentType",
1594 FT_STRING, BASE_NONE, NULL, 0,
1595 "ContentType", HFILL }},
1596 { &hf_cms_SignedData_PDU,
1597 { "SignedData", "cms.SignedData",
1598 FT_NONE, BASE_NONE, NULL, 0,
1599 "SignedData", HFILL }},
1600 { &hf_cms_EnvelopedData_PDU,
1601 { "EnvelopedData", "cms.EnvelopedData",
1602 FT_NONE, BASE_NONE, NULL, 0,
1603 "EnvelopedData", HFILL }},
1604 { &hf_cms_DigestedData_PDU,
1605 { "DigestedData", "cms.DigestedData",
1606 FT_NONE, BASE_NONE, NULL, 0,
1607 "DigestedData", HFILL }},
1608 { &hf_cms_EncryptedData_PDU,
1609 { "EncryptedData", "cms.EncryptedData",
1610 FT_NONE, BASE_NONE, NULL, 0,
1611 "EncryptedData", HFILL }},
1612 { &hf_cms_AuthenticatedData_PDU,
1613 { "AuthenticatedData", "cms.AuthenticatedData",
1614 FT_NONE, BASE_NONE, NULL, 0,
1615 "AuthenticatedData", HFILL }},
1616 { &hf_cms_MessageDigest_PDU,
1617 { "MessageDigest", "cms.MessageDigest",
1618 FT_BYTES, BASE_HEX, NULL, 0,
1619 "MessageDigest", HFILL }},
1620 { &hf_cms_SigningTime_PDU,
1621 { "SigningTime", "cms.SigningTime",
1622 FT_UINT32, BASE_DEC, VALS(x509af_Time_vals), 0,
1623 "SigningTime", HFILL }},
1624 { &hf_cms_Countersignature_PDU,
1625 { "Countersignature", "cms.Countersignature",
1626 FT_NONE, BASE_NONE, NULL, 0,
1627 "Countersignature", HFILL }},
1628 { &hf_cms_contentType,
1629 { "contentType", "cms.contentType",
1630 FT_STRING, BASE_NONE, NULL, 0,
1631 "ContentInfo/contentType", HFILL }},
1633 { "content", "cms.content",
1634 FT_NONE, BASE_NONE, NULL, 0,
1635 "ContentInfo/content", HFILL }},
1637 { "version", "cms.version",
1638 FT_INT32, BASE_DEC, VALS(cms_CMSVersion_vals), 0,
1640 { &hf_cms_digestAlgorithms,
1641 { "digestAlgorithms", "cms.digestAlgorithms",
1642 FT_UINT32, BASE_DEC, NULL, 0,
1643 "SignedData/digestAlgorithms", HFILL }},
1644 { &hf_cms_encapContentInfo,
1645 { "encapContentInfo", "cms.encapContentInfo",
1646 FT_NONE, BASE_NONE, NULL, 0,
1648 { &hf_cms_certificates,
1649 { "certificates", "cms.certificates",
1650 FT_UINT32, BASE_DEC, NULL, 0,
1651 "SignedData/certificates", HFILL }},
1653 { "crls", "cms.crls",
1654 FT_UINT32, BASE_DEC, NULL, 0,
1656 { &hf_cms_signerInfos,
1657 { "signerInfos", "cms.signerInfos",
1658 FT_UINT32, BASE_DEC, NULL, 0,
1659 "SignedData/signerInfos", HFILL }},
1660 { &hf_cms_DigestAlgorithmIdentifiers_item,
1661 { "Item", "cms.DigestAlgorithmIdentifiers_item",
1662 FT_NONE, BASE_NONE, NULL, 0,
1663 "DigestAlgorithmIdentifiers/_item", HFILL }},
1664 { &hf_cms_SignerInfos_item,
1665 { "Item", "cms.SignerInfos_item",
1666 FT_NONE, BASE_NONE, NULL, 0,
1667 "SignerInfos/_item", HFILL }},
1668 { &hf_cms_eContentType,
1669 { "eContentType", "cms.eContentType",
1670 FT_STRING, BASE_NONE, NULL, 0,
1671 "EncapsulatedContentInfo/eContentType", HFILL }},
1673 { "eContent", "cms.eContent",
1674 FT_BYTES, BASE_HEX, NULL, 0,
1675 "EncapsulatedContentInfo/eContent", HFILL }},
1678 FT_UINT32, BASE_DEC, VALS(cms_SignerIdentifier_vals), 0,
1679 "SignerInfo/sid", HFILL }},
1680 { &hf_cms_digestAlgorithm,
1681 { "digestAlgorithm", "cms.digestAlgorithm",
1682 FT_NONE, BASE_NONE, NULL, 0,
1684 { &hf_cms_signedAttrs,
1685 { "signedAttrs", "cms.signedAttrs",
1686 FT_UINT32, BASE_DEC, NULL, 0,
1687 "SignerInfo/signedAttrs", HFILL }},
1688 { &hf_cms_signatureAlgorithm,
1689 { "signatureAlgorithm", "cms.signatureAlgorithm",
1690 FT_NONE, BASE_NONE, NULL, 0,
1692 { &hf_cms_signatureValue,
1693 { "signature", "cms.signature",
1694 FT_BYTES, BASE_HEX, NULL, 0,
1695 "SignerInfo/signature", HFILL }},
1696 { &hf_cms_unsignedAttrs,
1697 { "unsignedAttrs", "cms.unsignedAttrs",
1698 FT_UINT32, BASE_DEC, NULL, 0,
1699 "SignerInfo/unsignedAttrs", HFILL }},
1700 { &hf_cms_issuerAndSerialNumber,
1701 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber",
1702 FT_NONE, BASE_NONE, NULL, 0,
1704 { &hf_cms_subjectKeyIdentifier,
1705 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
1706 FT_BYTES, BASE_HEX, NULL, 0,
1708 { &hf_cms_SignedAttributes_item,
1709 { "Item", "cms.SignedAttributes_item",
1710 FT_NONE, BASE_NONE, NULL, 0,
1711 "SignedAttributes/_item", HFILL }},
1712 { &hf_cms_UnsignedAttributes_item,
1713 { "Item", "cms.UnsignedAttributes_item",
1714 FT_NONE, BASE_NONE, NULL, 0,
1715 "UnsignedAttributes/_item", HFILL }},
1717 { "attrType", "cms.attrType",
1718 FT_STRING, BASE_NONE, NULL, 0,
1719 "Attribute/attrType", HFILL }},
1720 { &hf_cms_attrValues,
1721 { "attrValues", "cms.attrValues",
1722 FT_UINT32, BASE_DEC, NULL, 0,
1723 "Attribute/attrValues", HFILL }},
1724 { &hf_cms_attrValues_item,
1725 { "Item", "cms.attrValues_item",
1726 FT_NONE, BASE_NONE, NULL, 0,
1727 "Attribute/attrValues/_item", HFILL }},
1728 { &hf_cms_originatorInfo,
1729 { "originatorInfo", "cms.originatorInfo",
1730 FT_NONE, BASE_NONE, NULL, 0,
1732 { &hf_cms_recipientInfos,
1733 { "recipientInfos", "cms.recipientInfos",
1734 FT_UINT32, BASE_DEC, NULL, 0,
1736 { &hf_cms_encryptedContentInfo,
1737 { "encryptedContentInfo", "cms.encryptedContentInfo",
1738 FT_NONE, BASE_NONE, NULL, 0,
1740 { &hf_cms_unprotectedAttrs,
1741 { "unprotectedAttrs", "cms.unprotectedAttrs",
1742 FT_UINT32, BASE_DEC, NULL, 0,
1745 { "certs", "cms.certs",
1746 FT_UINT32, BASE_DEC, NULL, 0,
1747 "OriginatorInfo/certs", HFILL }},
1748 { &hf_cms_RecipientInfos_item,
1749 { "Item", "cms.RecipientInfos_item",
1750 FT_UINT32, BASE_DEC, VALS(cms_RecipientInfo_vals), 0,
1751 "RecipientInfos/_item", HFILL }},
1752 { &hf_cms_encryptedContentType,
1753 { "contentType", "cms.contentType",
1754 FT_STRING, BASE_NONE, NULL, 0,
1755 "EncryptedContentInfo/contentType", HFILL }},
1756 { &hf_cms_contentEncryptionAlgorithm,
1757 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm",
1758 FT_NONE, BASE_NONE, NULL, 0,
1759 "EncryptedContentInfo/contentEncryptionAlgorithm", HFILL }},
1760 { &hf_cms_encryptedContent,
1761 { "encryptedContent", "cms.encryptedContent",
1762 FT_BYTES, BASE_HEX, NULL, 0,
1763 "EncryptedContentInfo/encryptedContent", HFILL }},
1764 { &hf_cms_UnprotectedAttributes_item,
1765 { "Item", "cms.UnprotectedAttributes_item",
1766 FT_NONE, BASE_NONE, NULL, 0,
1767 "UnprotectedAttributes/_item", HFILL }},
1769 { "ktri", "cms.ktri",
1770 FT_NONE, BASE_NONE, NULL, 0,
1771 "RecipientInfo/ktri", HFILL }},
1773 { "kari", "cms.kari",
1774 FT_NONE, BASE_NONE, NULL, 0,
1775 "RecipientInfo/kari", HFILL }},
1777 { "kekri", "cms.kekri",
1778 FT_NONE, BASE_NONE, NULL, 0,
1779 "RecipientInfo/kekri", HFILL }},
1782 FT_UINT32, BASE_DEC, VALS(cms_RecipientIdentifier_vals), 0,
1783 "KeyTransRecipientInfo/rid", HFILL }},
1784 { &hf_cms_keyEncryptionAlgorithm,
1785 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm",
1786 FT_NONE, BASE_NONE, NULL, 0,
1788 { &hf_cms_encryptedKey,
1789 { "encryptedKey", "cms.encryptedKey",
1790 FT_BYTES, BASE_HEX, NULL, 0,
1792 { &hf_cms_originator,
1793 { "originator", "cms.originator",
1794 FT_UINT32, BASE_DEC, VALS(cms_OriginatorIdentifierOrKey_vals), 0,
1795 "KeyAgreeRecipientInfo/originator", HFILL }},
1798 FT_BYTES, BASE_HEX, NULL, 0,
1799 "KeyAgreeRecipientInfo/ukm", HFILL }},
1800 { &hf_cms_recipientEncryptedKeys,
1801 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
1802 FT_UINT32, BASE_DEC, NULL, 0,
1803 "KeyAgreeRecipientInfo/recipientEncryptedKeys", HFILL }},
1804 { &hf_cms_originatorKey,
1805 { "originatorKey", "cms.originatorKey",
1806 FT_NONE, BASE_NONE, NULL, 0,
1807 "OriginatorIdentifierOrKey/originatorKey", HFILL }},
1808 { &hf_cms_algorithm,
1809 { "algorithm", "cms.algorithm",
1810 FT_NONE, BASE_NONE, NULL, 0,
1811 "OriginatorPublicKey/algorithm", HFILL }},
1812 { &hf_cms_publicKey,
1813 { "publicKey", "cms.publicKey",
1814 FT_BYTES, BASE_HEX, NULL, 0,
1815 "OriginatorPublicKey/publicKey", HFILL }},
1816 { &hf_cms_RecipientEncryptedKeys_item,
1817 { "Item", "cms.RecipientEncryptedKeys_item",
1818 FT_NONE, BASE_NONE, NULL, 0,
1819 "RecipientEncryptedKeys/_item", HFILL }},
1822 FT_UINT32, BASE_DEC, VALS(cms_KeyAgreeRecipientIdentifier_vals), 0,
1823 "RecipientEncryptedKey/rid", HFILL }},
1825 { "rKeyId", "cms.rKeyId",
1826 FT_NONE, BASE_NONE, NULL, 0,
1827 "KeyAgreeRecipientIdentifier/rKeyId", HFILL }},
1829 { "date", "cms.date",
1830 FT_STRING, BASE_NONE, NULL, 0,
1833 { "other", "cms.other",
1834 FT_NONE, BASE_NONE, NULL, 0,
1837 { "kekid", "cms.kekid",
1838 FT_NONE, BASE_NONE, NULL, 0,
1839 "KEKRecipientInfo/kekid", HFILL }},
1840 { &hf_cms_keyIdentifier,
1841 { "keyIdentifier", "cms.keyIdentifier",
1842 FT_BYTES, BASE_HEX, NULL, 0,
1843 "KEKIdentifier/keyIdentifier", HFILL }},
1845 { "digest", "cms.digest",
1846 FT_BYTES, BASE_HEX, NULL, 0,
1847 "DigestedData/digest", HFILL }},
1848 { &hf_cms_macAlgorithm,
1849 { "macAlgorithm", "cms.macAlgorithm",
1850 FT_NONE, BASE_NONE, NULL, 0,
1851 "AuthenticatedData/macAlgorithm", HFILL }},
1852 { &hf_cms_authenticatedAttributes,
1853 { "authenticatedAttributes", "cms.authenticatedAttributes",
1854 FT_UINT32, BASE_DEC, NULL, 0,
1855 "AuthenticatedData/authenticatedAttributes", HFILL }},
1858 FT_BYTES, BASE_HEX, NULL, 0,
1859 "AuthenticatedData/mac", HFILL }},
1860 { &hf_cms_unauthenticatedAttributes,
1861 { "unauthenticatedAttributes", "cms.unauthenticatedAttributes",
1862 FT_UINT32, BASE_DEC, NULL, 0,
1863 "AuthenticatedData/unauthenticatedAttributes", HFILL }},
1864 { &hf_cms_AuthAttributes_item,
1865 { "Item", "cms.AuthAttributes_item",
1866 FT_NONE, BASE_NONE, NULL, 0,
1867 "AuthAttributes/_item", HFILL }},
1868 { &hf_cms_UnauthAttributes_item,
1869 { "Item", "cms.UnauthAttributes_item",
1870 FT_NONE, BASE_NONE, NULL, 0,
1871 "UnauthAttributes/_item", HFILL }},
1872 { &hf_cms_CertificateRevocationLists_item,
1873 { "Item", "cms.CertificateRevocationLists_item",
1874 FT_NONE, BASE_NONE, NULL, 0,
1875 "CertificateRevocationLists/_item", HFILL }},
1876 { &hf_cms_certificate,
1877 { "certificate", "cms.certificate",
1878 FT_NONE, BASE_NONE, NULL, 0,
1880 { &hf_cms_extendedCertificate,
1881 { "extendedCertificate", "cms.extendedCertificate",
1882 FT_NONE, BASE_NONE, NULL, 0,
1883 "CertificateChoices/extendedCertificate", HFILL }},
1885 { "attrCert", "cms.attrCert",
1886 FT_NONE, BASE_NONE, NULL, 0,
1887 "CertificateChoices/attrCert", HFILL }},
1888 { &hf_cms_CertificateSet_item,
1889 { "Item", "cms.CertificateSet_item",
1890 FT_UINT32, BASE_DEC, VALS(cms_CertificateChoices_vals), 0,
1891 "CertificateSet/_item", HFILL }},
1893 { "issuer", "cms.issuer",
1894 FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
1895 "IssuerAndSerialNumber/issuer", HFILL }},
1896 { &hf_cms_serialNumber,
1897 { "serialNumber", "cms.serialNumber",
1898 FT_INT32, BASE_DEC, NULL, 0,
1899 "IssuerAndSerialNumber/serialNumber", HFILL }},
1900 { &hf_cms_keyAttrId,
1901 { "keyAttrId", "cms.keyAttrId",
1902 FT_STRING, BASE_NONE, NULL, 0,
1903 "OtherKeyAttribute/keyAttrId", HFILL }},
1905 { "keyAttr", "cms.keyAttr",
1906 FT_NONE, BASE_NONE, NULL, 0,
1907 "OtherKeyAttribute/keyAttr", HFILL }},
1909 { "utcTime", "cms.utcTime",
1910 FT_STRING, BASE_NONE, NULL, 0,
1911 "Time/utcTime", HFILL }},
1912 { &hf_cms_generalTime,
1913 { "generalTime", "cms.generalTime",
1914 FT_STRING, BASE_NONE, NULL, 0,
1915 "Time/generalTime", HFILL }},
1916 { &hf_cms_extendedCertificateInfo,
1917 { "extendedCertificateInfo", "cms.extendedCertificateInfo",
1918 FT_NONE, BASE_NONE, NULL, 0,
1919 "ExtendedCertificate/extendedCertificateInfo", HFILL }},
1920 { &hf_cms_signature,
1921 { "signature", "cms.signature",
1922 FT_BYTES, BASE_HEX, NULL, 0,
1923 "ExtendedCertificate/signature", HFILL }},
1924 { &hf_cms_attributes,
1925 { "attributes", "cms.attributes",
1926 FT_UINT32, BASE_DEC, NULL, 0,
1927 "ExtendedCertificateInfo/attributes", HFILL }},
1929 /*--- End of included file: packet-cms-hfarr.c ---*/
1933 /* List of subtrees */
1934 static gint *ett[] = {
1936 /*--- Included file: packet-cms-ettarr.c ---*/
1938 &ett_cms_ContentInfo,
1939 &ett_cms_SignedData,
1940 &ett_cms_DigestAlgorithmIdentifiers,
1941 &ett_cms_SignerInfos,
1942 &ett_cms_EncapsulatedContentInfo,
1943 &ett_cms_SignerInfo,
1944 &ett_cms_SignerIdentifier,
1945 &ett_cms_SignedAttributes,
1946 &ett_cms_UnsignedAttributes,
1948 &ett_cms_SET_OF_AttributeValue,
1949 &ett_cms_EnvelopedData,
1950 &ett_cms_OriginatorInfo,
1951 &ett_cms_RecipientInfos,
1952 &ett_cms_EncryptedContentInfo,
1953 &ett_cms_UnprotectedAttributes,
1954 &ett_cms_RecipientInfo,
1955 &ett_cms_KeyTransRecipientInfo,
1956 &ett_cms_RecipientIdentifier,
1957 &ett_cms_KeyAgreeRecipientInfo,
1958 &ett_cms_OriginatorIdentifierOrKey,
1959 &ett_cms_OriginatorPublicKey,
1960 &ett_cms_RecipientEncryptedKeys,
1961 &ett_cms_RecipientEncryptedKey,
1962 &ett_cms_KeyAgreeRecipientIdentifier,
1963 &ett_cms_RecipientKeyIdentifier,
1964 &ett_cms_KEKRecipientInfo,
1965 &ett_cms_KEKIdentifier,
1966 &ett_cms_DigestedData,
1967 &ett_cms_EncryptedData,
1968 &ett_cms_AuthenticatedData,
1969 &ett_cms_AuthAttributes,
1970 &ett_cms_UnauthAttributes,
1971 &ett_cms_CertificateRevocationLists,
1972 &ett_cms_CertificateChoices,
1973 &ett_cms_CertificateSet,
1974 &ett_cms_IssuerAndSerialNumber,
1975 &ett_cms_OtherKeyAttribute,
1977 &ett_cms_ExtendedCertificate,
1978 &ett_cms_ExtendedCertificateInfo,
1980 /*--- End of included file: packet-cms-ettarr.c ---*/
1984 /* Register protocol */
1985 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
1987 /* Register fields and subtrees */
1988 proto_register_field_array(proto_cms, hf, array_length(hf));
1989 proto_register_subtree_array(ett, array_length(ett));
1994 /*--- proto_reg_handoff_cms -------------------------------------------*/
1995 void proto_reg_handoff_cms(void) {
1997 /*--- Included file: packet-cms-dis-tab.c ---*/
1999 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.6", dissect_ContentInfo_PDU, proto_cms, "id-ct-contentInfo");
2000 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
2001 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
2002 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
2003 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
2004 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
2005 register_ber_oid_dissector("1.2.840.113549.1.9.3", dissect_ContentType_PDU, proto_cms, "id-contentType");
2006 register_ber_oid_dissector("1.2.840.113549.1.9.4", dissect_MessageDigest_PDU, proto_cms, "id-messageDigest");
2007 register_ber_oid_dissector("1.2.840.113549.1.9.5", dissect_SigningTime_PDU, proto_cms, "id-signingTime");
2008 register_ber_oid_dissector("1.2.840.113549.1.9.6", dissect_Countersignature_PDU, proto_cms, "id-counterSignature");
2011 /*--- End of included file: packet-cms-dis-tab.c ---*/