Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-cms.c
blob56a183083953e5d452d0461e5d36b7cd42ef5d59
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-cms.c */
4 /* asn2wrs.py -b -C -q -L -p cms -c ./cms.cnf -s ./packet-cms-template -D . -O ../.. CryptographicMessageSyntax.asn AttributeCertificateVersion1.asn CMSFirmwareWrapper.asn */
6 /* packet-cms.c
7 * Routines for RFC5652 Cryptographic Message Syntax packet dissection
8 * Ronnie Sahlberg 2004
9 * Stig Bjorlykke 2010
10 * Uwe Heuert 2022
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include "config.h"
21 #include <epan/packet.h>
22 #include <epan/oids.h>
23 #include <epan/asn1.h>
24 #include <epan/proto_data.h>
25 #include <wsutil/wsgcrypt.h>
26 #include <wsutil/array.h>
28 #include "packet-ber.h"
29 #include "packet-cms.h"
30 #include "packet-x509af.h"
31 #include "packet-x509ce.h"
32 #include "packet-x509if.h"
33 #include "packet-x509sat.h"
34 #include "packet-pkcs12.h"
36 #define PNAME "Cryptographic Message Syntax"
37 #define PSNAME "CMS"
38 #define PFNAME "cms"
40 void proto_register_cms(void);
41 void proto_reg_handoff_cms(void);
43 /* Initialize the protocol and registered fields */
44 static int proto_cms;
45 static int hf_cms_ci_contentType;
46 static int hf_cms_ContentInfo_PDU; /* ContentInfo */
47 static int hf_cms_ContentType_PDU; /* ContentType */
48 static int hf_cms_SignedData_PDU; /* SignedData */
49 static int hf_cms_EnvelopedData_PDU; /* EnvelopedData */
50 static int hf_cms_EncryptedContentInfo_PDU; /* EncryptedContentInfo */
51 static int hf_cms_DigestedData_PDU; /* DigestedData */
52 static int hf_cms_EncryptedData_PDU; /* EncryptedData */
53 static int hf_cms_AuthenticatedData_PDU; /* AuthenticatedData */
54 static int hf_cms_KeyEncryptionAlgorithmIdentifier_PDU; /* KeyEncryptionAlgorithmIdentifier */
55 static int hf_cms_IssuerAndSerialNumber_PDU; /* IssuerAndSerialNumber */
56 static int hf_cms_MessageDigest_PDU; /* MessageDigest */
57 static int hf_cms_SigningTime_PDU; /* SigningTime */
58 static int hf_cms_Countersignature_PDU; /* Countersignature */
59 static int hf_cms_KeyWrapAlgorithm_PDU; /* KeyWrapAlgorithm */
60 static int hf_cms_RC2WrapParameter_PDU; /* RC2WrapParameter */
61 static int hf_cms_IV_PDU; /* IV */
62 static int hf_cms_SMIMECapabilities_PDU; /* SMIMECapabilities */
63 static int hf_cms_SMIMEEncryptionKeyPreference_PDU; /* SMIMEEncryptionKeyPreference */
64 static int hf_cms_RC2CBCParameters_PDU; /* RC2CBCParameters */
65 static int hf_cms_AuthEnvelopedData_PDU; /* AuthEnvelopedData */
66 static int hf_cms_CCMParameters_PDU; /* CCMParameters */
67 static int hf_cms_GCMParameters_PDU; /* GCMParameters */
68 static int hf_cms_FirmwarePkgData_PDU; /* FirmwarePkgData */
69 static int hf_cms_FirmwarePackageIdentifier_PDU; /* FirmwarePackageIdentifier */
70 static int hf_cms_TargetHardwareIdentifiers_PDU; /* TargetHardwareIdentifiers */
71 static int hf_cms_DecryptKeyIdentifier_PDU; /* DecryptKeyIdentifier */
72 static int hf_cms_ImplementedCryptoAlgorithms_PDU; /* ImplementedCryptoAlgorithms */
73 static int hf_cms_ImplementedCompressAlgorithms_PDU; /* ImplementedCompressAlgorithms */
74 static int hf_cms_CommunityIdentifiers_PDU; /* CommunityIdentifiers */
75 static int hf_cms_FirmwarePackageInfo_PDU; /* FirmwarePackageInfo */
76 static int hf_cms_WrappedFirmwareKey_PDU; /* WrappedFirmwareKey */
77 static int hf_cms_FirmwarePackageLoadReceipt_PDU; /* FirmwarePackageLoadReceipt */
78 static int hf_cms_FirmwarePackageLoadError_PDU; /* FirmwarePackageLoadError */
79 static int hf_cms_HardwareModuleName_PDU; /* HardwareModuleName */
80 static int hf_cms_FirmwarePackageMessageDigest_PDU; /* FirmwarePackageMessageDigest */
81 static int hf_cms_contentType; /* ContentType */
82 static int hf_cms_content; /* T_content */
83 static int hf_cms_version; /* CMSVersion */
84 static int hf_cms_digestAlgorithms; /* DigestAlgorithmIdentifiers */
85 static int hf_cms_encapContentInfo; /* EncapsulatedContentInfo */
86 static int hf_cms_certificates; /* CertificateSet */
87 static int hf_cms_crls; /* RevocationInfoChoices */
88 static int hf_cms_signerInfos; /* SignerInfos */
89 static int hf_cms_DigestAlgorithmIdentifiers_item; /* DigestAlgorithmIdentifier */
90 static int hf_cms_SignerInfos_item; /* SignerInfo */
91 static int hf_cms_eContentType; /* ContentType */
92 static int hf_cms_eContent; /* T_eContent */
93 static int hf_cms_sid; /* SignerIdentifier */
94 static int hf_cms_digestAlgorithm; /* DigestAlgorithmIdentifier */
95 static int hf_cms_signedAttrs; /* SignedAttributes */
96 static int hf_cms_signatureAlgorithm; /* SignatureAlgorithmIdentifier */
97 static int hf_cms_signatureValue; /* SignatureValue */
98 static int hf_cms_unsignedAttrs; /* UnsignedAttributes */
99 static int hf_cms_issuerAndSerialNumber; /* IssuerAndSerialNumber */
100 static int hf_cms_subjectKeyIdentifier; /* SubjectKeyIdentifier */
101 static int hf_cms_SignedAttributes_item; /* Attribute */
102 static int hf_cms_UnsignedAttributes_item; /* Attribute */
103 static int hf_cms_attrType; /* T_attrType */
104 static int hf_cms_attrValues; /* SET_OF_AttributeValue */
105 static int hf_cms_attrValues_item; /* AttributeValue */
106 static int hf_cms_originatorInfo; /* OriginatorInfo */
107 static int hf_cms_recipientInfos; /* RecipientInfos */
108 static int hf_cms_encryptedContentInfo; /* EncryptedContentInfo */
109 static int hf_cms_unprotectedAttrs; /* UnprotectedAttributes */
110 static int hf_cms_certs; /* CertificateSet */
111 static int hf_cms_RecipientInfos_item; /* RecipientInfo */
112 static int hf_cms_encryptedContentType; /* ContentType */
113 static int hf_cms_contentEncryptionAlgorithm; /* ContentEncryptionAlgorithmIdentifier */
114 static int hf_cms_encryptedContent; /* EncryptedContent */
115 static int hf_cms_UnprotectedAttributes_item; /* Attribute */
116 static int hf_cms_ktri; /* KeyTransRecipientInfo */
117 static int hf_cms_kari; /* KeyAgreeRecipientInfo */
118 static int hf_cms_kekri; /* KEKRecipientInfo */
119 static int hf_cms_pwri; /* PasswordRecipientInfo */
120 static int hf_cms_ori; /* OtherRecipientInfo */
121 static int hf_cms_rid; /* RecipientIdentifier */
122 static int hf_cms_keyEncryptionAlgorithm; /* KeyEncryptionAlgorithmIdentifier */
123 static int hf_cms_encryptedKey; /* EncryptedKey */
124 static int hf_cms_originator; /* OriginatorIdentifierOrKey */
125 static int hf_cms_ukm; /* UserKeyingMaterial */
126 static int hf_cms_recipientEncryptedKeys; /* RecipientEncryptedKeys */
127 static int hf_cms_originatorKey; /* OriginatorPublicKey */
128 static int hf_cms_algorithm; /* AlgorithmIdentifier */
129 static int hf_cms_publicKey; /* BIT_STRING */
130 static int hf_cms_RecipientEncryptedKeys_item; /* RecipientEncryptedKey */
131 static int hf_cms_rekRid; /* KeyAgreeRecipientIdentifier */
132 static int hf_cms_rKeyId; /* RecipientKeyIdentifier */
133 static int hf_cms_date; /* GeneralizedTime */
134 static int hf_cms_other; /* OtherKeyAttribute */
135 static int hf_cms_kekid; /* KEKIdentifier */
136 static int hf_cms_keyIdentifier; /* OCTET_STRING */
137 static int hf_cms_keyDerivationAlgorithm; /* KeyDerivationAlgorithmIdentifier */
138 static int hf_cms_oriType; /* T_oriType */
139 static int hf_cms_oriValue; /* T_oriValue */
140 static int hf_cms_digest; /* Digest */
141 static int hf_cms_macAlgorithm; /* MessageAuthenticationCodeAlgorithm */
142 static int hf_cms_authAttrs; /* AuthAttributes */
143 static int hf_cms_mac; /* MessageAuthenticationCode */
144 static int hf_cms_unauthAttrs; /* UnauthAttributes */
145 static int hf_cms_AuthAttributes_item; /* Attribute */
146 static int hf_cms_UnauthAttributes_item; /* Attribute */
147 static int hf_cms_RevocationInfoChoices_item; /* RevocationInfoChoice */
148 static int hf_cms_crl; /* CertificateList */
149 static int hf_cms_otherRIC; /* OtherRevocationInfoFormat */
150 static int hf_cms_otherRevInfoFormat; /* T_otherRevInfoFormat */
151 static int hf_cms_otherRevInfo; /* T_otherRevInfo */
152 static int hf_cms_certificate; /* Certificate */
153 static int hf_cms_extendedCertificate; /* ExtendedCertificate */
154 static int hf_cms_v1AttrCert; /* AttributeCertificateV1 */
155 static int hf_cms_v2AttrCert; /* AttributeCertificateV2 */
156 static int hf_cms_CertificateSet_item; /* CertificateChoices */
157 static int hf_cms_issuer; /* Name */
158 static int hf_cms_serialNumber; /* CertificateSerialNumber */
159 static int hf_cms_keyAttrId; /* T_keyAttrId */
160 static int hf_cms_keyAttr; /* T_keyAttr */
161 static int hf_cms_utcTime; /* UTCTime */
162 static int hf_cms_generalTime; /* GeneralizedTime */
163 static int hf_cms_rc2ParameterVersion; /* INTEGER */
164 static int hf_cms_iv; /* OCTET_STRING */
165 static int hf_cms_extendedCertificateInfo; /* ExtendedCertificateInfo */
166 static int hf_cms_signature; /* Signature */
167 static int hf_cms_attributes; /* UnauthAttributes */
168 static int hf_cms_SMIMECapabilities_item; /* SMIMECapability */
169 static int hf_cms_capability; /* T_capability */
170 static int hf_cms_parameters; /* T_parameters */
171 static int hf_cms_recipientKeyId; /* RecipientKeyIdentifier */
172 static int hf_cms_subjectAltKeyIdentifier; /* SubjectKeyIdentifier */
173 static int hf_cms_rc2WrapParameter; /* RC2WrapParameter */
174 static int hf_cms_rc2CBCParameter; /* RC2CBCParameter */
175 static int hf_cms_authEncryptedContentInfo; /* EncryptedContentInfo */
176 static int hf_cms_aes_nonce; /* OCTET_STRING_SIZE_7_13 */
177 static int hf_cms_aes_ICVlen; /* AES_CCM_ICVlen */
178 static int hf_cms_aes_nonce_01; /* OCTET_STRING */
179 static int hf_cms_aes_ICVlen_01; /* AES_GCM_ICVlen */
180 static int hf_cms_acInfo; /* AttributeCertificateInfoV1 */
181 static int hf_cms_signatureAlgorithm_v1; /* AlgorithmIdentifier */
182 static int hf_cms_signatureValue_v1; /* BIT_STRING */
183 static int hf_cms_version_v1; /* AttCertVersionV1 */
184 static int hf_cms_subject; /* T_subject */
185 static int hf_cms_baseCertificateID; /* IssuerSerial */
186 static int hf_cms_subjectName; /* GeneralNames */
187 static int hf_cms_issuer_v1; /* GeneralNames */
188 static int hf_cms_signature_v1; /* AlgorithmIdentifier */
189 static int hf_cms_attCertValidityPeriod; /* AttCertValidityPeriod */
190 static int hf_cms_attributes_v1; /* SEQUENCE_OF_Attribute */
191 static int hf_cms_attributes_v1_item; /* Attribute */
192 static int hf_cms_issuerUniqueID; /* UniqueIdentifier */
193 static int hf_cms_extensions; /* Extensions */
194 static int hf_cms_name; /* PreferredOrLegacyPackageIdentifier */
195 static int hf_cms_stale; /* PreferredOrLegacyStalePackageIdentifier */
196 static int hf_cms_preferred; /* PreferredPackageIdentifier */
197 static int hf_cms_legacy; /* OCTET_STRING */
198 static int hf_cms_fwPkgID; /* OBJECT_IDENTIFIER */
199 static int hf_cms_verNum; /* INTEGER_0_MAX */
200 static int hf_cms_preferredStaleVerNum; /* INTEGER_0_MAX */
201 static int hf_cms_legacyStaleVersion; /* OCTET_STRING */
202 static int hf_cms_TargetHardwareIdentifiers_item; /* OBJECT_IDENTIFIER */
203 static int hf_cms_ImplementedCryptoAlgorithms_item; /* OBJECT_IDENTIFIER */
204 static int hf_cms_ImplementedCompressAlgorithms_item; /* OBJECT_IDENTIFIER */
205 static int hf_cms_CommunityIdentifiers_item; /* CommunityIdentifier */
206 static int hf_cms_communityOID; /* OBJECT_IDENTIFIER */
207 static int hf_cms_hwModuleList; /* HardwareModules */
208 static int hf_cms_hwType; /* OBJECT_IDENTIFIER */
209 static int hf_cms_hwSerialEntries; /* SEQUENCE_OF_HardwareSerialEntry */
210 static int hf_cms_hwSerialEntries_item; /* HardwareSerialEntry */
211 static int hf_cms_all; /* NULL */
212 static int hf_cms_single; /* OCTET_STRING */
213 static int hf_cms_block; /* T_block */
214 static int hf_cms_low; /* OCTET_STRING */
215 static int hf_cms_high; /* OCTET_STRING */
216 static int hf_cms_fwPkgType; /* INTEGER */
217 static int hf_cms_dependencies; /* SEQUENCE_OF_PreferredOrLegacyPackageIdentifier */
218 static int hf_cms_dependencies_item; /* PreferredOrLegacyPackageIdentifier */
219 static int hf_cms_fwReceiptVersion; /* FWReceiptVersion */
220 static int hf_cms_hwSerialNum; /* OCTET_STRING */
221 static int hf_cms_fwPkgName; /* PreferredOrLegacyPackageIdentifier */
222 static int hf_cms_trustAnchorKeyID; /* OCTET_STRING */
223 static int hf_cms_decryptKeyID; /* OCTET_STRING */
224 static int hf_cms_fwErrorVersion; /* FWErrorVersion */
225 static int hf_cms_errorCode; /* FirmwarePackageLoadErrorCode */
226 static int hf_cms_vendorErrorCode; /* VendorLoadErrorCode */
227 static int hf_cms_config; /* SEQUENCE_OF_CurrentFWConfig */
228 static int hf_cms_config_item; /* CurrentFWConfig */
229 static int hf_cms_msgDigest; /* OCTET_STRING */
231 /* Initialize the subtree pointers */
232 static int ett_cms;
233 static int ett_cms_ContentInfo;
234 static int ett_cms_SignedData;
235 static int ett_cms_DigestAlgorithmIdentifiers;
236 static int ett_cms_SignerInfos;
237 static int ett_cms_EncapsulatedContentInfo;
238 static int ett_cms_SignerInfo;
239 static int ett_cms_SignerIdentifier;
240 static int ett_cms_SignedAttributes;
241 static int ett_cms_UnsignedAttributes;
242 static int ett_cms_Attribute;
243 static int ett_cms_SET_OF_AttributeValue;
244 static int ett_cms_EnvelopedData;
245 static int ett_cms_OriginatorInfo;
246 static int ett_cms_RecipientInfos;
247 static int ett_cms_EncryptedContentInfo;
248 static int ett_cms_UnprotectedAttributes;
249 static int ett_cms_RecipientInfo;
250 static int ett_cms_KeyTransRecipientInfo;
251 static int ett_cms_RecipientIdentifier;
252 static int ett_cms_KeyAgreeRecipientInfo;
253 static int ett_cms_OriginatorIdentifierOrKey;
254 static int ett_cms_OriginatorPublicKey;
255 static int ett_cms_RecipientEncryptedKeys;
256 static int ett_cms_RecipientEncryptedKey;
257 static int ett_cms_KeyAgreeRecipientIdentifier;
258 static int ett_cms_RecipientKeyIdentifier;
259 static int ett_cms_KEKRecipientInfo;
260 static int ett_cms_KEKIdentifier;
261 static int ett_cms_PasswordRecipientInfo;
262 static int ett_cms_OtherRecipientInfo;
263 static int ett_cms_DigestedData;
264 static int ett_cms_EncryptedData;
265 static int ett_cms_AuthenticatedData;
266 static int ett_cms_AuthAttributes;
267 static int ett_cms_UnauthAttributes;
268 static int ett_cms_RevocationInfoChoices;
269 static int ett_cms_RevocationInfoChoice;
270 static int ett_cms_OtherRevocationInfoFormat;
271 static int ett_cms_CertificateChoices;
272 static int ett_cms_CertificateSet;
273 static int ett_cms_IssuerAndSerialNumber;
274 static int ett_cms_OtherKeyAttribute;
275 static int ett_cms_Time;
276 static int ett_cms_RC2CBCParameter;
277 static int ett_cms_ExtendedCertificate;
278 static int ett_cms_ExtendedCertificateInfo;
279 static int ett_cms_DigestInfo;
280 static int ett_cms_SMIMECapabilities;
281 static int ett_cms_SMIMECapability;
282 static int ett_cms_SMIMEEncryptionKeyPreference;
283 static int ett_cms_RC2CBCParameters;
284 static int ett_cms_AuthEnvelopedData;
285 static int ett_cms_CCMParameters;
286 static int ett_cms_GCMParameters;
287 static int ett_cms_AttributeCertificateV1;
288 static int ett_cms_AttributeCertificateInfoV1;
289 static int ett_cms_T_subject;
290 static int ett_cms_SEQUENCE_OF_Attribute;
291 static int ett_cms_FirmwarePackageIdentifier;
292 static int ett_cms_PreferredOrLegacyPackageIdentifier;
293 static int ett_cms_PreferredPackageIdentifier;
294 static int ett_cms_PreferredOrLegacyStalePackageIdentifier;
295 static int ett_cms_TargetHardwareIdentifiers;
296 static int ett_cms_ImplementedCryptoAlgorithms;
297 static int ett_cms_ImplementedCompressAlgorithms;
298 static int ett_cms_CommunityIdentifiers;
299 static int ett_cms_CommunityIdentifier;
300 static int ett_cms_HardwareModules;
301 static int ett_cms_SEQUENCE_OF_HardwareSerialEntry;
302 static int ett_cms_HardwareSerialEntry;
303 static int ett_cms_T_block;
304 static int ett_cms_FirmwarePackageInfo;
305 static int ett_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier;
306 static int ett_cms_FirmwarePackageLoadReceipt;
307 static int ett_cms_FirmwarePackageLoadError;
308 static int ett_cms_SEQUENCE_OF_CurrentFWConfig;
309 static int ett_cms_CurrentFWConfig;
310 static int ett_cms_HardwareModuleName;
311 static int ett_cms_FirmwarePackageMessageDigest;
313 static dissector_handle_t cms_handle;
315 static int dissect_cms_OCTET_STRING(bool implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) ; /* XXX kill a compiler warning until asn2wrs stops generating these silly wrappers */
317 struct cms_private_data {
318 const char *object_identifier_id;
319 tvbuff_t *content_tvb;
322 static proto_tree *top_tree;
323 static proto_tree *cap_tree;
325 #define HASH_SHA1 "1.3.14.3.2.26"
327 #define HASH_MD5 "1.2.840.113549.2.5"
330 /* SHA-2 variants */
331 #define HASH_SHA224 "2.16.840.1.101.3.4.2.4"
332 #define SHA224_BUFFER_SIZE 32 /* actually 28 */
333 #define HASH_SHA256 "2.16.840.1.101.3.4.2.1"
334 #define SHA256_BUFFER_SIZE 32
336 unsigned char digest_buf[MAX(HASH_SHA1_LENGTH, HASH_MD5_LENGTH)];
339 * Dissect CMS PDUs inside a PPDU.
341 static int
342 dissect_cms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
344 int offset = 0;
345 proto_item *item=NULL;
346 proto_tree *tree=NULL;
347 asn1_ctx_t asn1_ctx;
348 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
350 if(parent_tree){
351 item = proto_tree_add_item(parent_tree, proto_cms, tvb, 0, -1, ENC_NA);
352 tree = proto_item_add_subtree(item, ett_cms);
354 col_set_str(pinfo->cinfo, COL_PROTOCOL, "CMS");
355 col_clear(pinfo->cinfo, COL_INFO);
357 while (tvb_reported_length_remaining(tvb, offset) > 0){
358 offset=dissect_cms_ContentInfo(false, tvb, offset, &asn1_ctx , tree, -1);
360 return tvb_captured_length(tvb);
363 static struct cms_private_data*
364 cms_get_private_data(packet_info *pinfo)
366 struct cms_private_data *cms_data = (struct cms_private_data*)p_get_proto_data(pinfo->pool, pinfo, proto_cms, 0);
367 if (!cms_data) {
368 cms_data = wmem_new0(pinfo->pool, struct cms_private_data);
369 p_add_proto_data(pinfo->pool, pinfo, proto_cms, 0, cms_data);
371 return cms_data;
374 static void
375 cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff_t *tvb, int offset)
377 int i= 0, buffer_size = 0;
379 /* we only support two algorithms at the moment - if we do add SHA2
380 we should add a registration process to use a registration process */
382 if(strcmp(alg, HASH_SHA1) == 0) {
383 gcry_md_hash_buffer(GCRY_MD_SHA1, digest_buf, tvb_get_ptr(content, 0, tvb_captured_length(content)), tvb_captured_length(content));
384 buffer_size = HASH_SHA1_LENGTH;
386 } else if(strcmp(alg, HASH_MD5) == 0) {
387 gcry_md_hash_buffer(GCRY_MD_MD5, digest_buf, tvb_get_ptr(content, 0, tvb_captured_length(content)), tvb_captured_length(content));
388 buffer_size = HASH_MD5_LENGTH;
391 if(buffer_size) {
392 /* compare our computed hash with what we have received */
394 if(tvb_bytes_exist(tvb, offset, buffer_size) &&
395 (tvb_memeql(tvb, offset, digest_buf, buffer_size) != 0)) {
396 proto_item_append_text(pi, " [incorrect, should be ");
397 for(i = 0; i < buffer_size; i++)
398 proto_item_append_text(pi, "%02X", digest_buf[i]);
400 proto_item_append_text(pi, "]");
402 else
403 proto_item_append_text(pi, " [correct]");
404 } else {
405 proto_item_append_text(pi, " [unable to verify]");
413 dissect_cms_ContentType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
414 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
415 cms_data->object_identifier_id = NULL;
416 const char *name = NULL;
418 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cms_data->object_identifier_id);
421 if(cms_data->object_identifier_id) {
422 name = oid_resolved_from_string(actx->pinfo->pool, cms_data->object_identifier_id);
423 proto_item_append_text(tree, " (%s)", name ? name : cms_data->object_identifier_id);
427 return offset;
432 static int
433 dissect_cms_T_content(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
434 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
435 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
439 return offset;
443 static const ber_sequence_t ContentInfo_sequence[] = {
444 { &hf_cms_contentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
445 { &hf_cms_content , BER_CLASS_CON, 0, 0, dissect_cms_T_content },
446 { NULL, 0, 0, 0, NULL }
450 dissect_cms_ContentInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
451 top_tree = tree;
452 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
453 ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
455 top_tree = NULL;
458 return offset;
462 static const value_string cms_CMSVersion_vals[] = {
463 { 0, "v0" },
464 { 1, "v1" },
465 { 2, "v2" },
466 { 3, "v3" },
467 { 4, "v4" },
468 { 5, "v5" },
469 { 0, NULL }
473 static int
474 dissect_cms_CMSVersion(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
475 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
476 NULL);
478 return offset;
484 dissect_cms_DigestAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
485 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
487 return offset;
491 static const ber_sequence_t DigestAlgorithmIdentifiers_set_of[1] = {
492 { &hf_cms_DigestAlgorithmIdentifiers_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
496 dissect_cms_DigestAlgorithmIdentifiers(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
497 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
498 DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers);
500 return offset;
505 static int
506 dissect_cms_T_eContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
507 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
508 cms_data->content_tvb = NULL;
509 offset = dissect_ber_octet_string(false, actx, tree, tvb, offset, hf_index, &cms_data->content_tvb);
511 if(cms_data->content_tvb) {
512 proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_reported_length(cms_data->content_tvb));
514 call_ber_oid_callback(cms_data->object_identifier_id, cms_data->content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
518 return offset;
522 static const ber_sequence_t EncapsulatedContentInfo_sequence[] = {
523 { &hf_cms_eContentType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
524 { &hf_cms_eContent , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_cms_T_eContent },
525 { NULL, 0, 0, 0, NULL }
529 dissect_cms_EncapsulatedContentInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
530 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
531 EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
533 return offset;
538 static int
539 dissect_cms_T_attrType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
540 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
541 cms_data->object_identifier_id = NULL;
542 const char *name = NULL;
544 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &cms_data->object_identifier_id);
547 if(cms_data->object_identifier_id) {
548 name = oid_resolved_from_string(actx->pinfo->pool, cms_data->object_identifier_id);
549 proto_item_append_text(tree, " (%s)", name ? name : cms_data->object_identifier_id);
553 return offset;
558 static int
559 dissect_cms_AttributeValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
560 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
562 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
565 return offset;
569 static const ber_sequence_t SET_OF_AttributeValue_set_of[1] = {
570 { &hf_cms_attrValues_item , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeValue },
573 static int
574 dissect_cms_SET_OF_AttributeValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
575 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
576 SET_OF_AttributeValue_set_of, hf_index, ett_cms_SET_OF_AttributeValue);
578 return offset;
582 static const ber_sequence_t Attribute_sequence[] = {
583 { &hf_cms_attrType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_attrType },
584 { &hf_cms_attrValues , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SET_OF_AttributeValue },
585 { NULL, 0, 0, 0, NULL }
588 static int
589 dissect_cms_Attribute(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
590 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
591 Attribute_sequence, hf_index, ett_cms_Attribute);
593 return offset;
597 static const ber_sequence_t UnauthAttributes_set_of[1] = {
598 { &hf_cms_UnauthAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
601 static int
602 dissect_cms_UnauthAttributes(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
603 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
604 1, NO_BOUND, UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes);
606 return offset;
610 static const ber_sequence_t ExtendedCertificateInfo_sequence[] = {
611 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
612 { &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
613 { &hf_cms_attributes , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_UnauthAttributes },
614 { NULL, 0, 0, 0, NULL }
617 static int
618 dissect_cms_ExtendedCertificateInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
619 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
620 ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo);
622 return offset;
627 static int
628 dissect_cms_SignatureAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
629 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
631 return offset;
636 static int
637 dissect_cms_Signature(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
638 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
639 NULL, 0, hf_index, -1,
640 NULL);
642 return offset;
646 static const ber_sequence_t ExtendedCertificate_sequence[] = {
647 { &hf_cms_extendedCertificateInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ExtendedCertificateInfo },
648 { &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
649 { &hf_cms_signature , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Signature },
650 { NULL, 0, 0, 0, NULL }
653 static int
654 dissect_cms_ExtendedCertificate(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
655 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
656 ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate);
658 return offset;
662 static const value_string cms_AttCertVersionV1_vals[] = {
663 { 0, "v1" },
664 { 0, NULL }
668 static int
669 dissect_cms_AttCertVersionV1(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
670 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
671 NULL);
673 return offset;
677 static const value_string cms_T_subject_vals[] = {
678 { 0, "baseCertificateID" },
679 { 1, "subjectName" },
680 { 0, NULL }
683 static const ber_choice_t T_subject_choice[] = {
684 { 0, &hf_cms_baseCertificateID, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_x509af_IssuerSerial },
685 { 1, &hf_cms_subjectName , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
686 { 0, NULL, 0, 0, 0, NULL }
689 static int
690 dissect_cms_T_subject(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
691 offset = dissect_ber_choice(actx, tree, tvb, offset,
692 T_subject_choice, hf_index, ett_cms_T_subject,
693 NULL);
695 return offset;
699 static const ber_sequence_t SEQUENCE_OF_Attribute_sequence_of[1] = {
700 { &hf_cms_attributes_v1_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
703 static int
704 dissect_cms_SEQUENCE_OF_Attribute(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
705 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
706 SEQUENCE_OF_Attribute_sequence_of, hf_index, ett_cms_SEQUENCE_OF_Attribute);
708 return offset;
712 static const ber_sequence_t AttributeCertificateInfoV1_sequence[] = {
713 { &hf_cms_version_v1 , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_AttCertVersionV1 },
714 { &hf_cms_subject , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_T_subject },
715 { &hf_cms_issuer_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
716 { &hf_cms_signature_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
717 { &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
718 { &hf_cms_attCertValidityPeriod, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AttCertValidityPeriod },
719 { &hf_cms_attributes_v1 , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SEQUENCE_OF_Attribute },
720 { &hf_cms_issuerUniqueID , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509sat_UniqueIdentifier },
721 { &hf_cms_extensions , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509af_Extensions },
722 { NULL, 0, 0, 0, NULL }
725 static int
726 dissect_cms_AttributeCertificateInfoV1(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
727 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
728 AttributeCertificateInfoV1_sequence, hf_index, ett_cms_AttributeCertificateInfoV1);
730 return offset;
735 static int
736 dissect_cms_BIT_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
737 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
738 NULL, 0, hf_index, -1,
739 NULL);
741 return offset;
745 static const ber_sequence_t AttributeCertificateV1_sequence[] = {
746 { &hf_cms_acInfo , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_AttributeCertificateInfoV1 },
747 { &hf_cms_signatureAlgorithm_v1, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
748 { &hf_cms_signatureValue_v1, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_BIT_STRING },
749 { NULL, 0, 0, 0, NULL }
752 static int
753 dissect_cms_AttributeCertificateV1(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
754 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
755 AttributeCertificateV1_sequence, hf_index, ett_cms_AttributeCertificateV1);
757 return offset;
762 static int
763 dissect_cms_AttributeCertificateV2(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
764 offset = dissect_x509af_AttributeCertificate(implicit_tag, tvb, offset, actx, tree, hf_index);
766 return offset;
770 static const value_string cms_CertificateChoices_vals[] = {
771 { 0, "certificate" },
772 { 1, "extendedCertificate" },
773 { 2, "v1AttrCert" },
774 { 3, "v2AttrCert" },
775 { 0, NULL }
778 static const ber_choice_t CertificateChoices_choice[] = {
779 { 0, &hf_cms_certificate , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
780 { 1, &hf_cms_extendedCertificate, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_ExtendedCertificate },
781 { 2, &hf_cms_v1AttrCert , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV1 },
782 { 3, &hf_cms_v2AttrCert , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_AttributeCertificateV2 },
783 { 0, NULL, 0, 0, 0, NULL }
786 static int
787 dissect_cms_CertificateChoices(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
788 offset = dissect_ber_choice(actx, tree, tvb, offset,
789 CertificateChoices_choice, hf_index, ett_cms_CertificateChoices,
790 NULL);
792 return offset;
796 static const ber_sequence_t CertificateSet_set_of[1] = {
797 { &hf_cms_CertificateSet_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_CertificateChoices },
800 static int
801 dissect_cms_CertificateSet(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
802 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
803 CertificateSet_set_of, hf_index, ett_cms_CertificateSet);
805 return offset;
810 static int
811 dissect_cms_T_otherRevInfoFormat(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
812 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
813 cms_data->object_identifier_id = NULL;
815 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cms_data->object_identifier_id);
817 return offset;
822 static int
823 dissect_cms_T_otherRevInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
824 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
825 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
828 return offset;
832 static const ber_sequence_t OtherRevocationInfoFormat_sequence[] = {
833 { &hf_cms_otherRevInfoFormat, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfoFormat },
834 { &hf_cms_otherRevInfo , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_T_otherRevInfo },
835 { NULL, 0, 0, 0, NULL }
838 static int
839 dissect_cms_OtherRevocationInfoFormat(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
840 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
841 OtherRevocationInfoFormat_sequence, hf_index, ett_cms_OtherRevocationInfoFormat);
843 return offset;
847 static const value_string cms_RevocationInfoChoice_vals[] = {
848 { 0, "crl" },
849 { 1, "other" },
850 { 0, NULL }
853 static const ber_choice_t RevocationInfoChoice_choice[] = {
854 { 0, &hf_cms_crl , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateList },
855 { 1, &hf_cms_otherRIC , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_OtherRevocationInfoFormat },
856 { 0, NULL, 0, 0, 0, NULL }
859 static int
860 dissect_cms_RevocationInfoChoice(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
861 offset = dissect_ber_choice(actx, tree, tvb, offset,
862 RevocationInfoChoice_choice, hf_index, ett_cms_RevocationInfoChoice,
863 NULL);
865 return offset;
869 static const ber_sequence_t RevocationInfoChoices_set_of[1] = {
870 { &hf_cms_RevocationInfoChoices_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RevocationInfoChoice },
873 static int
874 dissect_cms_RevocationInfoChoices(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
875 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
876 RevocationInfoChoices_set_of, hf_index, ett_cms_RevocationInfoChoices);
878 return offset;
882 static const ber_sequence_t IssuerAndSerialNumber_sequence[] = {
883 { &hf_cms_issuer , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509if_Name },
884 { &hf_cms_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
885 { NULL, 0, 0, 0, NULL }
889 dissect_cms_IssuerAndSerialNumber(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
890 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
891 IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber);
893 return offset;
898 static int
899 dissect_cms_SubjectKeyIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
900 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
901 NULL);
903 return offset;
907 const value_string cms_SignerIdentifier_vals[] = {
908 { 0, "issuerAndSerialNumber" },
909 { 1, "subjectKeyIdentifier" },
910 { 0, NULL }
913 static const ber_choice_t SignerIdentifier_choice[] = {
914 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
915 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
916 { 0, NULL, 0, 0, 0, NULL }
920 dissect_cms_SignerIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
921 offset = dissect_ber_choice(actx, tree, tvb, offset,
922 SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier,
923 NULL);
925 return offset;
929 static const ber_sequence_t SignedAttributes_set_of[1] = {
930 { &hf_cms_SignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
934 dissect_cms_SignedAttributes(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
935 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
936 1, NO_BOUND, SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes);
938 return offset;
944 dissect_cms_SignatureValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
945 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
946 NULL);
948 return offset;
952 static const ber_sequence_t UnsignedAttributes_set_of[1] = {
953 { &hf_cms_UnsignedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
957 dissect_cms_UnsignedAttributes(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
958 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
959 1, NO_BOUND, UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes);
961 return offset;
965 static const ber_sequence_t SignerInfo_sequence[] = {
966 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
967 { &hf_cms_sid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_SignerIdentifier },
968 { &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
969 { &hf_cms_signedAttrs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_SignedAttributes },
970 { &hf_cms_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureAlgorithmIdentifier },
971 { &hf_cms_signatureValue , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_SignatureValue },
972 { &hf_cms_unsignedAttrs , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnsignedAttributes },
973 { NULL, 0, 0, 0, NULL }
977 dissect_cms_SignerInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
978 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
979 SignerInfo_sequence, hf_index, ett_cms_SignerInfo);
981 return offset;
985 static const ber_sequence_t SignerInfos_set_of[1] = {
986 { &hf_cms_SignerInfos_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfo },
990 dissect_cms_SignerInfos(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
991 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
992 SignerInfos_set_of, hf_index, ett_cms_SignerInfos);
994 return offset;
998 static const ber_sequence_t SignedData_sequence[] = {
999 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1000 { &hf_cms_digestAlgorithms, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifiers },
1001 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
1002 { &hf_cms_certificates , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
1003 { &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
1004 { &hf_cms_signerInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_SignerInfos },
1005 { NULL, 0, 0, 0, NULL }
1009 dissect_cms_SignedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1010 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1011 SignedData_sequence, hf_index, ett_cms_SignedData);
1013 return offset;
1017 static const ber_sequence_t OriginatorInfo_sequence[] = {
1018 { &hf_cms_certs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_CertificateSet },
1019 { &hf_cms_crls , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_RevocationInfoChoices },
1020 { NULL, 0, 0, 0, NULL }
1023 static int
1024 dissect_cms_OriginatorInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1025 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1026 OriginatorInfo_sequence, hf_index, ett_cms_OriginatorInfo);
1028 return offset;
1032 static const value_string cms_RecipientIdentifier_vals[] = {
1033 { 0, "issuerAndSerialNumber" },
1034 { 1, "subjectKeyIdentifier" },
1035 { 0, NULL }
1038 static const ber_choice_t RecipientIdentifier_choice[] = {
1039 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
1040 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
1041 { 0, NULL, 0, 0, 0, NULL }
1044 static int
1045 dissect_cms_RecipientIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1046 offset = dissect_ber_choice(actx, tree, tvb, offset,
1047 RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier,
1048 NULL);
1050 return offset;
1055 static int
1056 dissect_cms_KeyEncryptionAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1057 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1059 return offset;
1064 static int
1065 dissect_cms_EncryptedKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1066 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1067 NULL);
1069 return offset;
1073 static const ber_sequence_t KeyTransRecipientInfo_sequence[] = {
1074 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1075 { &hf_cms_rid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RecipientIdentifier },
1076 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1077 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1078 { NULL, 0, 0, 0, NULL }
1081 static int
1082 dissect_cms_KeyTransRecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1083 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1084 KeyTransRecipientInfo_sequence, hf_index, ett_cms_KeyTransRecipientInfo);
1086 return offset;
1090 static const ber_sequence_t OriginatorPublicKey_sequence[] = {
1091 { &hf_cms_algorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
1092 { &hf_cms_publicKey , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_BIT_STRING },
1093 { NULL, 0, 0, 0, NULL }
1096 static int
1097 dissect_cms_OriginatorPublicKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1098 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1099 OriginatorPublicKey_sequence, hf_index, ett_cms_OriginatorPublicKey);
1101 return offset;
1105 static const value_string cms_OriginatorIdentifierOrKey_vals[] = {
1106 { 0, "issuerAndSerialNumber" },
1107 { 1, "subjectKeyIdentifier" },
1108 { 2, "originatorKey" },
1109 { 0, NULL }
1112 static const ber_choice_t OriginatorIdentifierOrKey_choice[] = {
1113 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
1114 { 1, &hf_cms_subjectKeyIdentifier, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
1115 { 2, &hf_cms_originatorKey , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_OriginatorPublicKey },
1116 { 0, NULL, 0, 0, 0, NULL }
1119 static int
1120 dissect_cms_OriginatorIdentifierOrKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1121 offset = dissect_ber_choice(actx, tree, tvb, offset,
1122 OriginatorIdentifierOrKey_choice, hf_index, ett_cms_OriginatorIdentifierOrKey,
1123 NULL);
1125 return offset;
1130 static int
1131 dissect_cms_UserKeyingMaterial(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1132 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1133 NULL);
1135 return offset;
1140 static int
1141 dissect_cms_GeneralizedTime(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1142 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
1144 return offset;
1149 static int
1150 dissect_cms_T_keyAttrId(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1151 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1152 cms_data->object_identifier_id = NULL;
1154 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_ci_contentType, &cms_data->object_identifier_id);
1156 return offset;
1161 static int
1162 dissect_cms_T_keyAttr(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1163 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1164 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1167 return offset;
1171 static const ber_sequence_t OtherKeyAttribute_sequence[] = {
1172 { &hf_cms_keyAttrId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_keyAttrId },
1173 { &hf_cms_keyAttr , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_T_keyAttr },
1174 { NULL, 0, 0, 0, NULL }
1177 static int
1178 dissect_cms_OtherKeyAttribute(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1179 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1180 OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute);
1182 return offset;
1186 static const ber_sequence_t RecipientKeyIdentifier_sequence[] = {
1187 { &hf_cms_subjectKeyIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_SubjectKeyIdentifier },
1188 { &hf_cms_date , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1189 { &hf_cms_other , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_OtherKeyAttribute },
1190 { NULL, 0, 0, 0, NULL }
1193 static int
1194 dissect_cms_RecipientKeyIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1195 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1196 RecipientKeyIdentifier_sequence, hf_index, ett_cms_RecipientKeyIdentifier);
1198 return offset;
1202 static const value_string cms_KeyAgreeRecipientIdentifier_vals[] = {
1203 { 0, "issuerAndSerialNumber" },
1204 { 1, "rKeyId" },
1205 { 0, NULL }
1208 static const ber_choice_t KeyAgreeRecipientIdentifier_choice[] = {
1209 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
1210 { 1, &hf_cms_rKeyId , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_RecipientKeyIdentifier },
1211 { 0, NULL, 0, 0, 0, NULL }
1214 static int
1215 dissect_cms_KeyAgreeRecipientIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1216 offset = dissect_ber_choice(actx, tree, tvb, offset,
1217 KeyAgreeRecipientIdentifier_choice, hf_index, ett_cms_KeyAgreeRecipientIdentifier,
1218 NULL);
1220 return offset;
1224 static const ber_sequence_t RecipientEncryptedKey_sequence[] = {
1225 { &hf_cms_rekRid , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_KeyAgreeRecipientIdentifier },
1226 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1227 { NULL, 0, 0, 0, NULL }
1230 static int
1231 dissect_cms_RecipientEncryptedKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1232 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1233 RecipientEncryptedKey_sequence, hf_index, ett_cms_RecipientEncryptedKey);
1235 return offset;
1239 static const ber_sequence_t RecipientEncryptedKeys_sequence_of[1] = {
1240 { &hf_cms_RecipientEncryptedKeys_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientEncryptedKey },
1243 static int
1244 dissect_cms_RecipientEncryptedKeys(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1245 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1246 RecipientEncryptedKeys_sequence_of, hf_index, ett_cms_RecipientEncryptedKeys);
1248 return offset;
1252 static const ber_sequence_t KeyAgreeRecipientInfo_sequence[] = {
1253 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1254 { &hf_cms_originator , BER_CLASS_CON, 0, BER_FLAGS_NOTCHKTAG, dissect_cms_OriginatorIdentifierOrKey },
1255 { &hf_cms_ukm , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_cms_UserKeyingMaterial },
1256 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1257 { &hf_cms_recipientEncryptedKeys, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientEncryptedKeys },
1258 { NULL, 0, 0, 0, NULL }
1261 static int
1262 dissect_cms_KeyAgreeRecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1263 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1264 KeyAgreeRecipientInfo_sequence, hf_index, ett_cms_KeyAgreeRecipientInfo);
1266 return offset;
1271 static int
1272 dissect_cms_OCTET_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1273 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1274 NULL);
1276 return offset;
1280 static const ber_sequence_t KEKIdentifier_sequence[] = {
1281 { &hf_cms_keyIdentifier , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1282 { &hf_cms_date , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1283 { &hf_cms_other , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_OtherKeyAttribute },
1284 { NULL, 0, 0, 0, NULL }
1287 static int
1288 dissect_cms_KEKIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1289 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1290 KEKIdentifier_sequence, hf_index, ett_cms_KEKIdentifier);
1292 return offset;
1296 static const ber_sequence_t KEKRecipientInfo_sequence[] = {
1297 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1298 { &hf_cms_kekid , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KEKIdentifier },
1299 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1300 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1301 { NULL, 0, 0, 0, NULL }
1304 static int
1305 dissect_cms_KEKRecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1306 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1307 KEKRecipientInfo_sequence, hf_index, ett_cms_KEKRecipientInfo);
1309 return offset;
1314 static int
1315 dissect_cms_KeyDerivationAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1316 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1318 return offset;
1322 static const ber_sequence_t PasswordRecipientInfo_sequence[] = {
1323 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1324 { &hf_cms_keyDerivationAlgorithm, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_KeyDerivationAlgorithmIdentifier },
1325 { &hf_cms_keyEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyEncryptionAlgorithmIdentifier },
1326 { &hf_cms_encryptedKey , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedKey },
1327 { NULL, 0, 0, 0, NULL }
1330 static int
1331 dissect_cms_PasswordRecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1332 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1333 PasswordRecipientInfo_sequence, hf_index, ett_cms_PasswordRecipientInfo);
1335 return offset;
1340 static int
1341 dissect_cms_T_oriType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1342 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1343 cms_data->object_identifier_id = NULL;
1345 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &cms_data->object_identifier_id);
1347 return offset;
1352 static int
1353 dissect_cms_T_oriValue(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1354 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1355 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1358 return offset;
1362 static const ber_sequence_t OtherRecipientInfo_sequence[] = {
1363 { &hf_cms_oriType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_oriType },
1364 { &hf_cms_oriValue , BER_CLASS_ANY, 0, BER_FLAGS_NOOWNTAG, dissect_cms_T_oriValue },
1365 { NULL, 0, 0, 0, NULL }
1368 static int
1369 dissect_cms_OtherRecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1370 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1371 OtherRecipientInfo_sequence, hf_index, ett_cms_OtherRecipientInfo);
1373 return offset;
1377 static const value_string cms_RecipientInfo_vals[] = {
1378 { 0, "ktri" },
1379 { 1, "kari" },
1380 { 2, "kekri" },
1381 { 3, "pwri" },
1382 { 4, "ori" },
1383 { 0, NULL }
1386 static const ber_choice_t RecipientInfo_choice[] = {
1387 { 0, &hf_cms_ktri , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_KeyTransRecipientInfo },
1388 { 1, &hf_cms_kari , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_KeyAgreeRecipientInfo },
1389 { 2, &hf_cms_kekri , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_KEKRecipientInfo },
1390 { 3, &hf_cms_pwri , BER_CLASS_CON, 3, BER_FLAGS_IMPLTAG, dissect_cms_PasswordRecipientInfo },
1391 { 4, &hf_cms_ori , BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_cms_OtherRecipientInfo },
1392 { 0, NULL, 0, 0, 0, NULL }
1395 static int
1396 dissect_cms_RecipientInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1397 offset = dissect_ber_choice(actx, tree, tvb, offset,
1398 RecipientInfo_choice, hf_index, ett_cms_RecipientInfo,
1399 NULL);
1401 return offset;
1405 static const ber_sequence_t RecipientInfos_set_of[1] = {
1406 { &hf_cms_RecipientInfos_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_RecipientInfo },
1409 static int
1410 dissect_cms_RecipientInfos(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1411 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1412 1, NO_BOUND, RecipientInfos_set_of, hf_index, ett_cms_RecipientInfos);
1414 return offset;
1419 static int
1420 dissect_cms_ContentEncryptionAlgorithmIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1421 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1423 return offset;
1428 static int
1429 dissect_cms_EncryptedContent(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1430 tvbuff_t *encrypted_tvb;
1431 proto_item *item;
1432 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1433 &encrypted_tvb);
1435 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1437 item = actx->created_item;
1439 PBE_decrypt_data(cms_data->object_identifier_id, encrypted_tvb, actx->pinfo, actx, item);
1441 return offset;
1445 static const ber_sequence_t EncryptedContentInfo_sequence[] = {
1446 { &hf_cms_encryptedContentType, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
1447 { &hf_cms_contentEncryptionAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_ContentEncryptionAlgorithmIdentifier },
1448 { &hf_cms_encryptedContent, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_EncryptedContent },
1449 { NULL, 0, 0, 0, NULL }
1452 static int
1453 dissect_cms_EncryptedContentInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1454 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1455 EncryptedContentInfo_sequence, hf_index, ett_cms_EncryptedContentInfo);
1457 return offset;
1461 static const ber_sequence_t UnprotectedAttributes_set_of[1] = {
1462 { &hf_cms_UnprotectedAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
1465 static int
1466 dissect_cms_UnprotectedAttributes(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1467 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1468 1, NO_BOUND, UnprotectedAttributes_set_of, hf_index, ett_cms_UnprotectedAttributes);
1470 return offset;
1474 static const ber_sequence_t EnvelopedData_sequence[] = {
1475 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1476 { &hf_cms_originatorInfo , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OriginatorInfo },
1477 { &hf_cms_recipientInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientInfos },
1478 { &hf_cms_encryptedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedContentInfo },
1479 { &hf_cms_unprotectedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnprotectedAttributes },
1480 { NULL, 0, 0, 0, NULL }
1484 dissect_cms_EnvelopedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1485 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1486 EnvelopedData_sequence, hf_index, ett_cms_EnvelopedData);
1488 return offset;
1494 dissect_cms_Digest(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1495 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1496 NULL);
1498 return offset;
1502 static const ber_sequence_t DigestedData_sequence[] = {
1503 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1504 { &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
1505 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
1506 { &hf_cms_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
1507 { NULL, 0, 0, 0, NULL }
1510 static int
1511 dissect_cms_DigestedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1512 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1513 DigestedData_sequence, hf_index, ett_cms_DigestedData);
1515 return offset;
1519 static const ber_sequence_t EncryptedData_sequence[] = {
1520 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1521 { &hf_cms_encryptedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedContentInfo },
1522 { &hf_cms_unprotectedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnprotectedAttributes },
1523 { NULL, 0, 0, 0, NULL }
1526 static int
1527 dissect_cms_EncryptedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1528 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1529 EncryptedData_sequence, hf_index, ett_cms_EncryptedData);
1531 return offset;
1536 static int
1537 dissect_cms_MessageAuthenticationCodeAlgorithm(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1538 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1540 return offset;
1544 static const ber_sequence_t AuthAttributes_set_of[1] = {
1545 { &hf_cms_AuthAttributes_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_Attribute },
1548 static int
1549 dissect_cms_AuthAttributes(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1550 offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
1551 1, NO_BOUND, AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes);
1553 return offset;
1558 static int
1559 dissect_cms_MessageAuthenticationCode(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1560 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1561 NULL);
1563 return offset;
1567 static const ber_sequence_t AuthenticatedData_sequence[] = {
1568 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1569 { &hf_cms_originatorInfo , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OriginatorInfo },
1570 { &hf_cms_recipientInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientInfos },
1571 { &hf_cms_macAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_MessageAuthenticationCodeAlgorithm },
1572 { &hf_cms_digestAlgorithm , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_DigestAlgorithmIdentifier },
1573 { &hf_cms_encapContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncapsulatedContentInfo },
1574 { &hf_cms_authAttrs , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_AuthAttributes },
1575 { &hf_cms_mac , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_MessageAuthenticationCode },
1576 { &hf_cms_unauthAttrs , BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnauthAttributes },
1577 { NULL, 0, 0, 0, NULL }
1580 static int
1581 dissect_cms_AuthenticatedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1582 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1583 AuthenticatedData_sequence, hf_index, ett_cms_AuthenticatedData);
1585 return offset;
1590 static int
1591 dissect_cms_MessageDigest(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1592 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1593 proto_item *pi;
1594 int old_offset = offset;
1596 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1597 NULL);
1600 pi = actx->created_item;
1602 /* move past TLV */
1603 old_offset = get_ber_identifier(tvb, old_offset, NULL, NULL, NULL);
1604 old_offset = get_ber_length(tvb, old_offset, NULL, NULL);
1606 if(cms_data->content_tvb)
1607 cms_verify_msg_digest(pi, cms_data->content_tvb, x509af_get_last_algorithm_id(), tvb, old_offset);
1610 return offset;
1615 static int
1616 dissect_cms_UTCTime(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1617 offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index, NULL, NULL);
1619 return offset;
1623 static const value_string cms_Time_vals[] = {
1624 { 0, "utcTime" },
1625 { 1, "generalTime" },
1626 { 0, NULL }
1629 static const ber_choice_t Time_choice[] = {
1630 { 0, &hf_cms_utcTime , BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_cms_UTCTime },
1631 { 1, &hf_cms_generalTime , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_cms_GeneralizedTime },
1632 { 0, NULL, 0, 0, 0, NULL }
1635 static int
1636 dissect_cms_Time(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1637 offset = dissect_ber_choice(actx, tree, tvb, offset,
1638 Time_choice, hf_index, ett_cms_Time,
1639 NULL);
1641 return offset;
1646 static int
1647 dissect_cms_SigningTime(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1648 offset = dissect_cms_Time(implicit_tag, tvb, offset, actx, tree, hf_index);
1650 return offset;
1656 dissect_cms_Countersignature(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1657 offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
1659 return offset;
1664 static int
1665 dissect_cms_KeyWrapAlgorithm(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1666 offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
1668 return offset;
1673 static int
1674 dissect_cms_RC2ParameterVersion(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1675 uint32_t length = 0;
1677 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1678 &length);
1681 if(cap_tree != NULL)
1682 proto_item_append_text(cap_tree, " (%d bits)", length);
1685 return offset;
1690 static int
1691 dissect_cms_RC2WrapParameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1692 offset = dissect_cms_RC2ParameterVersion(implicit_tag, tvb, offset, actx, tree, hf_index);
1694 return offset;
1699 static int
1700 dissect_cms_IV(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1701 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1702 NULL);
1704 return offset;
1709 static int
1710 dissect_cms_INTEGER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1711 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
1712 NULL);
1714 return offset;
1718 static const ber_sequence_t RC2CBCParameter_sequence[] = {
1719 { &hf_cms_rc2ParameterVersion, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER },
1720 { &hf_cms_iv , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1721 { NULL, 0, 0, 0, NULL }
1724 static int
1725 dissect_cms_RC2CBCParameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1726 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1727 RC2CBCParameter_sequence, hf_index, ett_cms_RC2CBCParameter);
1729 return offset;
1733 static const ber_sequence_t DigestInfo_sequence[] = {
1734 { &hf_cms_digestAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_DigestAlgorithmIdentifier },
1735 { &hf_cms_digest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_Digest },
1736 { NULL, 0, 0, 0, NULL }
1740 dissect_cms_DigestInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1741 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1742 DigestInfo_sequence, hf_index, ett_cms_DigestInfo);
1744 return offset;
1749 static int
1750 dissect_cms_T_capability(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1751 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1752 cms_data->object_identifier_id = NULL;
1753 const char *name = NULL;
1755 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_cms_attrType, &cms_data->object_identifier_id);
1758 if(cms_data->object_identifier_id) {
1759 name = oid_resolved_from_string(actx->pinfo->pool, cms_data->object_identifier_id);
1760 proto_item_append_text(tree, " %s", name ? name : cms_data->object_identifier_id);
1761 cap_tree = tree;
1765 return offset;
1770 static int
1771 dissect_cms_T_parameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1772 struct cms_private_data *cms_data = cms_get_private_data(actx->pinfo);
1774 offset=call_ber_oid_callback(cms_data->object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
1777 return offset;
1781 static const ber_sequence_t SMIMECapability_sequence[] = {
1782 { &hf_cms_capability , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_T_capability },
1783 { &hf_cms_parameters , BER_CLASS_ANY, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_T_parameters },
1784 { NULL, 0, 0, 0, NULL }
1787 static int
1788 dissect_cms_SMIMECapability(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1789 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1790 SMIMECapability_sequence, hf_index, ett_cms_SMIMECapability);
1792 return offset;
1796 static const ber_sequence_t SMIMECapabilities_sequence_of[1] = {
1797 { &hf_cms_SMIMECapabilities_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SMIMECapability },
1800 static int
1801 dissect_cms_SMIMECapabilities(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1802 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1803 SMIMECapabilities_sequence_of, hf_index, ett_cms_SMIMECapabilities);
1805 return offset;
1809 static const value_string cms_SMIMEEncryptionKeyPreference_vals[] = {
1810 { 0, "issuerAndSerialNumber" },
1811 { 1, "recipientKeyId" },
1812 { 2, "subjectAltKeyIdentifier" },
1813 { 0, NULL }
1816 static const ber_choice_t SMIMEEncryptionKeyPreference_choice[] = {
1817 { 0, &hf_cms_issuerAndSerialNumber, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_cms_IssuerAndSerialNumber },
1818 { 1, &hf_cms_recipientKeyId , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_cms_RecipientKeyIdentifier },
1819 { 2, &hf_cms_subjectAltKeyIdentifier, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_cms_SubjectKeyIdentifier },
1820 { 0, NULL, 0, 0, 0, NULL }
1823 static int
1824 dissect_cms_SMIMEEncryptionKeyPreference(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1825 offset = dissect_ber_choice(actx, tree, tvb, offset,
1826 SMIMEEncryptionKeyPreference_choice, hf_index, ett_cms_SMIMEEncryptionKeyPreference,
1827 NULL);
1829 return offset;
1833 static const value_string cms_RC2CBCParameters_vals[] = {
1834 { 0, "rc2WrapParameter" },
1835 { 1, "rc2CBCParameter" },
1836 { 0, NULL }
1839 static const ber_choice_t RC2CBCParameters_choice[] = {
1840 { 0, &hf_cms_rc2WrapParameter, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_RC2WrapParameter },
1841 { 1, &hf_cms_rc2CBCParameter , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_RC2CBCParameter },
1842 { 0, NULL, 0, 0, 0, NULL }
1845 static int
1846 dissect_cms_RC2CBCParameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1847 offset = dissect_ber_choice(actx, tree, tvb, offset,
1848 RC2CBCParameters_choice, hf_index, ett_cms_RC2CBCParameters,
1849 NULL);
1851 return offset;
1855 static const ber_sequence_t AuthEnvelopedData_sequence[] = {
1856 { &hf_cms_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_CMSVersion },
1857 { &hf_cms_originatorInfo , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OriginatorInfo },
1858 { &hf_cms_recipientInfos , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_cms_RecipientInfos },
1859 { &hf_cms_authEncryptedContentInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_EncryptedContentInfo },
1860 { &hf_cms_authAttrs , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_AuthAttributes },
1861 { &hf_cms_mac , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_MessageAuthenticationCode },
1862 { &hf_cms_unauthAttrs , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_UnauthAttributes },
1863 { NULL, 0, 0, 0, NULL }
1867 dissect_cms_AuthEnvelopedData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1868 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1869 AuthEnvelopedData_sequence, hf_index, ett_cms_AuthEnvelopedData);
1871 return offset;
1876 static int
1877 dissect_cms_OCTET_STRING_SIZE_7_13(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1878 offset = dissect_ber_constrained_octet_string(implicit_tag, actx, tree, tvb, offset,
1879 7, 13, hf_index, NULL);
1881 return offset;
1886 static int
1887 dissect_cms_AES_CCM_ICVlen(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1888 offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1889 4U, 16U, hf_index, NULL);
1891 return offset;
1895 static const ber_sequence_t CCMParameters_sequence[] = {
1896 { &hf_cms_aes_nonce , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING_SIZE_7_13 },
1897 { &hf_cms_aes_ICVlen , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_AES_CCM_ICVlen },
1898 { NULL, 0, 0, 0, NULL }
1901 static int
1902 dissect_cms_CCMParameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1903 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1904 CCMParameters_sequence, hf_index, ett_cms_CCMParameters);
1906 return offset;
1911 static int
1912 dissect_cms_AES_GCM_ICVlen(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1913 offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
1914 12U, 16U, hf_index, NULL);
1916 return offset;
1920 static const ber_sequence_t GCMParameters_sequence[] = {
1921 { &hf_cms_aes_nonce_01 , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1922 { &hf_cms_aes_ICVlen_01 , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_AES_GCM_ICVlen },
1923 { NULL, 0, 0, 0, NULL }
1926 static int
1927 dissect_cms_GCMParameters(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1928 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1929 GCMParameters_sequence, hf_index, ett_cms_GCMParameters);
1931 return offset;
1936 static int
1937 dissect_cms_FirmwarePkgData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1938 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
1939 NULL);
1941 return offset;
1946 static int
1947 dissect_cms_OBJECT_IDENTIFIER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1948 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
1950 return offset;
1955 static int
1956 dissect_cms_INTEGER_0_MAX(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1957 offset = dissect_ber_constrained_integer64(implicit_tag, actx, tree, tvb, offset,
1958 0U, NO_BOUND, hf_index, NULL);
1960 return offset;
1964 static const ber_sequence_t PreferredPackageIdentifier_sequence[] = {
1965 { &hf_cms_fwPkgID , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
1966 { &hf_cms_verNum , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER_0_MAX },
1967 { NULL, 0, 0, 0, NULL }
1970 static int
1971 dissect_cms_PreferredPackageIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1972 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1973 PreferredPackageIdentifier_sequence, hf_index, ett_cms_PreferredPackageIdentifier);
1975 return offset;
1979 static const value_string cms_PreferredOrLegacyPackageIdentifier_vals[] = {
1980 { 0, "preferred" },
1981 { 1, "legacy" },
1982 { 0, NULL }
1985 static const ber_choice_t PreferredOrLegacyPackageIdentifier_choice[] = {
1986 { 0, &hf_cms_preferred , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_PreferredPackageIdentifier },
1987 { 1, &hf_cms_legacy , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
1988 { 0, NULL, 0, 0, 0, NULL }
1991 static int
1992 dissect_cms_PreferredOrLegacyPackageIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1993 offset = dissect_ber_choice(actx, tree, tvb, offset,
1994 PreferredOrLegacyPackageIdentifier_choice, hf_index, ett_cms_PreferredOrLegacyPackageIdentifier,
1995 NULL);
1997 return offset;
2001 static const value_string cms_PreferredOrLegacyStalePackageIdentifier_vals[] = {
2002 { 0, "preferredStaleVerNum" },
2003 { 1, "legacyStaleVersion" },
2004 { 0, NULL }
2007 static const ber_choice_t PreferredOrLegacyStalePackageIdentifier_choice[] = {
2008 { 0, &hf_cms_preferredStaleVerNum, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER_0_MAX },
2009 { 1, &hf_cms_legacyStaleVersion, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2010 { 0, NULL, 0, 0, 0, NULL }
2013 static int
2014 dissect_cms_PreferredOrLegacyStalePackageIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2015 offset = dissect_ber_choice(actx, tree, tvb, offset,
2016 PreferredOrLegacyStalePackageIdentifier_choice, hf_index, ett_cms_PreferredOrLegacyStalePackageIdentifier,
2017 NULL);
2019 return offset;
2023 static const ber_sequence_t FirmwarePackageIdentifier_sequence[] = {
2024 { &hf_cms_name , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyPackageIdentifier },
2025 { &hf_cms_stale , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyStalePackageIdentifier },
2026 { NULL, 0, 0, 0, NULL }
2029 static int
2030 dissect_cms_FirmwarePackageIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2031 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2032 FirmwarePackageIdentifier_sequence, hf_index, ett_cms_FirmwarePackageIdentifier);
2034 return offset;
2038 static const ber_sequence_t TargetHardwareIdentifiers_sequence_of[1] = {
2039 { &hf_cms_TargetHardwareIdentifiers_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2042 static int
2043 dissect_cms_TargetHardwareIdentifiers(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2044 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2045 TargetHardwareIdentifiers_sequence_of, hf_index, ett_cms_TargetHardwareIdentifiers);
2047 return offset;
2052 static int
2053 dissect_cms_DecryptKeyIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2054 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
2055 NULL);
2057 return offset;
2061 static const ber_sequence_t ImplementedCryptoAlgorithms_sequence_of[1] = {
2062 { &hf_cms_ImplementedCryptoAlgorithms_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2065 static int
2066 dissect_cms_ImplementedCryptoAlgorithms(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2067 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2068 ImplementedCryptoAlgorithms_sequence_of, hf_index, ett_cms_ImplementedCryptoAlgorithms);
2070 return offset;
2074 static const ber_sequence_t ImplementedCompressAlgorithms_sequence_of[1] = {
2075 { &hf_cms_ImplementedCompressAlgorithms_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2078 static int
2079 dissect_cms_ImplementedCompressAlgorithms(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2080 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2081 ImplementedCompressAlgorithms_sequence_of, hf_index, ett_cms_ImplementedCompressAlgorithms);
2083 return offset;
2088 static int
2089 dissect_cms_NULL(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2090 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
2092 return offset;
2096 static const ber_sequence_t T_block_sequence[] = {
2097 { &hf_cms_low , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2098 { &hf_cms_high , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2099 { NULL, 0, 0, 0, NULL }
2102 static int
2103 dissect_cms_T_block(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2104 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2105 T_block_sequence, hf_index, ett_cms_T_block);
2107 return offset;
2111 static const value_string cms_HardwareSerialEntry_vals[] = {
2112 { 0, "all" },
2113 { 1, "single" },
2114 { 2, "block" },
2115 { 0, NULL }
2118 static const ber_choice_t HardwareSerialEntry_choice[] = {
2119 { 0, &hf_cms_all , BER_CLASS_UNI, BER_UNI_TAG_NULL, BER_FLAGS_NOOWNTAG, dissect_cms_NULL },
2120 { 1, &hf_cms_single , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2121 { 2, &hf_cms_block , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_T_block },
2122 { 0, NULL, 0, 0, 0, NULL }
2125 static int
2126 dissect_cms_HardwareSerialEntry(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2127 offset = dissect_ber_choice(actx, tree, tvb, offset,
2128 HardwareSerialEntry_choice, hf_index, ett_cms_HardwareSerialEntry,
2129 NULL);
2131 return offset;
2135 static const ber_sequence_t SEQUENCE_OF_HardwareSerialEntry_sequence_of[1] = {
2136 { &hf_cms_hwSerialEntries_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_HardwareSerialEntry },
2139 static int
2140 dissect_cms_SEQUENCE_OF_HardwareSerialEntry(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2141 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2142 SEQUENCE_OF_HardwareSerialEntry_sequence_of, hf_index, ett_cms_SEQUENCE_OF_HardwareSerialEntry);
2144 return offset;
2148 static const ber_sequence_t HardwareModules_sequence[] = {
2149 { &hf_cms_hwType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2150 { &hf_cms_hwSerialEntries , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_SEQUENCE_OF_HardwareSerialEntry },
2151 { NULL, 0, 0, 0, NULL }
2154 static int
2155 dissect_cms_HardwareModules(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2156 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2157 HardwareModules_sequence, hf_index, ett_cms_HardwareModules);
2159 return offset;
2163 static const value_string cms_CommunityIdentifier_vals[] = {
2164 { 0, "communityOID" },
2165 { 1, "hwModuleList" },
2166 { 0, NULL }
2169 static const ber_choice_t CommunityIdentifier_choice[] = {
2170 { 0, &hf_cms_communityOID , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2171 { 1, &hf_cms_hwModuleList , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_HardwareModules },
2172 { 0, NULL, 0, 0, 0, NULL }
2175 static int
2176 dissect_cms_CommunityIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2177 offset = dissect_ber_choice(actx, tree, tvb, offset,
2178 CommunityIdentifier_choice, hf_index, ett_cms_CommunityIdentifier,
2179 NULL);
2181 return offset;
2185 static const ber_sequence_t CommunityIdentifiers_sequence_of[1] = {
2186 { &hf_cms_CommunityIdentifiers_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_CommunityIdentifier },
2189 static int
2190 dissect_cms_CommunityIdentifiers(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2191 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2192 CommunityIdentifiers_sequence_of, hf_index, ett_cms_CommunityIdentifiers);
2194 return offset;
2198 static const ber_sequence_t SEQUENCE_OF_PreferredOrLegacyPackageIdentifier_sequence_of[1] = {
2199 { &hf_cms_dependencies_item, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyPackageIdentifier },
2202 static int
2203 dissect_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2204 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2205 SEQUENCE_OF_PreferredOrLegacyPackageIdentifier_sequence_of, hf_index, ett_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier);
2207 return offset;
2211 static const ber_sequence_t FirmwarePackageInfo_sequence[] = {
2212 { &hf_cms_fwPkgType , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER },
2213 { &hf_cms_dependencies , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier },
2214 { NULL, 0, 0, 0, NULL }
2217 static int
2218 dissect_cms_FirmwarePackageInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2219 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2220 FirmwarePackageInfo_sequence, hf_index, ett_cms_FirmwarePackageInfo);
2222 return offset;
2227 static int
2228 dissect_cms_WrappedFirmwareKey(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2229 offset = dissect_cms_EnvelopedData(implicit_tag, tvb, offset, actx, tree, hf_index);
2231 return offset;
2235 static const value_string cms_FWReceiptVersion_vals[] = {
2236 { 1, "v1" },
2237 { 0, NULL }
2241 static int
2242 dissect_cms_FWReceiptVersion(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2243 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2244 NULL);
2246 return offset;
2250 static const ber_sequence_t FirmwarePackageLoadReceipt_sequence[] = {
2251 { &hf_cms_fwReceiptVersion, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_FWReceiptVersion },
2252 { &hf_cms_hwType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2253 { &hf_cms_hwSerialNum , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2254 { &hf_cms_fwPkgName , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyPackageIdentifier },
2255 { &hf_cms_trustAnchorKeyID, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2256 { &hf_cms_decryptKeyID , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_OCTET_STRING },
2257 { NULL, 0, 0, 0, NULL }
2260 static int
2261 dissect_cms_FirmwarePackageLoadReceipt(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2262 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2263 FirmwarePackageLoadReceipt_sequence, hf_index, ett_cms_FirmwarePackageLoadReceipt);
2265 return offset;
2269 static const value_string cms_FWErrorVersion_vals[] = {
2270 { 1, "v1" },
2271 { 0, NULL }
2275 static int
2276 dissect_cms_FWErrorVersion(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2277 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2278 NULL);
2280 return offset;
2284 static const value_string cms_FirmwarePackageLoadErrorCode_vals[] = {
2285 { 1, "decodeFailure" },
2286 { 2, "badContentInfo" },
2287 { 3, "badSignedData" },
2288 { 4, "badEncapContent" },
2289 { 5, "badCertificate" },
2290 { 6, "badSignerInfo" },
2291 { 7, "badSignedAttrs" },
2292 { 8, "badUnsignedAttrs" },
2293 { 9, "missingContent" },
2294 { 10, "noTrustAnchor" },
2295 { 11, "notAuthorized" },
2296 { 12, "badDigestAlgorithm" },
2297 { 13, "badSignatureAlgorithm" },
2298 { 14, "unsupportedKeySize" },
2299 { 15, "signatureFailure" },
2300 { 16, "contentTypeMismatch" },
2301 { 17, "badEncryptedData" },
2302 { 18, "unprotectedAttrsPresent" },
2303 { 19, "badEncryptContent" },
2304 { 20, "badEncryptAlgorithm" },
2305 { 21, "missingCiphertext" },
2306 { 22, "noDecryptKey" },
2307 { 23, "decryptFailure" },
2308 { 24, "badCompressAlgorithm" },
2309 { 25, "missingCompressedContent" },
2310 { 26, "decompressFailure" },
2311 { 27, "wrongHardware" },
2312 { 28, "stalePackage" },
2313 { 29, "notInCommunity" },
2314 { 30, "unsupportedPackageType" },
2315 { 31, "missingDependency" },
2316 { 32, "wrongDependencyVersion" },
2317 { 33, "insufficientMemory" },
2318 { 34, "badFirmware" },
2319 { 35, "unsupportedParameters" },
2320 { 36, "breaksDependency" },
2321 { 99, "otherError" },
2322 { 0, NULL }
2326 static int
2327 dissect_cms_FirmwarePackageLoadErrorCode(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2328 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2329 NULL);
2331 return offset;
2336 static int
2337 dissect_cms_VendorLoadErrorCode(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2338 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
2339 NULL);
2341 return offset;
2345 static const ber_sequence_t CurrentFWConfig_sequence[] = {
2346 { &hf_cms_fwPkgType , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_INTEGER },
2347 { &hf_cms_fwPkgName , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyPackageIdentifier },
2348 { NULL, 0, 0, 0, NULL }
2351 static int
2352 dissect_cms_CurrentFWConfig(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2353 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2354 CurrentFWConfig_sequence, hf_index, ett_cms_CurrentFWConfig);
2356 return offset;
2360 static const ber_sequence_t SEQUENCE_OF_CurrentFWConfig_sequence_of[1] = {
2361 { &hf_cms_config_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_CurrentFWConfig },
2364 static int
2365 dissect_cms_SEQUENCE_OF_CurrentFWConfig(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2366 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
2367 SEQUENCE_OF_CurrentFWConfig_sequence_of, hf_index, ett_cms_SEQUENCE_OF_CurrentFWConfig);
2369 return offset;
2373 static const ber_sequence_t FirmwarePackageLoadError_sequence[] = {
2374 { &hf_cms_fwErrorVersion , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_FWErrorVersion },
2375 { &hf_cms_hwType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2376 { &hf_cms_hwSerialNum , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2377 { &hf_cms_errorCode , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_cms_FirmwarePackageLoadErrorCode },
2378 { &hf_cms_vendorErrorCode , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_cms_VendorLoadErrorCode },
2379 { &hf_cms_fwPkgName , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_cms_PreferredOrLegacyPackageIdentifier },
2380 { &hf_cms_config , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_cms_SEQUENCE_OF_CurrentFWConfig },
2381 { NULL, 0, 0, 0, NULL }
2384 static int
2385 dissect_cms_FirmwarePackageLoadError(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2386 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2387 FirmwarePackageLoadError_sequence, hf_index, ett_cms_FirmwarePackageLoadError);
2389 return offset;
2393 static const ber_sequence_t HardwareModuleName_sequence[] = {
2394 { &hf_cms_hwType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_OBJECT_IDENTIFIER },
2395 { &hf_cms_hwSerialNum , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2396 { NULL, 0, 0, 0, NULL }
2399 static int
2400 dissect_cms_HardwareModuleName(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2401 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2402 HardwareModuleName_sequence, hf_index, ett_cms_HardwareModuleName);
2404 return offset;
2408 static const ber_sequence_t FirmwarePackageMessageDigest_sequence[] = {
2409 { &hf_cms_algorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
2410 { &hf_cms_msgDigest , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_cms_OCTET_STRING },
2411 { NULL, 0, 0, 0, NULL }
2414 static int
2415 dissect_cms_FirmwarePackageMessageDigest(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
2416 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
2417 FirmwarePackageMessageDigest_sequence, hf_index, ett_cms_FirmwarePackageMessageDigest);
2419 return offset;
2422 /*--- PDUs ---*/
2424 static int dissect_ContentInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2425 int offset = 0;
2426 asn1_ctx_t asn1_ctx;
2427 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2428 offset = dissect_cms_ContentInfo(false, tvb, offset, &asn1_ctx, tree, hf_cms_ContentInfo_PDU);
2429 return offset;
2431 static int dissect_ContentType_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2432 int offset = 0;
2433 asn1_ctx_t asn1_ctx;
2434 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2435 offset = dissect_cms_ContentType(false, tvb, offset, &asn1_ctx, tree, hf_cms_ContentType_PDU);
2436 return offset;
2438 static int dissect_SignedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2439 int offset = 0;
2440 asn1_ctx_t asn1_ctx;
2441 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2442 offset = dissect_cms_SignedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_SignedData_PDU);
2443 return offset;
2445 static int dissect_EnvelopedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2446 int offset = 0;
2447 asn1_ctx_t asn1_ctx;
2448 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2449 offset = dissect_cms_EnvelopedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_EnvelopedData_PDU);
2450 return offset;
2452 static int dissect_EncryptedContentInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2453 int offset = 0;
2454 asn1_ctx_t asn1_ctx;
2455 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2456 offset = dissect_cms_EncryptedContentInfo(false, tvb, offset, &asn1_ctx, tree, hf_cms_EncryptedContentInfo_PDU);
2457 return offset;
2459 static int dissect_DigestedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2460 int offset = 0;
2461 asn1_ctx_t asn1_ctx;
2462 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2463 offset = dissect_cms_DigestedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_DigestedData_PDU);
2464 return offset;
2466 static int dissect_EncryptedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2467 int offset = 0;
2468 asn1_ctx_t asn1_ctx;
2469 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2470 offset = dissect_cms_EncryptedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_EncryptedData_PDU);
2471 return offset;
2473 static int dissect_AuthenticatedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2474 int offset = 0;
2475 asn1_ctx_t asn1_ctx;
2476 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2477 offset = dissect_cms_AuthenticatedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_AuthenticatedData_PDU);
2478 return offset;
2480 static int dissect_KeyEncryptionAlgorithmIdentifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2481 int offset = 0;
2482 asn1_ctx_t asn1_ctx;
2483 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2484 offset = dissect_cms_KeyEncryptionAlgorithmIdentifier(false, tvb, offset, &asn1_ctx, tree, hf_cms_KeyEncryptionAlgorithmIdentifier_PDU);
2485 return offset;
2487 static int dissect_IssuerAndSerialNumber_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2488 int offset = 0;
2489 asn1_ctx_t asn1_ctx;
2490 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2491 offset = dissect_cms_IssuerAndSerialNumber(false, tvb, offset, &asn1_ctx, tree, hf_cms_IssuerAndSerialNumber_PDU);
2492 return offset;
2494 static int dissect_MessageDigest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2495 int offset = 0;
2496 asn1_ctx_t asn1_ctx;
2497 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2498 offset = dissect_cms_MessageDigest(false, tvb, offset, &asn1_ctx, tree, hf_cms_MessageDigest_PDU);
2499 return offset;
2501 static int dissect_SigningTime_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2502 int offset = 0;
2503 asn1_ctx_t asn1_ctx;
2504 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2505 offset = dissect_cms_SigningTime(false, tvb, offset, &asn1_ctx, tree, hf_cms_SigningTime_PDU);
2506 return offset;
2508 static int dissect_Countersignature_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2509 int offset = 0;
2510 asn1_ctx_t asn1_ctx;
2511 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2512 offset = dissect_cms_Countersignature(false, tvb, offset, &asn1_ctx, tree, hf_cms_Countersignature_PDU);
2513 return offset;
2515 static int dissect_KeyWrapAlgorithm_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2516 int offset = 0;
2517 asn1_ctx_t asn1_ctx;
2518 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2519 offset = dissect_cms_KeyWrapAlgorithm(false, tvb, offset, &asn1_ctx, tree, hf_cms_KeyWrapAlgorithm_PDU);
2520 return offset;
2522 static int dissect_RC2WrapParameter_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2523 int offset = 0;
2524 asn1_ctx_t asn1_ctx;
2525 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2526 offset = dissect_cms_RC2WrapParameter(false, tvb, offset, &asn1_ctx, tree, hf_cms_RC2WrapParameter_PDU);
2527 return offset;
2529 static int dissect_IV_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2530 int offset = 0;
2531 asn1_ctx_t asn1_ctx;
2532 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2533 offset = dissect_cms_IV(false, tvb, offset, &asn1_ctx, tree, hf_cms_IV_PDU);
2534 return offset;
2536 static int dissect_SMIMECapabilities_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2537 int offset = 0;
2538 asn1_ctx_t asn1_ctx;
2539 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2540 offset = dissect_cms_SMIMECapabilities(false, tvb, offset, &asn1_ctx, tree, hf_cms_SMIMECapabilities_PDU);
2541 return offset;
2543 static int dissect_SMIMEEncryptionKeyPreference_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2544 int offset = 0;
2545 asn1_ctx_t asn1_ctx;
2546 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2547 offset = dissect_cms_SMIMEEncryptionKeyPreference(false, tvb, offset, &asn1_ctx, tree, hf_cms_SMIMEEncryptionKeyPreference_PDU);
2548 return offset;
2550 static int dissect_RC2CBCParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2551 int offset = 0;
2552 asn1_ctx_t asn1_ctx;
2553 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2554 offset = dissect_cms_RC2CBCParameters(false, tvb, offset, &asn1_ctx, tree, hf_cms_RC2CBCParameters_PDU);
2555 return offset;
2557 static int dissect_AuthEnvelopedData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2558 int offset = 0;
2559 asn1_ctx_t asn1_ctx;
2560 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2561 offset = dissect_cms_AuthEnvelopedData(false, tvb, offset, &asn1_ctx, tree, hf_cms_AuthEnvelopedData_PDU);
2562 return offset;
2564 static int dissect_CCMParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2565 int offset = 0;
2566 asn1_ctx_t asn1_ctx;
2567 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2568 offset = dissect_cms_CCMParameters(false, tvb, offset, &asn1_ctx, tree, hf_cms_CCMParameters_PDU);
2569 return offset;
2571 static int dissect_GCMParameters_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2572 int offset = 0;
2573 asn1_ctx_t asn1_ctx;
2574 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2575 offset = dissect_cms_GCMParameters(false, tvb, offset, &asn1_ctx, tree, hf_cms_GCMParameters_PDU);
2576 return offset;
2578 static int dissect_FirmwarePkgData_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2579 int offset = 0;
2580 asn1_ctx_t asn1_ctx;
2581 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2582 offset = dissect_cms_FirmwarePkgData(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePkgData_PDU);
2583 return offset;
2585 static int dissect_FirmwarePackageIdentifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2586 int offset = 0;
2587 asn1_ctx_t asn1_ctx;
2588 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2589 offset = dissect_cms_FirmwarePackageIdentifier(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePackageIdentifier_PDU);
2590 return offset;
2592 static int dissect_TargetHardwareIdentifiers_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2593 int offset = 0;
2594 asn1_ctx_t asn1_ctx;
2595 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2596 offset = dissect_cms_TargetHardwareIdentifiers(false, tvb, offset, &asn1_ctx, tree, hf_cms_TargetHardwareIdentifiers_PDU);
2597 return offset;
2599 static int dissect_DecryptKeyIdentifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2600 int offset = 0;
2601 asn1_ctx_t asn1_ctx;
2602 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2603 offset = dissect_cms_DecryptKeyIdentifier(false, tvb, offset, &asn1_ctx, tree, hf_cms_DecryptKeyIdentifier_PDU);
2604 return offset;
2606 static int dissect_ImplementedCryptoAlgorithms_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2607 int offset = 0;
2608 asn1_ctx_t asn1_ctx;
2609 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2610 offset = dissect_cms_ImplementedCryptoAlgorithms(false, tvb, offset, &asn1_ctx, tree, hf_cms_ImplementedCryptoAlgorithms_PDU);
2611 return offset;
2613 static int dissect_ImplementedCompressAlgorithms_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2614 int offset = 0;
2615 asn1_ctx_t asn1_ctx;
2616 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2617 offset = dissect_cms_ImplementedCompressAlgorithms(false, tvb, offset, &asn1_ctx, tree, hf_cms_ImplementedCompressAlgorithms_PDU);
2618 return offset;
2620 static int dissect_CommunityIdentifiers_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2621 int offset = 0;
2622 asn1_ctx_t asn1_ctx;
2623 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2624 offset = dissect_cms_CommunityIdentifiers(false, tvb, offset, &asn1_ctx, tree, hf_cms_CommunityIdentifiers_PDU);
2625 return offset;
2627 static int dissect_FirmwarePackageInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2628 int offset = 0;
2629 asn1_ctx_t asn1_ctx;
2630 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2631 offset = dissect_cms_FirmwarePackageInfo(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePackageInfo_PDU);
2632 return offset;
2634 static int dissect_WrappedFirmwareKey_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2635 int offset = 0;
2636 asn1_ctx_t asn1_ctx;
2637 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2638 offset = dissect_cms_WrappedFirmwareKey(false, tvb, offset, &asn1_ctx, tree, hf_cms_WrappedFirmwareKey_PDU);
2639 return offset;
2641 static int dissect_FirmwarePackageLoadReceipt_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2642 int offset = 0;
2643 asn1_ctx_t asn1_ctx;
2644 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2645 offset = dissect_cms_FirmwarePackageLoadReceipt(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePackageLoadReceipt_PDU);
2646 return offset;
2648 static int dissect_FirmwarePackageLoadError_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2649 int offset = 0;
2650 asn1_ctx_t asn1_ctx;
2651 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2652 offset = dissect_cms_FirmwarePackageLoadError(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePackageLoadError_PDU);
2653 return offset;
2655 static int dissect_HardwareModuleName_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2656 int offset = 0;
2657 asn1_ctx_t asn1_ctx;
2658 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2659 offset = dissect_cms_HardwareModuleName(false, tvb, offset, &asn1_ctx, tree, hf_cms_HardwareModuleName_PDU);
2660 return offset;
2662 static int dissect_FirmwarePackageMessageDigest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
2663 int offset = 0;
2664 asn1_ctx_t asn1_ctx;
2665 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
2666 offset = dissect_cms_FirmwarePackageMessageDigest(false, tvb, offset, &asn1_ctx, tree, hf_cms_FirmwarePackageMessageDigest_PDU);
2667 return offset;
2671 /*--- proto_register_cms ----------------------------------------------*/
2672 void proto_register_cms(void) {
2674 /* List of fields */
2675 static hf_register_info hf[] = {
2676 { &hf_cms_ci_contentType,
2677 { "contentType", "cms.contentInfo.contentType",
2678 FT_OID, BASE_NONE, NULL, 0,
2679 NULL, HFILL }},
2680 { &hf_cms_ContentInfo_PDU,
2681 { "ContentInfo", "cms.ContentInfo_element",
2682 FT_NONE, BASE_NONE, NULL, 0,
2683 NULL, HFILL }},
2684 { &hf_cms_ContentType_PDU,
2685 { "ContentType", "cms.ContentType",
2686 FT_OID, BASE_NONE, NULL, 0,
2687 NULL, HFILL }},
2688 { &hf_cms_SignedData_PDU,
2689 { "SignedData", "cms.SignedData_element",
2690 FT_NONE, BASE_NONE, NULL, 0,
2691 NULL, HFILL }},
2692 { &hf_cms_EnvelopedData_PDU,
2693 { "EnvelopedData", "cms.EnvelopedData_element",
2694 FT_NONE, BASE_NONE, NULL, 0,
2695 NULL, HFILL }},
2696 { &hf_cms_EncryptedContentInfo_PDU,
2697 { "EncryptedContentInfo", "cms.EncryptedContentInfo_element",
2698 FT_NONE, BASE_NONE, NULL, 0,
2699 NULL, HFILL }},
2700 { &hf_cms_DigestedData_PDU,
2701 { "DigestedData", "cms.DigestedData_element",
2702 FT_NONE, BASE_NONE, NULL, 0,
2703 NULL, HFILL }},
2704 { &hf_cms_EncryptedData_PDU,
2705 { "EncryptedData", "cms.EncryptedData_element",
2706 FT_NONE, BASE_NONE, NULL, 0,
2707 NULL, HFILL }},
2708 { &hf_cms_AuthenticatedData_PDU,
2709 { "AuthenticatedData", "cms.AuthenticatedData_element",
2710 FT_NONE, BASE_NONE, NULL, 0,
2711 NULL, HFILL }},
2712 { &hf_cms_KeyEncryptionAlgorithmIdentifier_PDU,
2713 { "KeyEncryptionAlgorithmIdentifier", "cms.KeyEncryptionAlgorithmIdentifier_element",
2714 FT_NONE, BASE_NONE, NULL, 0,
2715 NULL, HFILL }},
2716 { &hf_cms_IssuerAndSerialNumber_PDU,
2717 { "IssuerAndSerialNumber", "cms.IssuerAndSerialNumber_element",
2718 FT_NONE, BASE_NONE, NULL, 0,
2719 NULL, HFILL }},
2720 { &hf_cms_MessageDigest_PDU,
2721 { "MessageDigest", "cms.MessageDigest",
2722 FT_BYTES, BASE_NONE, NULL, 0,
2723 NULL, HFILL }},
2724 { &hf_cms_SigningTime_PDU,
2725 { "SigningTime", "cms.SigningTime",
2726 FT_UINT32, BASE_DEC, VALS(cms_Time_vals), 0,
2727 NULL, HFILL }},
2728 { &hf_cms_Countersignature_PDU,
2729 { "Countersignature", "cms.Countersignature_element",
2730 FT_NONE, BASE_NONE, NULL, 0,
2731 NULL, HFILL }},
2732 { &hf_cms_KeyWrapAlgorithm_PDU,
2733 { "KeyWrapAlgorithm", "cms.KeyWrapAlgorithm_element",
2734 FT_NONE, BASE_NONE, NULL, 0,
2735 NULL, HFILL }},
2736 { &hf_cms_RC2WrapParameter_PDU,
2737 { "RC2WrapParameter", "cms.RC2WrapParameter",
2738 FT_INT32, BASE_DEC, NULL, 0,
2739 NULL, HFILL }},
2740 { &hf_cms_IV_PDU,
2741 { "IV", "cms.IV",
2742 FT_BYTES, BASE_NONE, NULL, 0,
2743 NULL, HFILL }},
2744 { &hf_cms_SMIMECapabilities_PDU,
2745 { "SMIMECapabilities", "cms.SMIMECapabilities",
2746 FT_UINT32, BASE_DEC, NULL, 0,
2747 NULL, HFILL }},
2748 { &hf_cms_SMIMEEncryptionKeyPreference_PDU,
2749 { "SMIMEEncryptionKeyPreference", "cms.SMIMEEncryptionKeyPreference",
2750 FT_UINT32, BASE_DEC, VALS(cms_SMIMEEncryptionKeyPreference_vals), 0,
2751 NULL, HFILL }},
2752 { &hf_cms_RC2CBCParameters_PDU,
2753 { "RC2CBCParameters", "cms.RC2CBCParameters",
2754 FT_UINT32, BASE_DEC, VALS(cms_RC2CBCParameters_vals), 0,
2755 NULL, HFILL }},
2756 { &hf_cms_AuthEnvelopedData_PDU,
2757 { "AuthEnvelopedData", "cms.AuthEnvelopedData_element",
2758 FT_NONE, BASE_NONE, NULL, 0,
2759 NULL, HFILL }},
2760 { &hf_cms_CCMParameters_PDU,
2761 { "CCMParameters", "cms.CCMParameters_element",
2762 FT_NONE, BASE_NONE, NULL, 0,
2763 NULL, HFILL }},
2764 { &hf_cms_GCMParameters_PDU,
2765 { "GCMParameters", "cms.GCMParameters_element",
2766 FT_NONE, BASE_NONE, NULL, 0,
2767 NULL, HFILL }},
2768 { &hf_cms_FirmwarePkgData_PDU,
2769 { "FirmwarePkgData", "cms.FirmwarePkgData",
2770 FT_BYTES, BASE_NONE, NULL, 0,
2771 NULL, HFILL }},
2772 { &hf_cms_FirmwarePackageIdentifier_PDU,
2773 { "FirmwarePackageIdentifier", "cms.FirmwarePackageIdentifier_element",
2774 FT_NONE, BASE_NONE, NULL, 0,
2775 NULL, HFILL }},
2776 { &hf_cms_TargetHardwareIdentifiers_PDU,
2777 { "TargetHardwareIdentifiers", "cms.TargetHardwareIdentifiers",
2778 FT_UINT32, BASE_DEC, NULL, 0,
2779 NULL, HFILL }},
2780 { &hf_cms_DecryptKeyIdentifier_PDU,
2781 { "DecryptKeyIdentifier", "cms.DecryptKeyIdentifier",
2782 FT_BYTES, BASE_NONE, NULL, 0,
2783 NULL, HFILL }},
2784 { &hf_cms_ImplementedCryptoAlgorithms_PDU,
2785 { "ImplementedCryptoAlgorithms", "cms.ImplementedCryptoAlgorithms",
2786 FT_UINT32, BASE_DEC, NULL, 0,
2787 NULL, HFILL }},
2788 { &hf_cms_ImplementedCompressAlgorithms_PDU,
2789 { "ImplementedCompressAlgorithms", "cms.ImplementedCompressAlgorithms",
2790 FT_UINT32, BASE_DEC, NULL, 0,
2791 NULL, HFILL }},
2792 { &hf_cms_CommunityIdentifiers_PDU,
2793 { "CommunityIdentifiers", "cms.CommunityIdentifiers",
2794 FT_UINT32, BASE_DEC, NULL, 0,
2795 NULL, HFILL }},
2796 { &hf_cms_FirmwarePackageInfo_PDU,
2797 { "FirmwarePackageInfo", "cms.FirmwarePackageInfo_element",
2798 FT_NONE, BASE_NONE, NULL, 0,
2799 NULL, HFILL }},
2800 { &hf_cms_WrappedFirmwareKey_PDU,
2801 { "WrappedFirmwareKey", "cms.WrappedFirmwareKey_element",
2802 FT_NONE, BASE_NONE, NULL, 0,
2803 NULL, HFILL }},
2804 { &hf_cms_FirmwarePackageLoadReceipt_PDU,
2805 { "FirmwarePackageLoadReceipt", "cms.FirmwarePackageLoadReceipt_element",
2806 FT_NONE, BASE_NONE, NULL, 0,
2807 NULL, HFILL }},
2808 { &hf_cms_FirmwarePackageLoadError_PDU,
2809 { "FirmwarePackageLoadError", "cms.FirmwarePackageLoadError_element",
2810 FT_NONE, BASE_NONE, NULL, 0,
2811 NULL, HFILL }},
2812 { &hf_cms_HardwareModuleName_PDU,
2813 { "HardwareModuleName", "cms.HardwareModuleName_element",
2814 FT_NONE, BASE_NONE, NULL, 0,
2815 NULL, HFILL }},
2816 { &hf_cms_FirmwarePackageMessageDigest_PDU,
2817 { "FirmwarePackageMessageDigest", "cms.FirmwarePackageMessageDigest_element",
2818 FT_NONE, BASE_NONE, NULL, 0,
2819 NULL, HFILL }},
2820 { &hf_cms_contentType,
2821 { "contentType", "cms.contentType",
2822 FT_OID, BASE_NONE, NULL, 0,
2823 NULL, HFILL }},
2824 { &hf_cms_content,
2825 { "content", "cms.content_element",
2826 FT_NONE, BASE_NONE, NULL, 0,
2827 NULL, HFILL }},
2828 { &hf_cms_version,
2829 { "version", "cms.version",
2830 FT_INT32, BASE_DEC, VALS(cms_CMSVersion_vals), 0,
2831 "CMSVersion", HFILL }},
2832 { &hf_cms_digestAlgorithms,
2833 { "digestAlgorithms", "cms.digestAlgorithms",
2834 FT_UINT32, BASE_DEC, NULL, 0,
2835 "DigestAlgorithmIdentifiers", HFILL }},
2836 { &hf_cms_encapContentInfo,
2837 { "encapContentInfo", "cms.encapContentInfo_element",
2838 FT_NONE, BASE_NONE, NULL, 0,
2839 "EncapsulatedContentInfo", HFILL }},
2840 { &hf_cms_certificates,
2841 { "certificates", "cms.certificates",
2842 FT_UINT32, BASE_DEC, NULL, 0,
2843 "CertificateSet", HFILL }},
2844 { &hf_cms_crls,
2845 { "crls", "cms.crls",
2846 FT_UINT32, BASE_DEC, NULL, 0,
2847 "RevocationInfoChoices", HFILL }},
2848 { &hf_cms_signerInfos,
2849 { "signerInfos", "cms.signerInfos",
2850 FT_UINT32, BASE_DEC, NULL, 0,
2851 NULL, HFILL }},
2852 { &hf_cms_DigestAlgorithmIdentifiers_item,
2853 { "DigestAlgorithmIdentifier", "cms.DigestAlgorithmIdentifier_element",
2854 FT_NONE, BASE_NONE, NULL, 0,
2855 NULL, HFILL }},
2856 { &hf_cms_SignerInfos_item,
2857 { "SignerInfo", "cms.SignerInfo_element",
2858 FT_NONE, BASE_NONE, NULL, 0,
2859 NULL, HFILL }},
2860 { &hf_cms_eContentType,
2861 { "eContentType", "cms.eContentType",
2862 FT_OID, BASE_NONE, NULL, 0,
2863 "ContentType", HFILL }},
2864 { &hf_cms_eContent,
2865 { "eContent", "cms.eContent",
2866 FT_BYTES, BASE_NONE, NULL, 0,
2867 NULL, HFILL }},
2868 { &hf_cms_sid,
2869 { "sid", "cms.sid",
2870 FT_UINT32, BASE_DEC, VALS(cms_SignerIdentifier_vals), 0,
2871 "SignerIdentifier", HFILL }},
2872 { &hf_cms_digestAlgorithm,
2873 { "digestAlgorithm", "cms.digestAlgorithm_element",
2874 FT_NONE, BASE_NONE, NULL, 0,
2875 "DigestAlgorithmIdentifier", HFILL }},
2876 { &hf_cms_signedAttrs,
2877 { "signedAttrs", "cms.signedAttrs",
2878 FT_UINT32, BASE_DEC, NULL, 0,
2879 "SignedAttributes", HFILL }},
2880 { &hf_cms_signatureAlgorithm,
2881 { "signatureAlgorithm", "cms.signatureAlgorithm_element",
2882 FT_NONE, BASE_NONE, NULL, 0,
2883 "SignatureAlgorithmIdentifier", HFILL }},
2884 { &hf_cms_signatureValue,
2885 { "signature", "cms.signatureValue",
2886 FT_BYTES, BASE_NONE, NULL, 0,
2887 "SignatureValue", HFILL }},
2888 { &hf_cms_unsignedAttrs,
2889 { "unsignedAttrs", "cms.unsignedAttrs",
2890 FT_UINT32, BASE_DEC, NULL, 0,
2891 "UnsignedAttributes", HFILL }},
2892 { &hf_cms_issuerAndSerialNumber,
2893 { "issuerAndSerialNumber", "cms.issuerAndSerialNumber_element",
2894 FT_NONE, BASE_NONE, NULL, 0,
2895 NULL, HFILL }},
2896 { &hf_cms_subjectKeyIdentifier,
2897 { "subjectKeyIdentifier", "cms.subjectKeyIdentifier",
2898 FT_BYTES, BASE_NONE, NULL, 0,
2899 NULL, HFILL }},
2900 { &hf_cms_SignedAttributes_item,
2901 { "Attribute", "cms.Attribute_element",
2902 FT_NONE, BASE_NONE, NULL, 0,
2903 NULL, HFILL }},
2904 { &hf_cms_UnsignedAttributes_item,
2905 { "Attribute", "cms.Attribute_element",
2906 FT_NONE, BASE_NONE, NULL, 0,
2907 NULL, HFILL }},
2908 { &hf_cms_attrType,
2909 { "attrType", "cms.attrType",
2910 FT_OID, BASE_NONE, NULL, 0,
2911 NULL, HFILL }},
2912 { &hf_cms_attrValues,
2913 { "attrValues", "cms.attrValues",
2914 FT_UINT32, BASE_DEC, NULL, 0,
2915 "SET_OF_AttributeValue", HFILL }},
2916 { &hf_cms_attrValues_item,
2917 { "AttributeValue", "cms.AttributeValue_element",
2918 FT_NONE, BASE_NONE, NULL, 0,
2919 NULL, HFILL }},
2920 { &hf_cms_originatorInfo,
2921 { "originatorInfo", "cms.originatorInfo_element",
2922 FT_NONE, BASE_NONE, NULL, 0,
2923 NULL, HFILL }},
2924 { &hf_cms_recipientInfos,
2925 { "recipientInfos", "cms.recipientInfos",
2926 FT_UINT32, BASE_DEC, NULL, 0,
2927 NULL, HFILL }},
2928 { &hf_cms_encryptedContentInfo,
2929 { "encryptedContentInfo", "cms.encryptedContentInfo_element",
2930 FT_NONE, BASE_NONE, NULL, 0,
2931 NULL, HFILL }},
2932 { &hf_cms_unprotectedAttrs,
2933 { "unprotectedAttrs", "cms.unprotectedAttrs",
2934 FT_UINT32, BASE_DEC, NULL, 0,
2935 "UnprotectedAttributes", HFILL }},
2936 { &hf_cms_certs,
2937 { "certs", "cms.certs",
2938 FT_UINT32, BASE_DEC, NULL, 0,
2939 "CertificateSet", HFILL }},
2940 { &hf_cms_RecipientInfos_item,
2941 { "RecipientInfo", "cms.RecipientInfo",
2942 FT_UINT32, BASE_DEC, VALS(cms_RecipientInfo_vals), 0,
2943 NULL, HFILL }},
2944 { &hf_cms_encryptedContentType,
2945 { "contentType", "cms.encryptedContentType",
2946 FT_OID, BASE_NONE, NULL, 0,
2947 NULL, HFILL }},
2948 { &hf_cms_contentEncryptionAlgorithm,
2949 { "contentEncryptionAlgorithm", "cms.contentEncryptionAlgorithm_element",
2950 FT_NONE, BASE_NONE, NULL, 0,
2951 "ContentEncryptionAlgorithmIdentifier", HFILL }},
2952 { &hf_cms_encryptedContent,
2953 { "encryptedContent", "cms.encryptedContent",
2954 FT_BYTES, BASE_NONE, NULL, 0,
2955 NULL, HFILL }},
2956 { &hf_cms_UnprotectedAttributes_item,
2957 { "Attribute", "cms.Attribute_element",
2958 FT_NONE, BASE_NONE, NULL, 0,
2959 NULL, HFILL }},
2960 { &hf_cms_ktri,
2961 { "ktri", "cms.ktri_element",
2962 FT_NONE, BASE_NONE, NULL, 0,
2963 "KeyTransRecipientInfo", HFILL }},
2964 { &hf_cms_kari,
2965 { "kari", "cms.kari_element",
2966 FT_NONE, BASE_NONE, NULL, 0,
2967 "KeyAgreeRecipientInfo", HFILL }},
2968 { &hf_cms_kekri,
2969 { "kekri", "cms.kekri_element",
2970 FT_NONE, BASE_NONE, NULL, 0,
2971 "KEKRecipientInfo", HFILL }},
2972 { &hf_cms_pwri,
2973 { "pwri", "cms.pwri_element",
2974 FT_NONE, BASE_NONE, NULL, 0,
2975 "PasswordRecipientInfo", HFILL }},
2976 { &hf_cms_ori,
2977 { "ori", "cms.ori_element",
2978 FT_NONE, BASE_NONE, NULL, 0,
2979 "OtherRecipientInfo", HFILL }},
2980 { &hf_cms_rid,
2981 { "rid", "cms.rid",
2982 FT_UINT32, BASE_DEC, VALS(cms_RecipientIdentifier_vals), 0,
2983 "RecipientIdentifier", HFILL }},
2984 { &hf_cms_keyEncryptionAlgorithm,
2985 { "keyEncryptionAlgorithm", "cms.keyEncryptionAlgorithm_element",
2986 FT_NONE, BASE_NONE, NULL, 0,
2987 "KeyEncryptionAlgorithmIdentifier", HFILL }},
2988 { &hf_cms_encryptedKey,
2989 { "encryptedKey", "cms.encryptedKey",
2990 FT_BYTES, BASE_NONE, NULL, 0,
2991 NULL, HFILL }},
2992 { &hf_cms_originator,
2993 { "originator", "cms.originator",
2994 FT_UINT32, BASE_DEC, VALS(cms_OriginatorIdentifierOrKey_vals), 0,
2995 "OriginatorIdentifierOrKey", HFILL }},
2996 { &hf_cms_ukm,
2997 { "ukm", "cms.ukm",
2998 FT_BYTES, BASE_NONE, NULL, 0,
2999 "UserKeyingMaterial", HFILL }},
3000 { &hf_cms_recipientEncryptedKeys,
3001 { "recipientEncryptedKeys", "cms.recipientEncryptedKeys",
3002 FT_UINT32, BASE_DEC, NULL, 0,
3003 NULL, HFILL }},
3004 { &hf_cms_originatorKey,
3005 { "originatorKey", "cms.originatorKey_element",
3006 FT_NONE, BASE_NONE, NULL, 0,
3007 "OriginatorPublicKey", HFILL }},
3008 { &hf_cms_algorithm,
3009 { "algorithm", "cms.algorithm_element",
3010 FT_NONE, BASE_NONE, NULL, 0,
3011 "AlgorithmIdentifier", HFILL }},
3012 { &hf_cms_publicKey,
3013 { "publicKey", "cms.publicKey",
3014 FT_BYTES, BASE_NONE, NULL, 0,
3015 "BIT_STRING", HFILL }},
3016 { &hf_cms_RecipientEncryptedKeys_item,
3017 { "RecipientEncryptedKey", "cms.RecipientEncryptedKey_element",
3018 FT_NONE, BASE_NONE, NULL, 0,
3019 NULL, HFILL }},
3020 { &hf_cms_rekRid,
3021 { "rid", "cms.rekRid",
3022 FT_UINT32, BASE_DEC, VALS(cms_KeyAgreeRecipientIdentifier_vals), 0,
3023 "KeyAgreeRecipientIdentifier", HFILL }},
3024 { &hf_cms_rKeyId,
3025 { "rKeyId", "cms.rKeyId_element",
3026 FT_NONE, BASE_NONE, NULL, 0,
3027 "RecipientKeyIdentifier", HFILL }},
3028 { &hf_cms_date,
3029 { "date", "cms.date",
3030 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
3031 "GeneralizedTime", HFILL }},
3032 { &hf_cms_other,
3033 { "other", "cms.other_element",
3034 FT_NONE, BASE_NONE, NULL, 0,
3035 "OtherKeyAttribute", HFILL }},
3036 { &hf_cms_kekid,
3037 { "kekid", "cms.kekid_element",
3038 FT_NONE, BASE_NONE, NULL, 0,
3039 "KEKIdentifier", HFILL }},
3040 { &hf_cms_keyIdentifier,
3041 { "keyIdentifier", "cms.keyIdentifier",
3042 FT_BYTES, BASE_NONE, NULL, 0,
3043 "OCTET_STRING", HFILL }},
3044 { &hf_cms_keyDerivationAlgorithm,
3045 { "keyDerivationAlgorithm", "cms.keyDerivationAlgorithm_element",
3046 FT_NONE, BASE_NONE, NULL, 0,
3047 "KeyDerivationAlgorithmIdentifier", HFILL }},
3048 { &hf_cms_oriType,
3049 { "oriType", "cms.oriType",
3050 FT_OID, BASE_NONE, NULL, 0,
3051 NULL, HFILL }},
3052 { &hf_cms_oriValue,
3053 { "oriValue", "cms.oriValue_element",
3054 FT_NONE, BASE_NONE, NULL, 0,
3055 NULL, HFILL }},
3056 { &hf_cms_digest,
3057 { "digest", "cms.digest",
3058 FT_BYTES, BASE_NONE, NULL, 0,
3059 NULL, HFILL }},
3060 { &hf_cms_macAlgorithm,
3061 { "macAlgorithm", "cms.macAlgorithm_element",
3062 FT_NONE, BASE_NONE, NULL, 0,
3063 "MessageAuthenticationCodeAlgorithm", HFILL }},
3064 { &hf_cms_authAttrs,
3065 { "authAttrs", "cms.authAttrs",
3066 FT_UINT32, BASE_DEC, NULL, 0,
3067 "AuthAttributes", HFILL }},
3068 { &hf_cms_mac,
3069 { "mac", "cms.mac",
3070 FT_BYTES, BASE_NONE, NULL, 0,
3071 "MessageAuthenticationCode", HFILL }},
3072 { &hf_cms_unauthAttrs,
3073 { "unauthAttrs", "cms.unauthAttrs",
3074 FT_UINT32, BASE_DEC, NULL, 0,
3075 "UnauthAttributes", HFILL }},
3076 { &hf_cms_AuthAttributes_item,
3077 { "Attribute", "cms.Attribute_element",
3078 FT_NONE, BASE_NONE, NULL, 0,
3079 NULL, HFILL }},
3080 { &hf_cms_UnauthAttributes_item,
3081 { "Attribute", "cms.Attribute_element",
3082 FT_NONE, BASE_NONE, NULL, 0,
3083 NULL, HFILL }},
3084 { &hf_cms_RevocationInfoChoices_item,
3085 { "RevocationInfoChoice", "cms.RevocationInfoChoice",
3086 FT_UINT32, BASE_DEC, VALS(cms_RevocationInfoChoice_vals), 0,
3087 NULL, HFILL }},
3088 { &hf_cms_crl,
3089 { "crl", "cms.crl_element",
3090 FT_NONE, BASE_NONE, NULL, 0,
3091 "CertificateList", HFILL }},
3092 { &hf_cms_otherRIC,
3093 { "other", "cms.otherRIC_element",
3094 FT_NONE, BASE_NONE, NULL, 0,
3095 "OtherRevocationInfoFormat", HFILL }},
3096 { &hf_cms_otherRevInfoFormat,
3097 { "otherRevInfoFormat", "cms.otherRevInfoFormat",
3098 FT_OID, BASE_NONE, NULL, 0,
3099 NULL, HFILL }},
3100 { &hf_cms_otherRevInfo,
3101 { "otherRevInfo", "cms.otherRevInfo_element",
3102 FT_NONE, BASE_NONE, NULL, 0,
3103 NULL, HFILL }},
3104 { &hf_cms_certificate,
3105 { "certificate", "cms.certificate_element",
3106 FT_NONE, BASE_NONE, NULL, 0,
3107 NULL, HFILL }},
3108 { &hf_cms_extendedCertificate,
3109 { "extendedCertificate", "cms.extendedCertificate_element",
3110 FT_NONE, BASE_NONE, NULL, 0,
3111 NULL, HFILL }},
3112 { &hf_cms_v1AttrCert,
3113 { "v1AttrCert", "cms.v1AttrCert_element",
3114 FT_NONE, BASE_NONE, NULL, 0,
3115 "AttributeCertificateV1", HFILL }},
3116 { &hf_cms_v2AttrCert,
3117 { "v2AttrCert", "cms.v2AttrCert_element",
3118 FT_NONE, BASE_NONE, NULL, 0,
3119 "AttributeCertificateV2", HFILL }},
3120 { &hf_cms_CertificateSet_item,
3121 { "CertificateChoices", "cms.CertificateChoices",
3122 FT_UINT32, BASE_DEC, VALS(cms_CertificateChoices_vals), 0,
3123 NULL, HFILL }},
3124 { &hf_cms_issuer,
3125 { "issuer", "cms.issuer",
3126 FT_UINT32, BASE_DEC, VALS(x509if_Name_vals), 0,
3127 "Name", HFILL }},
3128 { &hf_cms_serialNumber,
3129 { "serialNumber", "cms.serialNumber",
3130 FT_BYTES, BASE_NONE, NULL, 0,
3131 "CertificateSerialNumber", HFILL }},
3132 { &hf_cms_keyAttrId,
3133 { "keyAttrId", "cms.keyAttrId",
3134 FT_OID, BASE_NONE, NULL, 0,
3135 NULL, HFILL }},
3136 { &hf_cms_keyAttr,
3137 { "keyAttr", "cms.keyAttr_element",
3138 FT_NONE, BASE_NONE, NULL, 0,
3139 NULL, HFILL }},
3140 { &hf_cms_utcTime,
3141 { "utcTime", "cms.utcTime",
3142 FT_STRING, BASE_NONE, NULL, 0,
3143 NULL, HFILL }},
3144 { &hf_cms_generalTime,
3145 { "generalTime", "cms.generalTime",
3146 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
3147 "GeneralizedTime", HFILL }},
3148 { &hf_cms_rc2ParameterVersion,
3149 { "rc2ParameterVersion", "cms.rc2ParameterVersion",
3150 FT_INT32, BASE_DEC, NULL, 0,
3151 "INTEGER", HFILL }},
3152 { &hf_cms_iv,
3153 { "iv", "cms.iv",
3154 FT_BYTES, BASE_NONE, NULL, 0,
3155 "OCTET_STRING", HFILL }},
3156 { &hf_cms_extendedCertificateInfo,
3157 { "extendedCertificateInfo", "cms.extendedCertificateInfo_element",
3158 FT_NONE, BASE_NONE, NULL, 0,
3159 NULL, HFILL }},
3160 { &hf_cms_signature,
3161 { "signature", "cms.signature",
3162 FT_BYTES, BASE_NONE, NULL, 0,
3163 NULL, HFILL }},
3164 { &hf_cms_attributes,
3165 { "attributes", "cms.attributes",
3166 FT_UINT32, BASE_DEC, NULL, 0,
3167 "UnauthAttributes", HFILL }},
3168 { &hf_cms_SMIMECapabilities_item,
3169 { "SMIMECapability", "cms.SMIMECapability_element",
3170 FT_NONE, BASE_NONE, NULL, 0,
3171 NULL, HFILL }},
3172 { &hf_cms_capability,
3173 { "capability", "cms.capability",
3174 FT_OID, BASE_NONE, NULL, 0,
3175 NULL, HFILL }},
3176 { &hf_cms_parameters,
3177 { "parameters", "cms.parameters_element",
3178 FT_NONE, BASE_NONE, NULL, 0,
3179 NULL, HFILL }},
3180 { &hf_cms_recipientKeyId,
3181 { "recipientKeyId", "cms.recipientKeyId_element",
3182 FT_NONE, BASE_NONE, NULL, 0,
3183 "RecipientKeyIdentifier", HFILL }},
3184 { &hf_cms_subjectAltKeyIdentifier,
3185 { "subjectAltKeyIdentifier", "cms.subjectAltKeyIdentifier",
3186 FT_BYTES, BASE_NONE, NULL, 0,
3187 "SubjectKeyIdentifier", HFILL }},
3188 { &hf_cms_rc2WrapParameter,
3189 { "rc2WrapParameter", "cms.rc2WrapParameter",
3190 FT_INT32, BASE_DEC, NULL, 0,
3191 NULL, HFILL }},
3192 { &hf_cms_rc2CBCParameter,
3193 { "rc2CBCParameter", "cms.rc2CBCParameter_element",
3194 FT_NONE, BASE_NONE, NULL, 0,
3195 NULL, HFILL }},
3196 { &hf_cms_authEncryptedContentInfo,
3197 { "authEncryptedContentInfo", "cms.authEncryptedContentInfo_element",
3198 FT_NONE, BASE_NONE, NULL, 0,
3199 "EncryptedContentInfo", HFILL }},
3200 { &hf_cms_aes_nonce,
3201 { "aes-nonce", "cms.aes_nonce",
3202 FT_BYTES, BASE_NONE, NULL, 0,
3203 "OCTET_STRING_SIZE_7_13", HFILL }},
3204 { &hf_cms_aes_ICVlen,
3205 { "aes-ICVlen", "cms.aes_ICVlen",
3206 FT_UINT32, BASE_DEC, NULL, 0,
3207 "AES_CCM_ICVlen", HFILL }},
3208 { &hf_cms_aes_nonce_01,
3209 { "aes-nonce", "cms.aes_nonce",
3210 FT_BYTES, BASE_NONE, NULL, 0,
3211 "OCTET_STRING", HFILL }},
3212 { &hf_cms_aes_ICVlen_01,
3213 { "aes-ICVlen", "cms.aes_ICVlen",
3214 FT_UINT32, BASE_DEC, NULL, 0,
3215 "AES_GCM_ICVlen", HFILL }},
3216 { &hf_cms_acInfo,
3217 { "acInfo", "cms.acInfo_element",
3218 FT_NONE, BASE_NONE, NULL, 0,
3219 "AttributeCertificateInfoV1", HFILL }},
3220 { &hf_cms_signatureAlgorithm_v1,
3221 { "signatureAlgorithm", "cms.signatureAlgorithm_v1_element",
3222 FT_NONE, BASE_NONE, NULL, 0,
3223 "AlgorithmIdentifier", HFILL }},
3224 { &hf_cms_signatureValue_v1,
3225 { "signature", "cms.signatureValue_v1",
3226 FT_BYTES, BASE_NONE, NULL, 0,
3227 "BIT_STRING", HFILL }},
3228 { &hf_cms_version_v1,
3229 { "version", "cms.version_v1",
3230 FT_INT32, BASE_DEC, VALS(cms_AttCertVersionV1_vals), 0,
3231 "AttCertVersionV1", HFILL }},
3232 { &hf_cms_subject,
3233 { "subject", "cms.subject",
3234 FT_UINT32, BASE_DEC, VALS(cms_T_subject_vals), 0,
3235 NULL, HFILL }},
3236 { &hf_cms_baseCertificateID,
3237 { "baseCertificateID", "cms.baseCertificateID_element",
3238 FT_NONE, BASE_NONE, NULL, 0,
3239 "IssuerSerial", HFILL }},
3240 { &hf_cms_subjectName,
3241 { "subjectName", "cms.subjectName",
3242 FT_UINT32, BASE_DEC, NULL, 0,
3243 "GeneralNames", HFILL }},
3244 { &hf_cms_issuer_v1,
3245 { "issuer", "cms.issuer_v1",
3246 FT_UINT32, BASE_DEC, NULL, 0,
3247 "GeneralNames", HFILL }},
3248 { &hf_cms_signature_v1,
3249 { "signature", "cms.signature_v1_element",
3250 FT_NONE, BASE_NONE, NULL, 0,
3251 "AlgorithmIdentifier", HFILL }},
3252 { &hf_cms_attCertValidityPeriod,
3253 { "attCertValidityPeriod", "cms.attCertValidityPeriod_element",
3254 FT_NONE, BASE_NONE, NULL, 0,
3255 NULL, HFILL }},
3256 { &hf_cms_attributes_v1,
3257 { "attributes", "cms.attributes_v1",
3258 FT_UINT32, BASE_DEC, NULL, 0,
3259 "SEQUENCE_OF_Attribute", HFILL }},
3260 { &hf_cms_attributes_v1_item,
3261 { "Attribute", "cms.Attribute_element",
3262 FT_NONE, BASE_NONE, NULL, 0,
3263 NULL, HFILL }},
3264 { &hf_cms_issuerUniqueID,
3265 { "issuerUniqueID", "cms.issuerUniqueID",
3266 FT_BYTES, BASE_NONE, NULL, 0,
3267 "UniqueIdentifier", HFILL }},
3268 { &hf_cms_extensions,
3269 { "extensions", "cms.extensions",
3270 FT_UINT32, BASE_DEC, NULL, 0,
3271 NULL, HFILL }},
3272 { &hf_cms_name,
3273 { "name", "cms.name",
3274 FT_UINT32, BASE_DEC, VALS(cms_PreferredOrLegacyPackageIdentifier_vals), 0,
3275 "PreferredOrLegacyPackageIdentifier", HFILL }},
3276 { &hf_cms_stale,
3277 { "stale", "cms.stale",
3278 FT_UINT32, BASE_DEC, VALS(cms_PreferredOrLegacyStalePackageIdentifier_vals), 0,
3279 "PreferredOrLegacyStalePackageIdentifier", HFILL }},
3280 { &hf_cms_preferred,
3281 { "preferred", "cms.preferred_element",
3282 FT_NONE, BASE_NONE, NULL, 0,
3283 "PreferredPackageIdentifier", HFILL }},
3284 { &hf_cms_legacy,
3285 { "legacy", "cms.legacy",
3286 FT_BYTES, BASE_NONE, NULL, 0,
3287 "OCTET_STRING", HFILL }},
3288 { &hf_cms_fwPkgID,
3289 { "fwPkgID", "cms.fwPkgID",
3290 FT_OID, BASE_NONE, NULL, 0,
3291 "OBJECT_IDENTIFIER", HFILL }},
3292 { &hf_cms_verNum,
3293 { "verNum", "cms.verNum",
3294 FT_UINT64, BASE_DEC, NULL, 0,
3295 "INTEGER_0_MAX", HFILL }},
3296 { &hf_cms_preferredStaleVerNum,
3297 { "preferredStaleVerNum", "cms.preferredStaleVerNum",
3298 FT_UINT64, BASE_DEC, NULL, 0,
3299 "INTEGER_0_MAX", HFILL }},
3300 { &hf_cms_legacyStaleVersion,
3301 { "legacyStaleVersion", "cms.legacyStaleVersion",
3302 FT_BYTES, BASE_NONE, NULL, 0,
3303 "OCTET_STRING", HFILL }},
3304 { &hf_cms_TargetHardwareIdentifiers_item,
3305 { "TargetHardwareIdentifiers item", "cms.TargetHardwareIdentifiers_item",
3306 FT_OID, BASE_NONE, NULL, 0,
3307 "OBJECT_IDENTIFIER", HFILL }},
3308 { &hf_cms_ImplementedCryptoAlgorithms_item,
3309 { "ImplementedCryptoAlgorithms item", "cms.ImplementedCryptoAlgorithms_item",
3310 FT_OID, BASE_NONE, NULL, 0,
3311 "OBJECT_IDENTIFIER", HFILL }},
3312 { &hf_cms_ImplementedCompressAlgorithms_item,
3313 { "ImplementedCompressAlgorithms item", "cms.ImplementedCompressAlgorithms_item",
3314 FT_OID, BASE_NONE, NULL, 0,
3315 "OBJECT_IDENTIFIER", HFILL }},
3316 { &hf_cms_CommunityIdentifiers_item,
3317 { "CommunityIdentifier", "cms.CommunityIdentifier",
3318 FT_UINT32, BASE_DEC, VALS(cms_CommunityIdentifier_vals), 0,
3319 NULL, HFILL }},
3320 { &hf_cms_communityOID,
3321 { "communityOID", "cms.communityOID",
3322 FT_OID, BASE_NONE, NULL, 0,
3323 "OBJECT_IDENTIFIER", HFILL }},
3324 { &hf_cms_hwModuleList,
3325 { "hwModuleList", "cms.hwModuleList_element",
3326 FT_NONE, BASE_NONE, NULL, 0,
3327 "HardwareModules", HFILL }},
3328 { &hf_cms_hwType,
3329 { "hwType", "cms.hwType",
3330 FT_OID, BASE_NONE, NULL, 0,
3331 "OBJECT_IDENTIFIER", HFILL }},
3332 { &hf_cms_hwSerialEntries,
3333 { "hwSerialEntries", "cms.hwSerialEntries",
3334 FT_UINT32, BASE_DEC, NULL, 0,
3335 "SEQUENCE_OF_HardwareSerialEntry", HFILL }},
3336 { &hf_cms_hwSerialEntries_item,
3337 { "HardwareSerialEntry", "cms.HardwareSerialEntry",
3338 FT_UINT32, BASE_DEC, VALS(cms_HardwareSerialEntry_vals), 0,
3339 NULL, HFILL }},
3340 { &hf_cms_all,
3341 { "all", "cms.all_element",
3342 FT_NONE, BASE_NONE, NULL, 0,
3343 NULL, HFILL }},
3344 { &hf_cms_single,
3345 { "single", "cms.single",
3346 FT_BYTES, BASE_NONE, NULL, 0,
3347 "OCTET_STRING", HFILL }},
3348 { &hf_cms_block,
3349 { "block", "cms.block_element",
3350 FT_NONE, BASE_NONE, NULL, 0,
3351 NULL, HFILL }},
3352 { &hf_cms_low,
3353 { "low", "cms.low",
3354 FT_BYTES, BASE_NONE, NULL, 0,
3355 "OCTET_STRING", HFILL }},
3356 { &hf_cms_high,
3357 { "high", "cms.high",
3358 FT_BYTES, BASE_NONE, NULL, 0,
3359 "OCTET_STRING", HFILL }},
3360 { &hf_cms_fwPkgType,
3361 { "fwPkgType", "cms.fwPkgType",
3362 FT_INT32, BASE_DEC, NULL, 0,
3363 "INTEGER", HFILL }},
3364 { &hf_cms_dependencies,
3365 { "dependencies", "cms.dependencies",
3366 FT_UINT32, BASE_DEC, NULL, 0,
3367 "SEQUENCE_OF_PreferredOrLegacyPackageIdentifier", HFILL }},
3368 { &hf_cms_dependencies_item,
3369 { "PreferredOrLegacyPackageIdentifier", "cms.PreferredOrLegacyPackageIdentifier",
3370 FT_UINT32, BASE_DEC, VALS(cms_PreferredOrLegacyPackageIdentifier_vals), 0,
3371 NULL, HFILL }},
3372 { &hf_cms_fwReceiptVersion,
3373 { "version", "cms.fwReceiptVersion",
3374 FT_INT32, BASE_DEC, VALS(cms_FWReceiptVersion_vals), 0,
3375 "FWReceiptVersion", HFILL }},
3376 { &hf_cms_hwSerialNum,
3377 { "hwSerialNum", "cms.hwSerialNum",
3378 FT_BYTES, BASE_NONE, NULL, 0,
3379 "OCTET_STRING", HFILL }},
3380 { &hf_cms_fwPkgName,
3381 { "fwPkgName", "cms.fwPkgName",
3382 FT_UINT32, BASE_DEC, VALS(cms_PreferredOrLegacyPackageIdentifier_vals), 0,
3383 "PreferredOrLegacyPackageIdentifier", HFILL }},
3384 { &hf_cms_trustAnchorKeyID,
3385 { "trustAnchorKeyID", "cms.trustAnchorKeyID",
3386 FT_BYTES, BASE_NONE, NULL, 0,
3387 "OCTET_STRING", HFILL }},
3388 { &hf_cms_decryptKeyID,
3389 { "decryptKeyID", "cms.decryptKeyID",
3390 FT_BYTES, BASE_NONE, NULL, 0,
3391 "OCTET_STRING", HFILL }},
3392 { &hf_cms_fwErrorVersion,
3393 { "version", "cms.fwErrorVersion",
3394 FT_INT32, BASE_DEC, VALS(cms_FWErrorVersion_vals), 0,
3395 "FWErrorVersion", HFILL }},
3396 { &hf_cms_errorCode,
3397 { "errorCode", "cms.errorCode",
3398 FT_UINT32, BASE_DEC, VALS(cms_FirmwarePackageLoadErrorCode_vals), 0,
3399 "FirmwarePackageLoadErrorCode", HFILL }},
3400 { &hf_cms_vendorErrorCode,
3401 { "vendorErrorCode", "cms.vendorErrorCode",
3402 FT_INT32, BASE_DEC, NULL, 0,
3403 "VendorLoadErrorCode", HFILL }},
3404 { &hf_cms_config,
3405 { "config", "cms.config",
3406 FT_UINT32, BASE_DEC, NULL, 0,
3407 "SEQUENCE_OF_CurrentFWConfig", HFILL }},
3408 { &hf_cms_config_item,
3409 { "CurrentFWConfig", "cms.CurrentFWConfig_element",
3410 FT_NONE, BASE_NONE, NULL, 0,
3411 NULL, HFILL }},
3412 { &hf_cms_msgDigest,
3413 { "msgDigest", "cms.msgDigest",
3414 FT_BYTES, BASE_NONE, NULL, 0,
3415 "OCTET_STRING", HFILL }},
3418 /* List of subtrees */
3419 static int *ett[] = {
3420 &ett_cms,
3421 &ett_cms_ContentInfo,
3422 &ett_cms_SignedData,
3423 &ett_cms_DigestAlgorithmIdentifiers,
3424 &ett_cms_SignerInfos,
3425 &ett_cms_EncapsulatedContentInfo,
3426 &ett_cms_SignerInfo,
3427 &ett_cms_SignerIdentifier,
3428 &ett_cms_SignedAttributes,
3429 &ett_cms_UnsignedAttributes,
3430 &ett_cms_Attribute,
3431 &ett_cms_SET_OF_AttributeValue,
3432 &ett_cms_EnvelopedData,
3433 &ett_cms_OriginatorInfo,
3434 &ett_cms_RecipientInfos,
3435 &ett_cms_EncryptedContentInfo,
3436 &ett_cms_UnprotectedAttributes,
3437 &ett_cms_RecipientInfo,
3438 &ett_cms_KeyTransRecipientInfo,
3439 &ett_cms_RecipientIdentifier,
3440 &ett_cms_KeyAgreeRecipientInfo,
3441 &ett_cms_OriginatorIdentifierOrKey,
3442 &ett_cms_OriginatorPublicKey,
3443 &ett_cms_RecipientEncryptedKeys,
3444 &ett_cms_RecipientEncryptedKey,
3445 &ett_cms_KeyAgreeRecipientIdentifier,
3446 &ett_cms_RecipientKeyIdentifier,
3447 &ett_cms_KEKRecipientInfo,
3448 &ett_cms_KEKIdentifier,
3449 &ett_cms_PasswordRecipientInfo,
3450 &ett_cms_OtherRecipientInfo,
3451 &ett_cms_DigestedData,
3452 &ett_cms_EncryptedData,
3453 &ett_cms_AuthenticatedData,
3454 &ett_cms_AuthAttributes,
3455 &ett_cms_UnauthAttributes,
3456 &ett_cms_RevocationInfoChoices,
3457 &ett_cms_RevocationInfoChoice,
3458 &ett_cms_OtherRevocationInfoFormat,
3459 &ett_cms_CertificateChoices,
3460 &ett_cms_CertificateSet,
3461 &ett_cms_IssuerAndSerialNumber,
3462 &ett_cms_OtherKeyAttribute,
3463 &ett_cms_Time,
3464 &ett_cms_RC2CBCParameter,
3465 &ett_cms_ExtendedCertificate,
3466 &ett_cms_ExtendedCertificateInfo,
3467 &ett_cms_DigestInfo,
3468 &ett_cms_SMIMECapabilities,
3469 &ett_cms_SMIMECapability,
3470 &ett_cms_SMIMEEncryptionKeyPreference,
3471 &ett_cms_RC2CBCParameters,
3472 &ett_cms_AuthEnvelopedData,
3473 &ett_cms_CCMParameters,
3474 &ett_cms_GCMParameters,
3475 &ett_cms_AttributeCertificateV1,
3476 &ett_cms_AttributeCertificateInfoV1,
3477 &ett_cms_T_subject,
3478 &ett_cms_SEQUENCE_OF_Attribute,
3479 &ett_cms_FirmwarePackageIdentifier,
3480 &ett_cms_PreferredOrLegacyPackageIdentifier,
3481 &ett_cms_PreferredPackageIdentifier,
3482 &ett_cms_PreferredOrLegacyStalePackageIdentifier,
3483 &ett_cms_TargetHardwareIdentifiers,
3484 &ett_cms_ImplementedCryptoAlgorithms,
3485 &ett_cms_ImplementedCompressAlgorithms,
3486 &ett_cms_CommunityIdentifiers,
3487 &ett_cms_CommunityIdentifier,
3488 &ett_cms_HardwareModules,
3489 &ett_cms_SEQUENCE_OF_HardwareSerialEntry,
3490 &ett_cms_HardwareSerialEntry,
3491 &ett_cms_T_block,
3492 &ett_cms_FirmwarePackageInfo,
3493 &ett_cms_SEQUENCE_OF_PreferredOrLegacyPackageIdentifier,
3494 &ett_cms_FirmwarePackageLoadReceipt,
3495 &ett_cms_FirmwarePackageLoadError,
3496 &ett_cms_SEQUENCE_OF_CurrentFWConfig,
3497 &ett_cms_CurrentFWConfig,
3498 &ett_cms_HardwareModuleName,
3499 &ett_cms_FirmwarePackageMessageDigest,
3502 /* Register protocol */
3503 proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME);
3505 cms_handle = register_dissector(PFNAME, dissect_cms, proto_cms);
3507 /* Register fields and subtrees */
3508 proto_register_field_array(proto_cms, hf, array_length(hf));
3509 proto_register_subtree_array(ett, array_length(ett));
3511 register_ber_syntax_dissector("ContentInfo", proto_cms, dissect_ContentInfo_PDU);
3512 register_ber_syntax_dissector("SignedData", proto_cms, dissect_SignedData_PDU);
3513 register_ber_oid_syntax(".p7s", NULL, "ContentInfo");
3514 register_ber_oid_syntax(".p7m", NULL, "ContentInfo");
3515 register_ber_oid_syntax(".p7c", NULL, "ContentInfo");
3521 /*--- proto_reg_handoff_cms -------------------------------------------*/
3522 void proto_reg_handoff_cms(void) {
3523 dissector_handle_t content_info_handle;
3524 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.6", dissect_ContentInfo_PDU, proto_cms, "id-ct-contentInfo");
3525 register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
3526 register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
3527 register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
3528 register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
3529 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
3530 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.9", dissect_EncryptedContentInfo_PDU, proto_cms, "id-ct-compressedData");
3531 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.23", dissect_AuthEnvelopedData_PDU, proto_cms, "id-ct-authEnvelopedData");
3532 register_ber_oid_dissector("1.2.840.113549.1.9.3", dissect_ContentType_PDU, proto_cms, "id-contentType");
3533 register_ber_oid_dissector("1.2.840.113549.1.9.4", dissect_MessageDigest_PDU, proto_cms, "id-messageDigest");
3534 register_ber_oid_dissector("1.2.840.113549.1.9.5", dissect_SigningTime_PDU, proto_cms, "id-signingTime");
3535 register_ber_oid_dissector("1.2.840.113549.1.9.6", dissect_Countersignature_PDU, proto_cms, "id-counterSignature");
3536 register_ber_oid_dissector("2.6.1.4.18", dissect_ContentInfo_PDU, proto_cms, "id-et-pkcs7");
3537 register_ber_oid_dissector("1.3.6.1.4.1.311.16.4", dissect_IssuerAndSerialNumber_PDU, proto_cms, "ms-oe-encryption-key-preference");
3538 register_ber_oid_dissector("1.2.840.113549.1.9.15", dissect_SMIMECapabilities_PDU, proto_cms, "id-smime-capabilities");
3539 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.11", dissect_SMIMEEncryptionKeyPreference_PDU, proto_cms, "id-encryption-key-preference");
3540 register_ber_oid_dissector("1.2.840.113549.3.4", dissect_RC2CBCParameters_PDU, proto_cms, "id-alg-rc4");
3541 register_ber_oid_dissector("0.4.0.127.0.7.1.1.5.1.1.3", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "ecka-eg-X963KDF-SHA256");
3542 register_ber_oid_dissector("0.4.0.127.0.7.1.1.5.1.1.4", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "ecka-eg-X963KDF-SHA384");
3543 register_ber_oid_dissector("0.4.0.127.0.7.1.1.5.1.1.5", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "ecka-eg-X963KDF-SHA512");
3544 register_ber_oid_dissector("2.16.840.1.101.3.4.1.5", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "id-aes128-wrap");
3545 register_ber_oid_dissector("2.16.840.1.101.3.4.1.25", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "id-aes192-wrap");
3546 register_ber_oid_dissector("2.16.840.1.101.3.4.1.45", dissect_KeyEncryptionAlgorithmIdentifier_PDU, proto_cms, "id-aes256-wrap");
3547 register_ber_oid_dissector("2.16.840.1.101.3.4.1.6", dissect_GCMParameters_PDU, proto_cms, "id-aes128-GCM");
3548 register_ber_oid_dissector("2.16.840.1.101.3.4.1.26", dissect_GCMParameters_PDU, proto_cms, "id-aes192-GCM");
3549 register_ber_oid_dissector("2.16.840.1.101.3.4.1.46", dissect_GCMParameters_PDU, proto_cms, "id-aes256-GCM");
3550 register_ber_oid_dissector("2.16.840.1.101.3.4.1.7", dissect_CCMParameters_PDU, proto_cms, "id-aes128-CCM");
3551 register_ber_oid_dissector("2.16.840.1.101.3.4.1.27", dissect_CCMParameters_PDU, proto_cms, "id-aes192-CCM");
3552 register_ber_oid_dissector("2.16.840.1.101.3.4.1.44", dissect_CCMParameters_PDU, proto_cms, "id-aes256-CCM");
3553 register_ber_oid_dissector("1.3.133.16.840.63.0.2", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-stdDH-sha1kdf-scheme");
3554 register_ber_oid_dissector("1.3.132.1.11.0", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-stdDH-sha224kdf-scheme");
3555 register_ber_oid_dissector("1.3.132.1.11.1", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-stdDH-sha256kdf-scheme");
3556 register_ber_oid_dissector("1.3.132.1.11.2", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-stdDH-sha384kdf-scheme");
3557 register_ber_oid_dissector("1.3.132.1.11.3", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-stdDH-sha512kdf-scheme");
3558 register_ber_oid_dissector("1.3.133.16.840.63.0.3", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-cofactorDH-sha1kdf-scheme");
3559 register_ber_oid_dissector("1.3.132.1.14.0", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-cofactorDH-sha224kdf-scheme");
3560 register_ber_oid_dissector("1.3.132.1.14.1", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-cofactorDH-sha256kdf-scheme");
3561 register_ber_oid_dissector("1.3.132.1.14.2", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-cofactorDH-sha384kdf-scheme");
3562 register_ber_oid_dissector("1.3.132.1.14.3", dissect_KeyWrapAlgorithm_PDU, proto_cms, "dhSinglePass-cofactorDH-sha512kdf-scheme");
3563 register_ber_oid_dissector("1.3.133.16.840.63.0.16", dissect_KeyWrapAlgorithm_PDU, proto_cms, "mqvSinglePass-sha1kdf-scheme");
3564 register_ber_oid_dissector("1.3.132.1.15.0", dissect_KeyWrapAlgorithm_PDU, proto_cms, "mqvSinglePass-sha224kdf-scheme");
3565 register_ber_oid_dissector("1.3.132.1.15.1", dissect_KeyWrapAlgorithm_PDU, proto_cms, "mqvSinglePass-sha256kdf-scheme");
3566 register_ber_oid_dissector("1.3.132.1.15.2", dissect_KeyWrapAlgorithm_PDU, proto_cms, "mqvSinglePass-sha384kdf-scheme");
3567 register_ber_oid_dissector("1.3.132.1.15.3", dissect_KeyWrapAlgorithm_PDU, proto_cms, "mqvSinglePass-sha512kdf-scheme");
3568 register_ber_oid_dissector("1.2.840.113549.1.9.16.3.7", dissect_RC2WrapParameter_PDU, proto_cms, "id-alg-CMSRC2-wrap");
3569 register_ber_oid_dissector("1.2.840.113549.3.7", dissect_IV_PDU, proto_cms, "des-ede3-cbc");
3570 register_ber_oid_dissector("1.2.840.113549.3.2", dissect_RC2CBCParameters_PDU, proto_cms, "rc2-cbc");
3571 register_ber_oid_dissector("2.16.840.1.113730.3.1.40", dissect_SignedData_PDU, proto_cms, "userSMIMECertificate");
3572 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.16", dissect_FirmwarePkgData_PDU, proto_cms, "id-ct-firmwarePackage");
3573 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.35", dissect_FirmwarePackageIdentifier_PDU, proto_cms, "id-aa-firmwarePackageID");
3574 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.36", dissect_TargetHardwareIdentifiers_PDU, proto_cms, "id-aa-targetHardwareIDs");
3575 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.37", dissect_DecryptKeyIdentifier_PDU, proto_cms, "id-aa-decryptKeyID");
3576 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.38", dissect_ImplementedCryptoAlgorithms_PDU, proto_cms, "id-aa-implCryptoAlgs");
3577 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.43", dissect_ImplementedCompressAlgorithms_PDU, proto_cms, "id-aa-implCompressAlgs");
3578 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.40", dissect_CommunityIdentifiers_PDU, proto_cms, "id-aa-communityIdentifiers");
3579 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.42", dissect_FirmwarePackageInfo_PDU, proto_cms, "id-aa-firmwarePackageInfo");
3580 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.39", dissect_WrappedFirmwareKey_PDU, proto_cms, "id-aa-wrappedFirmwareKey");
3581 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.17", dissect_FirmwarePackageLoadReceipt_PDU, proto_cms, "id-ct-firmwareLoadReceipt");
3582 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.18", dissect_FirmwarePackageLoadError_PDU, proto_cms, "id-ct-firmwareLoadError");
3583 register_ber_oid_dissector("1.3.6.1.5.5.7.8.4", dissect_HardwareModuleName_PDU, proto_cms, "id-on-hardwareModuleName");
3584 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.41", dissect_FirmwarePackageMessageDigest_PDU, proto_cms, "id-aa-fwPkgMessageDigest");
3587 /* RFC 3370 [CMS-ASN} section 4.3.1 */
3588 register_ber_oid_dissector("1.2.840.113549.1.9.16.3.6", dissect_ber_oid_NULL_callback, proto_cms, "id-alg-CMS3DESwrap");
3590 oid_add_from_string("id-data","1.2.840.113549.1.7.1");
3591 oid_add_from_string("id-alg-des-ede3-cbc","1.2.840.113549.3.7");
3592 oid_add_from_string("id-alg-des-cbc","1.3.14.3.2.7");
3594 oid_add_from_string("id-ct-authEnvelopedData","1.2.840.113549.1.9.16.1.23");
3595 oid_add_from_string("id-aes-CBC-CMAC-128","0.4.0.127.0.7.1.3.1.1.2");
3596 oid_add_from_string("id-aes-CBC-CMAC-192","0.4.0.127.0.7.1.3.1.1.3");
3597 oid_add_from_string("id-aes-CBC-CMAC-256","0.4.0.127.0.7.1.3.1.1.4");
3598 oid_add_from_string("ecdsaWithSHA256","1.2.840.10045.4.3.2");
3599 oid_add_from_string("ecdsaWithSHA384","1.2.840.10045.4.3.3");
3600 oid_add_from_string("ecdsaWithSHA512","1.2.840.10045.4.3.4");
3602 content_info_handle = create_dissector_handle (dissect_ContentInfo_PDU, proto_cms);
3604 dissector_add_string("media_type", "application/pkcs7-mime", content_info_handle);
3605 dissector_add_string("media_type", "application/pkcs7-signature", content_info_handle);
3607 dissector_add_string("media_type", "application/vnd.de-dke-k461-ic1+xml", content_info_handle);
3608 dissector_add_string("media_type", "application/vnd.de-dke-k461-ic1+xml; encap=cms-tr03109", content_info_handle);
3609 dissector_add_string("media_type", "application/vnd.de-dke-k461-ic1+xml; encap=cms-tr03109-zlib", content_info_handle);
3610 dissector_add_string("media_type", "application/hgp;encap=cms", content_info_handle);