1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Ethereal dissector compiler */
4 /* ../../tools/asn2eth.py -X -b -k -e -p ess -c ess.cnf -s packet-ess-template ExtendedSecurityServices.asn */
6 /* Input file: packet-ess-template.c */
9 * Routines for RFC2634 Extended Security Services packet dissection
10 * Ronnie Sahlberg 2004
12 * $Id: packet-ess-template.c 12438 2004-10-30 02:36:58Z sahlberg $
14 * Ethereal - Network traffic analyzer
15 * By Gerald Combs <gerald@ethereal.com>
16 * Copyright 1998 Gerald Combs
18 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License
20 * as published by the Free Software Foundation; either version 2
21 * of the License, or (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
43 #include "packet-ber.h"
44 #include "packet-ess.h"
45 #include "packet-cms.h"
46 #include "packet-x509ce.h"
47 #include "packet-x509af.h"
49 #define PNAME "Extended Security Services"
53 /* Initialize the protocol and registered fields */
54 static int proto_ess = -1;
55 static int hf_ess_SecurityCategory_type_OID = -1;
57 /*--- Included file: packet-ess-hf.c ---*/
59 static int hf_ess_ReceiptRequest_PDU = -1; /* ReceiptRequest */
60 static int hf_ess_ContentIdentifier_PDU = -1; /* ContentIdentifier */
61 static int hf_ess_Receipt_PDU = -1; /* Receipt */
62 static int hf_ess_ContentHints_PDU = -1; /* ContentHints */
63 static int hf_ess_MsgSigDigest_PDU = -1; /* MsgSigDigest */
64 static int hf_ess_ContentReference_PDU = -1; /* ContentReference */
65 static int hf_ess_MLExpansionHistory_PDU = -1; /* MLExpansionHistory */
66 static int hf_ess_SigningCertificate_PDU = -1; /* SigningCertificate */
67 static int hf_ess_signedContentIdentifier = -1; /* ContentIdentifier */
68 static int hf_ess_receiptsFrom = -1; /* ReceiptsFrom */
69 static int hf_ess_receiptsTo = -1; /* SEQUNCE_OF_GeneralNames */
70 static int hf_ess_receiptsTo_item = -1; /* GeneralNames */
71 static int hf_ess_allOrFirstTier = -1; /* AllOrFirstTier */
72 static int hf_ess_receiptList = -1; /* SEQUNCE_OF_GeneralNames */
73 static int hf_ess_receiptList_item = -1; /* GeneralNames */
74 static int hf_ess_version = -1; /* ESSVersion */
75 static int hf_ess_contentType = -1; /* ContentType */
76 static int hf_ess_originatorSignatureValue = -1; /* OCTET_STRING */
77 static int hf_ess_contentDescription = -1; /* UTF8String */
78 static int hf_ess_pString = -1; /* PrintableString */
79 static int hf_ess_utf8String = -1; /* UTF8String */
80 static int hf_ess_SecurityCategories_item = -1; /* SecurityCategory */
81 static int hf_ess_type = -1; /* T_type */
82 static int hf_ess_value = -1; /* T_value */
83 static int hf_ess_MLExpansionHistory_item = -1; /* MLData */
84 static int hf_ess_mailListIdentifier = -1; /* EntityIdentifier */
85 static int hf_ess_expansionTime = -1; /* GeneralizedTime */
86 static int hf_ess_mlReceiptPolicy = -1; /* MLReceiptPolicy */
87 static int hf_ess_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */
88 static int hf_ess_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */
89 static int hf_ess_none = -1; /* NULL */
90 static int hf_ess_insteadOf = -1; /* SEQUNCE_OF_GeneralNames */
91 static int hf_ess_insteadOf_item = -1; /* GeneralNames */
92 static int hf_ess_inAdditionTo = -1; /* SEQUNCE_OF_GeneralNames */
93 static int hf_ess_inAdditionTo_item = -1; /* GeneralNames */
94 static int hf_ess_certs = -1; /* SEQUNCE_OF_ESSCertID */
95 static int hf_ess_certs_item = -1; /* ESSCertID */
96 static int hf_ess_policies = -1; /* SEQUNCE_OF_PolicyInformation */
97 static int hf_ess_policies_item = -1; /* PolicyInformation */
98 static int hf_ess_certHash = -1; /* Hash */
99 static int hf_ess_issuerSerial = -1; /* IssuerSerial */
100 static int hf_ess_issuer = -1; /* GeneralNames */
101 static int hf_ess_serialNumber = -1; /* CertificateSerialNumber */
103 /*--- End of included file: packet-ess-hf.c ---*/
106 /* Initialize the subtree pointers */
108 /*--- Included file: packet-ess-ett.c ---*/
110 static gint ett_ess_ReceiptRequest = -1;
111 static gint ett_ess_SEQUNCE_OF_GeneralNames = -1;
112 static gint ett_ess_ReceiptsFrom = -1;
113 static gint ett_ess_Receipt = -1;
114 static gint ett_ess_ContentHints = -1;
115 static gint ett_ess_ContentReference = -1;
116 static gint ett_ess_ESSPrivacyMark = -1;
117 static gint ett_ess_SecurityCategories = -1;
118 static gint ett_ess_SecurityCategory = -1;
119 static gint ett_ess_MLExpansionHistory = -1;
120 static gint ett_ess_MLData = -1;
121 static gint ett_ess_EntityIdentifier = -1;
122 static gint ett_ess_MLReceiptPolicy = -1;
123 static gint ett_ess_SigningCertificate = -1;
124 static gint ett_ess_SEQUNCE_OF_ESSCertID = -1;
125 static gint ett_ess_SEQUNCE_OF_PolicyInformation = -1;
126 static gint ett_ess_ESSCertID = -1;
127 static gint ett_ess_IssuerSerial = -1;
129 /*--- End of included file: packet-ess-ett.c ---*/
132 static char object_identifier_id[64]; /*64 chars should be long enough? */
135 /*--- Included file: packet-ess-fn.c ---*/
137 /*--- Fields for imported types ---*/
139 static int dissect_receiptsTo_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
140 return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_receiptsTo_item);
142 static int dissect_receiptList_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
143 return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_receiptList_item);
145 static int dissect_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
146 return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_ess_contentType);
148 static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
149 return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_ess_issuerAndSerialNumber);
151 static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
152 return dissect_x509ce_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ess_subjectKeyIdentifier);
154 static int dissect_insteadOf_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
155 return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_insteadOf_item);
157 static int dissect_inAdditionTo_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
158 return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_inAdditionTo_item);
160 static int dissect_policies_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
161 return dissect_x509ce_PolicyInformation(FALSE, tvb, offset, pinfo, tree, hf_ess_policies_item);
163 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
164 return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_issuer);
166 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
167 return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_ess_serialNumber);
172 dissect_ess_ContentIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
173 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
178 static int dissect_signedContentIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
179 return dissect_ess_ContentIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ess_signedContentIdentifier);
183 static const value_string AllOrFirstTier_vals[] = {
184 { 0, "allReceipts" },
185 { 1, "firstTierRecipients" },
191 dissect_ess_AllOrFirstTier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
192 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
196 static int dissect_allOrFirstTier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
197 return dissect_ess_AllOrFirstTier(TRUE, tvb, offset, pinfo, tree, hf_ess_allOrFirstTier);
200 static const ber_sequence SEQUNCE_OF_GeneralNames_sequence_of[1] = {
201 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_receiptsTo_item },
205 dissect_ess_SEQUNCE_OF_GeneralNames(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
206 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
207 SEQUNCE_OF_GeneralNames_sequence_of, hf_index, ett_ess_SEQUNCE_OF_GeneralNames);
211 static int dissect_receiptsTo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
212 return dissect_ess_SEQUNCE_OF_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_ess_receiptsTo);
214 static int dissect_receiptList_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
215 return dissect_ess_SEQUNCE_OF_GeneralNames(TRUE, tvb, offset, pinfo, tree, hf_ess_receiptList);
217 static int dissect_insteadOf_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
218 return dissect_ess_SEQUNCE_OF_GeneralNames(TRUE, tvb, offset, pinfo, tree, hf_ess_insteadOf);
220 static int dissect_inAdditionTo_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
221 return dissect_ess_SEQUNCE_OF_GeneralNames(TRUE, tvb, offset, pinfo, tree, hf_ess_inAdditionTo);
225 static const value_string ReceiptsFrom_vals[] = {
226 { 0, "allOrFirstTier" },
227 { 1, "receiptList" },
231 static const ber_choice ReceiptsFrom_choice[] = {
232 { 0, BER_CLASS_CON, 0, 0, dissect_allOrFirstTier_impl },
233 { 1, BER_CLASS_CON, 1, 0, dissect_receiptList_impl },
238 dissect_ess_ReceiptsFrom(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
239 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
240 ReceiptsFrom_choice, hf_index, ett_ess_ReceiptsFrom);
244 static int dissect_receiptsFrom(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
245 return dissect_ess_ReceiptsFrom(FALSE, tvb, offset, pinfo, tree, hf_ess_receiptsFrom);
248 static const ber_sequence ReceiptRequest_sequence[] = {
249 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signedContentIdentifier },
250 { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_receiptsFrom },
251 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_receiptsTo },
256 dissect_ess_ReceiptRequest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
257 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
258 ReceiptRequest_sequence, hf_index, ett_ess_ReceiptRequest);
264 static const value_string ESSVersion_vals[] = {
271 dissect_ess_ESSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
272 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
276 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
277 return dissect_ess_ESSVersion(FALSE, tvb, offset, pinfo, tree, hf_ess_version);
282 dissect_ess_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
283 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
288 static int dissect_originatorSignatureValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
289 return dissect_ess_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_ess_originatorSignatureValue);
292 static const ber_sequence Receipt_sequence[] = {
293 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
294 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
295 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signedContentIdentifier },
296 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_originatorSignatureValue },
301 dissect_ess_Receipt(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
302 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
303 Receipt_sequence, hf_index, ett_ess_Receipt);
310 dissect_ess_UTF8String(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
311 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
312 pinfo, tree, tvb, offset, hf_index,
317 static int dissect_contentDescription(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
318 return dissect_ess_UTF8String(FALSE, tvb, offset, pinfo, tree, hf_ess_contentDescription);
320 static int dissect_utf8String(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
321 return dissect_ess_UTF8String(FALSE, tvb, offset, pinfo, tree, hf_ess_utf8String);
324 static const ber_sequence ContentHints_sequence[] = {
325 { BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_contentDescription },
326 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
331 dissect_ess_ContentHints(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
332 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
333 ContentHints_sequence, hf_index, ett_ess_ContentHints);
340 dissect_ess_MsgSigDigest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
341 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
347 static const ber_sequence ContentReference_sequence[] = {
348 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_contentType },
349 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signedContentIdentifier },
350 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_originatorSignatureValue },
355 dissect_ess_ContentReference(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
356 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
357 ContentReference_sequence, hf_index, ett_ess_ContentReference);
364 dissect_ess_SecurityPolicyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
365 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset,
372 static const value_string SecurityClassification_vals[] = {
374 { 1, "unclassified" },
376 { 3, "confidential" },
384 dissect_ess_SecurityClassification(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
385 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
392 dissect_ess_PrintableString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
393 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
394 pinfo, tree, tvb, offset, hf_index,
399 static int dissect_pString(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
400 return dissect_ess_PrintableString(FALSE, tvb, offset, pinfo, tree, hf_ess_pString);
404 static const value_string ESSPrivacyMark_vals[] = {
410 static const ber_choice ESSPrivacyMark_choice[] = {
411 { 0, BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_pString },
412 { 1, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_utf8String },
417 dissect_ess_ESSPrivacyMark(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
418 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
419 ESSPrivacyMark_choice, hf_index, ett_ess_ESSPrivacyMark);
426 dissect_ess_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
427 offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
428 hf_ess_SecurityCategory_type_OID, object_identifier_id);
433 static int dissect_type_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
434 return dissect_ess_T_type(TRUE, tvb, offset, pinfo, tree, hf_ess_type);
440 dissect_ess_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
441 offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
446 static int dissect_value_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
447 return dissect_ess_T_value(TRUE, tvb, offset, pinfo, tree, hf_ess_value);
450 static const ber_sequence SecurityCategory_sequence[] = {
451 { BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_type_impl },
452 { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_value_impl },
457 dissect_ess_SecurityCategory(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
458 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
459 SecurityCategory_sequence, hf_index, ett_ess_SecurityCategory);
463 static int dissect_SecurityCategories_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
464 return dissect_ess_SecurityCategory(FALSE, tvb, offset, pinfo, tree, hf_ess_SecurityCategories_item);
467 static const ber_sequence SecurityCategories_set_of[1] = {
468 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SecurityCategories_item },
472 dissect_ess_SecurityCategories(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
473 offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset,
474 SecurityCategories_set_of, hf_index, ett_ess_SecurityCategories);
480 static const value_string EntityIdentifier_vals[] = {
481 { 0, "issuerAndSerialNumber" },
482 { 1, "subjectKeyIdentifier" },
486 static const ber_choice EntityIdentifier_choice[] = {
487 { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber },
488 { 1, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectKeyIdentifier },
493 dissect_ess_EntityIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
494 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
495 EntityIdentifier_choice, hf_index, ett_ess_EntityIdentifier);
499 static int dissect_mailListIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
500 return dissect_ess_EntityIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ess_mailListIdentifier);
505 dissect_ess_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
506 offset = dissect_ber_generalized_time(pinfo, tree, tvb, offset, hf_index);
510 static int dissect_expansionTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
511 return dissect_ess_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ess_expansionTime);
516 dissect_ess_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
517 { proto_item *ti_tmp;
518 ti_tmp = proto_tree_add_item(tree, hf_index, tvb, offset>>8, 0, FALSE);
519 proto_item_append_text(ti_tmp, ": NULL");
524 static int dissect_none_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
525 return dissect_ess_NULL(TRUE, tvb, offset, pinfo, tree, hf_ess_none);
529 static const value_string MLReceiptPolicy_vals[] = {
532 { 2, "inAdditionTo" },
536 static const ber_choice MLReceiptPolicy_choice[] = {
537 { 0, BER_CLASS_CON, 0, 0, dissect_none_impl },
538 { 1, BER_CLASS_CON, 1, 0, dissect_insteadOf_impl },
539 { 2, BER_CLASS_CON, 2, 0, dissect_inAdditionTo_impl },
544 dissect_ess_MLReceiptPolicy(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
545 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
546 MLReceiptPolicy_choice, hf_index, ett_ess_MLReceiptPolicy);
550 static int dissect_mlReceiptPolicy(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
551 return dissect_ess_MLReceiptPolicy(FALSE, tvb, offset, pinfo, tree, hf_ess_mlReceiptPolicy);
554 static const ber_sequence MLData_sequence[] = {
555 { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_mailListIdentifier },
556 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_expansionTime },
557 { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_mlReceiptPolicy },
562 dissect_ess_MLData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
563 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
564 MLData_sequence, hf_index, ett_ess_MLData);
568 static int dissect_MLExpansionHistory_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
569 return dissect_ess_MLData(FALSE, tvb, offset, pinfo, tree, hf_ess_MLExpansionHistory_item);
572 static const ber_sequence MLExpansionHistory_sequence_of[1] = {
573 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_MLExpansionHistory_item },
577 dissect_ess_MLExpansionHistory(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
578 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
579 MLExpansionHistory_sequence_of, hf_index, ett_ess_MLExpansionHistory);
586 dissect_ess_Hash(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
587 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
592 static int dissect_certHash(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
593 return dissect_ess_Hash(FALSE, tvb, offset, pinfo, tree, hf_ess_certHash);
596 static const ber_sequence IssuerSerial_sequence[] = {
597 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuer },
598 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
603 dissect_ess_IssuerSerial(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
604 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
605 IssuerSerial_sequence, hf_index, ett_ess_IssuerSerial);
609 static int dissect_issuerSerial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
610 return dissect_ess_IssuerSerial(FALSE, tvb, offset, pinfo, tree, hf_ess_issuerSerial);
613 static const ber_sequence ESSCertID_sequence[] = {
614 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_certHash },
615 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuerSerial },
620 dissect_ess_ESSCertID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
621 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
622 ESSCertID_sequence, hf_index, ett_ess_ESSCertID);
626 static int dissect_certs_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
627 return dissect_ess_ESSCertID(FALSE, tvb, offset, pinfo, tree, hf_ess_certs_item);
630 static const ber_sequence SEQUNCE_OF_ESSCertID_sequence_of[1] = {
631 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certs_item },
635 dissect_ess_SEQUNCE_OF_ESSCertID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
636 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
637 SEQUNCE_OF_ESSCertID_sequence_of, hf_index, ett_ess_SEQUNCE_OF_ESSCertID);
641 static int dissect_certs(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
642 return dissect_ess_SEQUNCE_OF_ESSCertID(FALSE, tvb, offset, pinfo, tree, hf_ess_certs);
645 static const ber_sequence SEQUNCE_OF_PolicyInformation_sequence_of[1] = {
646 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_policies_item },
650 dissect_ess_SEQUNCE_OF_PolicyInformation(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
651 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
652 SEQUNCE_OF_PolicyInformation_sequence_of, hf_index, ett_ess_SEQUNCE_OF_PolicyInformation);
656 static int dissect_policies(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
657 return dissect_ess_SEQUNCE_OF_PolicyInformation(FALSE, tvb, offset, pinfo, tree, hf_ess_policies);
660 static const ber_sequence SigningCertificate_sequence[] = {
661 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certs },
662 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_policies },
667 dissect_ess_SigningCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
668 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
669 SigningCertificate_sequence, hf_index, ett_ess_SigningCertificate);
676 static void dissect_ReceiptRequest_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
677 dissect_ess_ReceiptRequest(FALSE, tvb, 0, pinfo, tree, hf_ess_ReceiptRequest_PDU);
679 static void dissect_ContentIdentifier_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
680 dissect_ess_ContentIdentifier(FALSE, tvb, 0, pinfo, tree, hf_ess_ContentIdentifier_PDU);
682 static void dissect_Receipt_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
683 dissect_ess_Receipt(FALSE, tvb, 0, pinfo, tree, hf_ess_Receipt_PDU);
685 static void dissect_ContentHints_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
686 dissect_ess_ContentHints(FALSE, tvb, 0, pinfo, tree, hf_ess_ContentHints_PDU);
688 static void dissect_MsgSigDigest_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
689 dissect_ess_MsgSigDigest(FALSE, tvb, 0, pinfo, tree, hf_ess_MsgSigDigest_PDU);
691 static void dissect_ContentReference_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
692 dissect_ess_ContentReference(FALSE, tvb, 0, pinfo, tree, hf_ess_ContentReference_PDU);
694 static void dissect_MLExpansionHistory_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
695 dissect_ess_MLExpansionHistory(FALSE, tvb, 0, pinfo, tree, hf_ess_MLExpansionHistory_PDU);
697 static void dissect_SigningCertificate_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
698 dissect_ess_SigningCertificate(FALSE, tvb, 0, pinfo, tree, hf_ess_SigningCertificate_PDU);
702 /*--- End of included file: packet-ess-fn.c ---*/
706 /*--- proto_register_ess ----------------------------------------------*/
707 void proto_register_ess(void) {
710 static hf_register_info hf[] = {
711 { &hf_ess_SecurityCategory_type_OID,
712 { "type", "ess.type_OID", FT_STRING, BASE_NONE, NULL, 0,
713 "Type of Security Category", HFILL }},
715 /*--- Included file: packet-ess-hfarr.c ---*/
717 { &hf_ess_ReceiptRequest_PDU,
718 { "ReceiptRequest", "ess.ReceiptRequest",
719 FT_NONE, BASE_NONE, NULL, 0,
720 "ReceiptRequest", HFILL }},
721 { &hf_ess_ContentIdentifier_PDU,
722 { "ContentIdentifier", "ess.ContentIdentifier",
723 FT_BYTES, BASE_HEX, NULL, 0,
724 "ContentIdentifier", HFILL }},
725 { &hf_ess_Receipt_PDU,
726 { "Receipt", "ess.Receipt",
727 FT_NONE, BASE_NONE, NULL, 0,
729 { &hf_ess_ContentHints_PDU,
730 { "ContentHints", "ess.ContentHints",
731 FT_NONE, BASE_NONE, NULL, 0,
732 "ContentHints", HFILL }},
733 { &hf_ess_MsgSigDigest_PDU,
734 { "MsgSigDigest", "ess.MsgSigDigest",
735 FT_BYTES, BASE_HEX, NULL, 0,
736 "MsgSigDigest", HFILL }},
737 { &hf_ess_ContentReference_PDU,
738 { "ContentReference", "ess.ContentReference",
739 FT_NONE, BASE_NONE, NULL, 0,
740 "ContentReference", HFILL }},
741 { &hf_ess_MLExpansionHistory_PDU,
742 { "MLExpansionHistory", "ess.MLExpansionHistory",
743 FT_NONE, BASE_NONE, NULL, 0,
744 "MLExpansionHistory", HFILL }},
745 { &hf_ess_SigningCertificate_PDU,
746 { "SigningCertificate", "ess.SigningCertificate",
747 FT_NONE, BASE_NONE, NULL, 0,
748 "SigningCertificate", HFILL }},
749 { &hf_ess_signedContentIdentifier,
750 { "signedContentIdentifier", "ess.signedContentIdentifier",
751 FT_BYTES, BASE_HEX, NULL, 0,
753 { &hf_ess_receiptsFrom,
754 { "receiptsFrom", "ess.receiptsFrom",
755 FT_UINT32, BASE_DEC, VALS(ReceiptsFrom_vals), 0,
756 "ReceiptRequest/receiptsFrom", HFILL }},
757 { &hf_ess_receiptsTo,
758 { "receiptsTo", "ess.receiptsTo",
759 FT_NONE, BASE_NONE, NULL, 0,
760 "ReceiptRequest/receiptsTo", HFILL }},
761 { &hf_ess_receiptsTo_item,
762 { "Item", "ess.receiptsTo_item",
763 FT_UINT32, BASE_DEC, NULL, 0,
764 "ReceiptRequest/receiptsTo/_item", HFILL }},
765 { &hf_ess_allOrFirstTier,
766 { "allOrFirstTier", "ess.allOrFirstTier",
767 FT_INT32, BASE_DEC, VALS(AllOrFirstTier_vals), 0,
768 "ReceiptsFrom/allOrFirstTier", HFILL }},
769 { &hf_ess_receiptList,
770 { "receiptList", "ess.receiptList",
771 FT_NONE, BASE_NONE, NULL, 0,
772 "ReceiptsFrom/receiptList", HFILL }},
773 { &hf_ess_receiptList_item,
774 { "Item", "ess.receiptList_item",
775 FT_UINT32, BASE_DEC, NULL, 0,
776 "ReceiptsFrom/receiptList/_item", HFILL }},
778 { "version", "ess.version",
779 FT_INT32, BASE_DEC, VALS(ESSVersion_vals), 0,
780 "Receipt/version", HFILL }},
781 { &hf_ess_contentType,
782 { "contentType", "ess.contentType",
783 FT_STRING, BASE_NONE, NULL, 0,
785 { &hf_ess_originatorSignatureValue,
786 { "originatorSignatureValue", "ess.originatorSignatureValue",
787 FT_BYTES, BASE_HEX, NULL, 0,
789 { &hf_ess_contentDescription,
790 { "contentDescription", "ess.contentDescription",
791 FT_STRING, BASE_NONE, NULL, 0,
792 "ContentHints/contentDescription", HFILL }},
794 { "pString", "ess.pString",
795 FT_STRING, BASE_NONE, NULL, 0,
796 "ESSPrivacyMark/pString", HFILL }},
797 { &hf_ess_utf8String,
798 { "utf8String", "ess.utf8String",
799 FT_STRING, BASE_NONE, NULL, 0,
800 "ESSPrivacyMark/utf8String", HFILL }},
801 { &hf_ess_SecurityCategories_item,
802 { "Item", "ess.SecurityCategories_item",
803 FT_NONE, BASE_NONE, NULL, 0,
804 "SecurityCategories/_item", HFILL }},
806 { "type", "ess.type",
807 FT_STRING, BASE_NONE, NULL, 0,
808 "SecurityCategory/type", HFILL }},
810 { "value", "ess.value",
811 FT_NONE, BASE_NONE, NULL, 0,
812 "SecurityCategory/value", HFILL }},
813 { &hf_ess_MLExpansionHistory_item,
814 { "Item", "ess.MLExpansionHistory_item",
815 FT_NONE, BASE_NONE, NULL, 0,
816 "MLExpansionHistory/_item", HFILL }},
817 { &hf_ess_mailListIdentifier,
818 { "mailListIdentifier", "ess.mailListIdentifier",
819 FT_UINT32, BASE_DEC, VALS(EntityIdentifier_vals), 0,
820 "MLData/mailListIdentifier", HFILL }},
821 { &hf_ess_expansionTime,
822 { "expansionTime", "ess.expansionTime",
823 FT_STRING, BASE_NONE, NULL, 0,
824 "MLData/expansionTime", HFILL }},
825 { &hf_ess_mlReceiptPolicy,
826 { "mlReceiptPolicy", "ess.mlReceiptPolicy",
827 FT_UINT32, BASE_DEC, VALS(MLReceiptPolicy_vals), 0,
828 "MLData/mlReceiptPolicy", HFILL }},
829 { &hf_ess_issuerAndSerialNumber,
830 { "issuerAndSerialNumber", "ess.issuerAndSerialNumber",
831 FT_NONE, BASE_NONE, NULL, 0,
832 "EntityIdentifier/issuerAndSerialNumber", HFILL }},
833 { &hf_ess_subjectKeyIdentifier,
834 { "subjectKeyIdentifier", "ess.subjectKeyIdentifier",
835 FT_BYTES, BASE_HEX, NULL, 0,
836 "EntityIdentifier/subjectKeyIdentifier", HFILL }},
838 { "none", "ess.none",
839 FT_NONE, BASE_NONE, NULL, 0,
840 "MLReceiptPolicy/none", HFILL }},
842 { "insteadOf", "ess.insteadOf",
843 FT_NONE, BASE_NONE, NULL, 0,
844 "MLReceiptPolicy/insteadOf", HFILL }},
845 { &hf_ess_insteadOf_item,
846 { "Item", "ess.insteadOf_item",
847 FT_UINT32, BASE_DEC, NULL, 0,
848 "MLReceiptPolicy/insteadOf/_item", HFILL }},
849 { &hf_ess_inAdditionTo,
850 { "inAdditionTo", "ess.inAdditionTo",
851 FT_NONE, BASE_NONE, NULL, 0,
852 "MLReceiptPolicy/inAdditionTo", HFILL }},
853 { &hf_ess_inAdditionTo_item,
854 { "Item", "ess.inAdditionTo_item",
855 FT_UINT32, BASE_DEC, NULL, 0,
856 "MLReceiptPolicy/inAdditionTo/_item", HFILL }},
858 { "certs", "ess.certs",
859 FT_NONE, BASE_NONE, NULL, 0,
860 "SigningCertificate/certs", HFILL }},
861 { &hf_ess_certs_item,
862 { "Item", "ess.certs_item",
863 FT_NONE, BASE_NONE, NULL, 0,
864 "SigningCertificate/certs/_item", HFILL }},
866 { "policies", "ess.policies",
867 FT_NONE, BASE_NONE, NULL, 0,
868 "SigningCertificate/policies", HFILL }},
869 { &hf_ess_policies_item,
870 { "Item", "ess.policies_item",
871 FT_NONE, BASE_NONE, NULL, 0,
872 "SigningCertificate/policies/_item", HFILL }},
874 { "certHash", "ess.certHash",
875 FT_BYTES, BASE_HEX, NULL, 0,
876 "ESSCertID/certHash", HFILL }},
877 { &hf_ess_issuerSerial,
878 { "issuerSerial", "ess.issuerSerial",
879 FT_NONE, BASE_NONE, NULL, 0,
880 "ESSCertID/issuerSerial", HFILL }},
882 { "issuer", "ess.issuer",
883 FT_UINT32, BASE_DEC, NULL, 0,
884 "IssuerSerial/issuer", HFILL }},
885 { &hf_ess_serialNumber,
886 { "serialNumber", "ess.serialNumber",
887 FT_INT32, BASE_DEC, NULL, 0,
888 "IssuerSerial/serialNumber", HFILL }},
890 /*--- End of included file: packet-ess-hfarr.c ---*/
894 /* List of subtrees */
895 static gint *ett[] = {
897 /*--- Included file: packet-ess-ettarr.c ---*/
899 &ett_ess_ReceiptRequest,
900 &ett_ess_SEQUNCE_OF_GeneralNames,
901 &ett_ess_ReceiptsFrom,
903 &ett_ess_ContentHints,
904 &ett_ess_ContentReference,
905 &ett_ess_ESSPrivacyMark,
906 &ett_ess_SecurityCategories,
907 &ett_ess_SecurityCategory,
908 &ett_ess_MLExpansionHistory,
910 &ett_ess_EntityIdentifier,
911 &ett_ess_MLReceiptPolicy,
912 &ett_ess_SigningCertificate,
913 &ett_ess_SEQUNCE_OF_ESSCertID,
914 &ett_ess_SEQUNCE_OF_PolicyInformation,
916 &ett_ess_IssuerSerial,
918 /*--- End of included file: packet-ess-ettarr.c ---*/
922 /* Register protocol */
923 proto_ess = proto_register_protocol(PNAME, PSNAME, PFNAME);
925 /* Register fields and subtrees */
926 proto_register_field_array(proto_ess, hf, array_length(hf));
927 proto_register_subtree_array(ett, array_length(ett));
932 /*--- proto_reg_handoff_ess -------------------------------------------*/
933 void proto_reg_handoff_ess(void) {
935 /*--- Included file: packet-ess-dis-tab.c ---*/
937 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.1", dissect_ReceiptRequest_PDU, proto_ess, "id-aa-receiptRequest");
938 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.7", dissect_ContentIdentifier_PDU, proto_ess, "id-aa-contentIdentifier");
939 register_ber_oid_dissector("1.2.840.113549.1.9.16.1.1", dissect_Receipt_PDU, proto_ess, "id-ct-receipt");
940 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.4", dissect_ContentHints_PDU, proto_ess, "id-aa-contentHint");
941 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.5", dissect_MsgSigDigest_PDU, proto_ess, "id-aa-msgSigDigest");
942 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.10", dissect_ContentReference_PDU, proto_ess, "id-aa-contentReference");
943 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.3", dissect_MLExpansionHistory_PDU, proto_ess, "id-aa-mlExpandHistory");
944 register_ber_oid_dissector("1.2.840.113549.1.9.16.2.12", dissect_SigningCertificate_PDU, proto_ess, "id-aa-signingCertificate");
947 /*--- End of included file: packet-ess-dis-tab.c ---*/