Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
[metze/wireshark/wip.git] / epan / dissectors / packet-ess.c
1 /* Do not modify this file. Changes will be overwritten.                      */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler       */
3 /* packet-ess.c                                                               */
4 /* ../../tools/asn2wrs.py -b -k -C -p ess -c ./ess.cnf -s ./packet-ess-template -D . -O ../../epan/dissectors ExtendedSecurityServices.asn */
5
6 /* Input file: packet-ess-template.c */
7
8 #line 1 "../../asn1/ess/packet-ess-template.c"
9 /* packet-ess.c
10  * Routines for RFC 2634 and RFC 5035 Extended Security Services packet
11  * dissection
12  *   Ronnie Sahlberg 2004
13  *   Stig Bjorlykke 2010
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
19  * This program is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU General Public License
21  * as published by the Free Software Foundation; either version 2
22  * of the License, or (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program; if not, write to the Free Software
31  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32  */
33
34 #include "config.h"
35
36 #include <glib.h>
37 #include <string.h>
38
39 #include <epan/packet.h>
40 #include <epan/asn1.h>
41 #include <epan/prefs.h>
42 #include <epan/uat.h>
43
44 #include "packet-ber.h"
45 #include "packet-ess.h"
46 #include "packet-cms.h"
47 #include "packet-x509ce.h"
48 #include "packet-x509af.h"
49
50 #define PNAME  "Extended Security Services"
51 #define PSNAME "ESS"
52 #define PFNAME "ess"
53
54 void proto_register_ess(void);
55 void proto_reg_handoff_ess(void);
56
57 typedef struct _ess_category_attributes_t {
58    char *oid;
59    guint lacv;
60    char *name;
61 } ess_category_attributes_t;
62
63 static ess_category_attributes_t *ess_category_attributes;
64 static guint num_ess_category_attributes;
65
66 /* Initialize the protocol and registered fields */
67 static int proto_ess = -1;
68 static int hf_ess_SecurityCategory_type_OID = -1;
69 static int hf_ess_Category_attribute = -1;
70
71 static gint ett_Category_attributes = -1;
72
73
74 /*--- Included file: packet-ess-hf.c ---*/
75 #line 1 "../../asn1/ess/packet-ess-hf.c"
76 static int hf_ess_ReceiptRequest_PDU = -1;        /* ReceiptRequest */
77 static int hf_ess_ContentIdentifier_PDU = -1;     /* ContentIdentifier */
78 static int hf_ess_Receipt_PDU = -1;               /* Receipt */
79 static int hf_ess_ContentHints_PDU = -1;          /* ContentHints */
80 static int hf_ess_MsgSigDigest_PDU = -1;          /* MsgSigDigest */
81 static int hf_ess_ContentReference_PDU = -1;      /* ContentReference */
82 static int hf_ess_ess_ESSSecurityLabel_PDU = -1;  /* ESSSecurityLabel */
83 static int hf_ess_RestrictiveTag_PDU = -1;        /* RestrictiveTag */
84 static int hf_ess_EnumeratedTag_PDU = -1;         /* EnumeratedTag */
85 static int hf_ess_PermissiveTag_PDU = -1;         /* PermissiveTag */
86 static int hf_ess_InformativeTag_PDU = -1;        /* InformativeTag */
87 static int hf_ess_EquivalentLabels_PDU = -1;      /* EquivalentLabels */
88 static int hf_ess_MLExpansionHistory_PDU = -1;    /* MLExpansionHistory */
89 static int hf_ess_SigningCertificate_PDU = -1;    /* SigningCertificate */
90 static int hf_ess_SigningCertificateV2_PDU = -1;  /* SigningCertificateV2 */
91 static int hf_ess_signedContentIdentifier = -1;   /* ContentIdentifier */
92 static int hf_ess_receiptsFrom = -1;              /* ReceiptsFrom */
93 static int hf_ess_receiptsTo = -1;                /* SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames */
94 static int hf_ess_receiptsTo_item = -1;           /* GeneralNames */
95 static int hf_ess_allOrFirstTier = -1;            /* AllOrFirstTier */
96 static int hf_ess_receiptList = -1;               /* SEQUENCE_OF_GeneralNames */
97 static int hf_ess_receiptList_item = -1;          /* GeneralNames */
98 static int hf_ess_version = -1;                   /* ESSVersion */
99 static int hf_ess_contentType = -1;               /* ContentType */
100 static int hf_ess_originatorSignatureValue = -1;  /* OCTET_STRING */
101 static int hf_ess_contentDescription = -1;        /* UTF8String_SIZE_1_MAX */
102 static int hf_ess_security_policy_identifier = -1;  /* SecurityPolicyIdentifier */
103 static int hf_ess_security_classification = -1;   /* SecurityClassification */
104 static int hf_ess_privacy_mark = -1;              /* ESSPrivacyMark */
105 static int hf_ess_security_categories = -1;       /* SecurityCategories */
106 static int hf_ess_pString = -1;                   /* PrintableString_SIZE_1_ub_privacy_mark_length */
107 static int hf_ess_utf8String = -1;                /* UTF8String_SIZE_1_MAX */
108 static int hf_ess_SecurityCategories_item = -1;   /* SecurityCategory */
109 static int hf_ess_type = -1;                      /* T_type */
110 static int hf_ess_value = -1;                     /* T_value */
111 static int hf_ess_restrictiveTagName = -1;        /* T_restrictiveTagName */
112 static int hf_ess_restrictiveAttributeFlags = -1;  /* T_restrictiveAttributeFlags */
113 static int hf_ess_tagName = -1;                   /* T_tagName */
114 static int hf_ess_attributeList = -1;             /* SET_OF_SecurityAttribute */
115 static int hf_ess_attributeList_item = -1;        /* SecurityAttribute */
116 static int hf_ess_permissiveTagName = -1;         /* T_permissiveTagName */
117 static int hf_ess_permissiveAttributeFlags = -1;  /* T_permissiveAttributeFlags */
118 static int hf_ess_informativeTagName = -1;        /* T_informativeTagName */
119 static int hf_ess_attributes = -1;                /* FreeFormField */
120 static int hf_ess_informativeAttributeFlags = -1;  /* T_informativeAttributeFlags */
121 static int hf_ess_securityAttributes = -1;        /* SET_OF_SecurityAttribute */
122 static int hf_ess_securityAttributes_item = -1;   /* SecurityAttribute */
123 static int hf_ess_EquivalentLabels_item = -1;     /* ESSSecurityLabel */
124 static int hf_ess_MLExpansionHistory_item = -1;   /* MLData */
125 static int hf_ess_mailListIdentifier = -1;        /* EntityIdentifier */
126 static int hf_ess_expansionTime = -1;             /* GeneralizedTime */
127 static int hf_ess_mlReceiptPolicy = -1;           /* MLReceiptPolicy */
128 static int hf_ess_issuerAndSerialNumber = -1;     /* IssuerAndSerialNumber */
129 static int hf_ess_subjectKeyIdentifier = -1;      /* SubjectKeyIdentifier */
130 static int hf_ess_none = -1;                      /* NULL */
131 static int hf_ess_insteadOf = -1;                 /* SEQUENCE_SIZE_1_MAX_OF_GeneralNames */
132 static int hf_ess_insteadOf_item = -1;            /* GeneralNames */
133 static int hf_ess_inAdditionTo = -1;              /* SEQUENCE_SIZE_1_MAX_OF_GeneralNames */
134 static int hf_ess_inAdditionTo_item = -1;         /* GeneralNames */
135 static int hf_ess_certs = -1;                     /* SEQUENCE_OF_ESSCertID */
136 static int hf_ess_certs_item = -1;                /* ESSCertID */
137 static int hf_ess_policies = -1;                  /* SEQUENCE_OF_PolicyInformation */
138 static int hf_ess_policies_item = -1;             /* PolicyInformation */
139 static int hf_ess_certsV2 = -1;                   /* SEQUENCE_OF_ESSCertIDv2 */
140 static int hf_ess_certsV2_item = -1;              /* ESSCertIDv2 */
141 static int hf_ess_hashAlgorithm = -1;             /* AlgorithmIdentifier */
142 static int hf_ess_certHash = -1;                  /* Hash */
143 static int hf_ess_issuerSerial = -1;              /* IssuerSerial */
144 static int hf_ess_issuer = -1;                    /* GeneralNames */
145 static int hf_ess_serialNumber = -1;              /* CertificateSerialNumber */
146
147 /*--- End of included file: packet-ess-hf.c ---*/
148 #line 66 "../../asn1/ess/packet-ess-template.c"
149
150
151 /*--- Included file: packet-ess-val.h ---*/
152 #line 1 "../../asn1/ess/packet-ess-val.h"
153 #define ub_receiptsTo                  16
154 #define id_aa_receiptRequest           "1.2.840.113549.1.9.16.2.1"
155 #define id_aa_contentIdentifier        "1.2.840.113549.1.9.16.2.7"
156 #define id_ct_receipt                  "1.2.840.113549.1.9.16.1.1"
157 #define id_aa_contentHint              "1.2.840.113549.1.9.16.2.4"
158 #define id_aa_msgSigDigest             "1.2.840.113549.1.9.16.2.5"
159 #define id_aa_contentReference         "1.2.840.113549.1.9.16.2.10"
160 #define id_aa_securityLabel            "1.2.840.113549.1.9.16.2.2"
161 #define ub_integer_options             256
162 #define ub_privacy_mark_length         128
163 #define ub_security_categories         64
164 #define id_aa_equivalentLabels         "1.2.840.113549.1.9.16.2.9"
165 #define id_aa_mlExpandHistory          "1.2.840.113549.1.9.16.2.3"
166 #define ub_ml_expansion_history        64
167 #define id_aa_signingCertificate       "1.2.840.113549.1.9.16.2.12"
168 #define id_aa_signingCertificateV2     "1.2.840.113549.1.9.16.2.47"
169 #define id_sha256                      "2.16.840.1.101.3.4.2.1"
170
171 /*--- End of included file: packet-ess-val.h ---*/
172 #line 68 "../../asn1/ess/packet-ess-template.c"
173
174 /* Initialize the subtree pointers */
175
176 /*--- Included file: packet-ess-ett.c ---*/
177 #line 1 "../../asn1/ess/packet-ess-ett.c"
178 static gint ett_ess_ReceiptRequest = -1;
179 static gint ett_ess_SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames = -1;
180 static gint ett_ess_ReceiptsFrom = -1;
181 static gint ett_ess_SEQUENCE_OF_GeneralNames = -1;
182 static gint ett_ess_Receipt = -1;
183 static gint ett_ess_ContentHints = -1;
184 static gint ett_ess_ContentReference = -1;
185 static gint ett_ess_ESSSecurityLabel = -1;
186 static gint ett_ess_ESSPrivacyMark = -1;
187 static gint ett_ess_SecurityCategories = -1;
188 static gint ett_ess_SecurityCategory = -1;
189 static gint ett_ess_RestrictiveTag = -1;
190 static gint ett_ess_EnumeratedTag = -1;
191 static gint ett_ess_SET_OF_SecurityAttribute = -1;
192 static gint ett_ess_PermissiveTag = -1;
193 static gint ett_ess_InformativeTag = -1;
194 static gint ett_ess_FreeFormField = -1;
195 static gint ett_ess_EquivalentLabels = -1;
196 static gint ett_ess_MLExpansionHistory = -1;
197 static gint ett_ess_MLData = -1;
198 static gint ett_ess_EntityIdentifier = -1;
199 static gint ett_ess_MLReceiptPolicy = -1;
200 static gint ett_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames = -1;
201 static gint ett_ess_SigningCertificate = -1;
202 static gint ett_ess_SEQUENCE_OF_ESSCertID = -1;
203 static gint ett_ess_SEQUENCE_OF_PolicyInformation = -1;
204 static gint ett_ess_SigningCertificateV2 = -1;
205 static gint ett_ess_SEQUENCE_OF_ESSCertIDv2 = -1;
206 static gint ett_ess_ESSCertIDv2 = -1;
207 static gint ett_ess_ESSCertID = -1;
208 static gint ett_ess_IssuerSerial = -1;
209
210 /*--- End of included file: packet-ess-ett.c ---*/
211 #line 71 "../../asn1/ess/packet-ess-template.c"
212
213 static const char *object_identifier_id;
214
215 UAT_CSTRING_CB_DEF(ess_category_attributes, oid, ess_category_attributes_t)
216 UAT_DEC_CB_DEF(ess_category_attributes, lacv, ess_category_attributes_t)
217 UAT_CSTRING_CB_DEF(ess_category_attributes, name, ess_category_attributes_t)
218
219 static void *
220 ess_copy_cb(void *dest, const void *orig, size_t len _U_)
221 {
222   ess_category_attributes_t *u = (ess_category_attributes_t *)dest;
223   const ess_category_attributes_t *o = (const ess_category_attributes_t *)orig;
224
225   u->oid  = g_strdup(o->oid);
226   u->lacv = o->lacv;
227   u->name = g_strdup(o->name);
228
229   return dest;
230 }
231
232 static void
233 ess_free_cb(void *r)
234 {
235   ess_category_attributes_t *u = (ess_category_attributes_t *)r;
236
237   g_free(u->oid);
238   g_free(u->name);
239 }
240
241 static void
242 ess_dissect_attribute (guint32 value, asn1_ctx_t *actx)
243 {
244   guint i;
245
246   for (i = 0; i < num_ess_category_attributes; i++) {
247     ess_category_attributes_t *u = &(ess_category_attributes[i]);
248
249     if ((strcmp (u->oid, object_identifier_id) == 0) &&
250         (u->lacv == value))
251     {
252        proto_item_append_text (actx->created_item, " (%s)", u->name);
253        break;
254     }
255   }
256 }
257
258 static void
259 ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
260 {
261   proto_tree *tree;
262   guint8 *value;
263   guint i;
264
265   tree = proto_item_add_subtree (actx->created_item, ett_Category_attributes);
266   value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, tvb_length (tvb));
267
268   for (i = 0; i < num_ess_category_attributes; i++) {
269     ess_category_attributes_t *u = &(ess_category_attributes[i]);
270
271     if ((strcmp (u->oid, object_identifier_id) == 0) &&
272         ((u->lacv / 8) < tvb_length (tvb)) &&
273         (value[u->lacv / 8] & (1 << (7 - (u->lacv % 8)))))
274     {
275        proto_tree_add_string_format (tree, hf_ess_Category_attribute, tvb,
276                                      u->lacv / 8, 1, u->name,
277                                      "%s (%d)", u->name, u->lacv);
278     }
279   }
280 }
281
282
283 /*--- Included file: packet-ess-fn.c ---*/
284 #line 1 "../../asn1/ess/packet-ess-fn.c"
285
286
287 static int
288 dissect_ess_ContentIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
289   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
290                                        NULL);
291
292   return offset;
293 }
294
295
296 static const value_string ess_AllOrFirstTier_vals[] = {
297   {   0, "allReceipts" },
298   {   1, "firstTierRecipients" },
299   { 0, NULL }
300 };
301
302
303 static int
304 dissect_ess_AllOrFirstTier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
305   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
306                                                 NULL);
307
308   return offset;
309 }
310
311
312 static const ber_sequence_t SEQUENCE_OF_GeneralNames_sequence_of[1] = {
313   { &hf_ess_receiptList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
314 };
315
316 static int
317 dissect_ess_SEQUENCE_OF_GeneralNames(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
318   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
319                                       SEQUENCE_OF_GeneralNames_sequence_of, hf_index, ett_ess_SEQUENCE_OF_GeneralNames);
320
321   return offset;
322 }
323
324
325 static const value_string ess_ReceiptsFrom_vals[] = {
326   {   0, "allOrFirstTier" },
327   {   1, "receiptList" },
328   { 0, NULL }
329 };
330
331 static const ber_choice_t ReceiptsFrom_choice[] = {
332   {   0, &hf_ess_allOrFirstTier  , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ess_AllOrFirstTier },
333   {   1, &hf_ess_receiptList     , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ess_SEQUENCE_OF_GeneralNames },
334   { 0, NULL, 0, 0, 0, NULL }
335 };
336
337 static int
338 dissect_ess_ReceiptsFrom(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
339   offset = dissect_ber_choice(actx, tree, tvb, offset,
340                                  ReceiptsFrom_choice, hf_index, ett_ess_ReceiptsFrom,
341                                  NULL);
342
343   return offset;
344 }
345
346
347 static const ber_sequence_t SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames_sequence_of[1] = {
348   { &hf_ess_receiptsTo_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
349 };
350
351 static int
352 dissect_ess_SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
353   offset = dissect_ber_constrained_sequence_of(implicit_tag, actx, tree, tvb, offset,
354                                                   1, ub_receiptsTo, SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames_sequence_of, hf_index, ett_ess_SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames);
355
356   return offset;
357 }
358
359
360 static const ber_sequence_t ReceiptRequest_sequence[] = {
361   { &hf_ess_signedContentIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_ContentIdentifier },
362   { &hf_ess_receiptsFrom    , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ess_ReceiptsFrom },
363   { &hf_ess_receiptsTo      , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames },
364   { NULL, 0, 0, 0, NULL }
365 };
366
367 static int
368 dissect_ess_ReceiptRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
369   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
370                                    ReceiptRequest_sequence, hf_index, ett_ess_ReceiptRequest);
371
372   return offset;
373 }
374
375
376 static const value_string ess_ESSVersion_vals[] = {
377   {   1, "v1" },
378   { 0, NULL }
379 };
380
381
382 static int
383 dissect_ess_ESSVersion(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
384   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
385                                                 NULL);
386
387   return offset;
388 }
389
390
391
392 static int
393 dissect_ess_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
394   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
395                                        NULL);
396
397   return offset;
398 }
399
400
401 static const ber_sequence_t Receipt_sequence[] = {
402   { &hf_ess_version         , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ess_ESSVersion },
403   { &hf_ess_contentType     , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
404   { &hf_ess_signedContentIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_ContentIdentifier },
405   { &hf_ess_originatorSignatureValue, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_OCTET_STRING },
406   { NULL, 0, 0, 0, NULL }
407 };
408
409 static int
410 dissect_ess_Receipt(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
411 #line 100 "../../asn1/ess/ess.cnf"
412   col_set_str(actx->pinfo->cinfo, COL_PROTOCOL, "ESS");
413   col_set_str(actx->pinfo->cinfo, COL_INFO, "Signed Receipt");
414     offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
415                                    Receipt_sequence, hf_index, ett_ess_Receipt);
416
417
418
419
420   return offset;
421 }
422
423
424
425 static int
426 dissect_ess_UTF8String_SIZE_1_MAX(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
427   offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
428                                                         actx, tree, tvb, offset,
429                                                         1, NO_BOUND, hf_index, NULL);
430
431   return offset;
432 }
433
434
435 static const ber_sequence_t ContentHints_sequence[] = {
436   { &hf_ess_contentDescription, BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_UTF8String_SIZE_1_MAX },
437   { &hf_ess_contentType     , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
438   { NULL, 0, 0, 0, NULL }
439 };
440
441 static int
442 dissect_ess_ContentHints(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
443   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
444                                    ContentHints_sequence, hf_index, ett_ess_ContentHints);
445
446   return offset;
447 }
448
449
450
451 static int
452 dissect_ess_MsgSigDigest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
453   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
454                                        NULL);
455
456   return offset;
457 }
458
459
460 static const ber_sequence_t ContentReference_sequence[] = {
461   { &hf_ess_contentType     , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_cms_ContentType },
462   { &hf_ess_signedContentIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_ContentIdentifier },
463   { &hf_ess_originatorSignatureValue, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_OCTET_STRING },
464   { NULL, 0, 0, 0, NULL }
465 };
466
467 static int
468 dissect_ess_ContentReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
469   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
470                                    ContentReference_sequence, hf_index, ett_ess_ContentReference);
471
472   return offset;
473 }
474
475
476
477 static int
478 dissect_ess_SecurityPolicyIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
479   offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
480
481   return offset;
482 }
483
484
485 static const value_string ess_SecurityClassification_vals[] = {
486   {   0, "unmarked" },
487   {   1, "unclassified" },
488   {   2, "restricted" },
489   {   3, "confidential" },
490   {   4, "secret" },
491   {   5, "top-secret" },
492   { 0, NULL }
493 };
494
495
496 static int
497 dissect_ess_SecurityClassification(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
498   offset = dissect_ber_constrained_integer(implicit_tag, actx, tree, tvb, offset,
499                                                             0U, ub_integer_options, hf_index, NULL);
500
501   return offset;
502 }
503
504
505
506 static int
507 dissect_ess_PrintableString_SIZE_1_ub_privacy_mark_length(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
508   offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString,
509                                                         actx, tree, tvb, offset,
510                                                         1, ub_privacy_mark_length, hf_index, NULL);
511
512   return offset;
513 }
514
515
516 static const value_string ess_ESSPrivacyMark_vals[] = {
517   {   0, "pString" },
518   {   1, "utf8String" },
519   { 0, NULL }
520 };
521
522 static const ber_choice_t ESSPrivacyMark_choice[] = {
523   {   0, &hf_ess_pString         , BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_ess_PrintableString_SIZE_1_ub_privacy_mark_length },
524   {   1, &hf_ess_utf8String      , BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_ess_UTF8String_SIZE_1_MAX },
525   { 0, NULL, 0, 0, 0, NULL }
526 };
527
528 static int
529 dissect_ess_ESSPrivacyMark(gboolean 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_choice(actx, tree, tvb, offset,
531                                  ESSPrivacyMark_choice, hf_index, ett_ess_ESSPrivacyMark,
532                                  NULL);
533
534   return offset;
535 }
536
537
538
539 static int
540 dissect_ess_T_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
541   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_ess_SecurityCategory_type_OID, &object_identifier_id);
542
543   return offset;
544 }
545
546
547
548 static int
549 dissect_ess_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
550 #line 49 "../../asn1/ess/ess.cnf"
551   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
552
553
554
555   return offset;
556 }
557
558
559 static const ber_sequence_t SecurityCategory_sequence[] = {
560   { &hf_ess_type            , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ess_T_type },
561   { &hf_ess_value           , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ess_T_value },
562   { NULL, 0, 0, 0, NULL }
563 };
564
565 static int
566 dissect_ess_SecurityCategory(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
567   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
568                                    SecurityCategory_sequence, hf_index, ett_ess_SecurityCategory);
569
570   return offset;
571 }
572
573
574 static const ber_sequence_t SecurityCategories_set_of[1] = {
575   { &hf_ess_SecurityCategories_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_SecurityCategory },
576 };
577
578 static int
579 dissect_ess_SecurityCategories(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
580   offset = dissect_ber_constrained_set_of(implicit_tag, actx, tree, tvb, offset,
581                                              1, ub_security_categories, SecurityCategories_set_of, hf_index, ett_ess_SecurityCategories);
582
583   return offset;
584 }
585
586
587 static const ber_sequence_t ESSSecurityLabel_set[] = {
588   { &hf_ess_security_policy_identifier, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ess_SecurityPolicyIdentifier },
589   { &hf_ess_security_classification, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_SecurityClassification },
590   { &hf_ess_privacy_mark    , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ess_ESSPrivacyMark },
591   { &hf_ess_security_categories, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_SecurityCategories },
592   { NULL, 0, 0, 0, NULL }
593 };
594
595 static int
596 dissect_ess_ESSSecurityLabel(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
597   offset = dissect_ber_set(implicit_tag, actx, tree, tvb, offset,
598                               ESSSecurityLabel_set, hf_index, ett_ess_ESSSecurityLabel);
599
600   return offset;
601 }
602
603
604
605 static int
606 dissect_ess_T_restrictiveTagName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
607   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
608
609   return offset;
610 }
611
612
613
614 static int
615 dissect_ess_T_restrictiveAttributeFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
616 #line 76 "../../asn1/ess/ess.cnf"
617   tvbuff_t *attributes;
618
619     offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
620                                     NULL, hf_index, -1,
621                                     &attributes);
622
623   ess_dissect_attribute_flags (attributes, actx);
624
625
626
627   return offset;
628 }
629
630
631 static const ber_sequence_t RestrictiveTag_sequence[] = {
632   { &hf_ess_restrictiveTagName, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ess_T_restrictiveTagName },
633   { &hf_ess_restrictiveAttributeFlags, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_T_restrictiveAttributeFlags },
634   { NULL, 0, 0, 0, NULL }
635 };
636
637 static int
638 dissect_ess_RestrictiveTag(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
639   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
640                                    RestrictiveTag_sequence, hf_index, ett_ess_RestrictiveTag);
641
642   return offset;
643 }
644
645
646
647 static int
648 dissect_ess_T_tagName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
649   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
650
651   return offset;
652 }
653
654
655
656 static int
657 dissect_ess_SecurityAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
658 #line 67 "../../asn1/ess/ess.cnf"
659   guint32 attribute;
660
661     offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
662                                                 &attribute);
663
664   ess_dissect_attribute (attribute, actx);
665
666
667
668   return offset;
669 }
670
671
672 static const ber_sequence_t SET_OF_SecurityAttribute_set_of[1] = {
673   { &hf_ess_attributeList_item, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_ess_SecurityAttribute },
674 };
675
676 static int
677 dissect_ess_SET_OF_SecurityAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
678   offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
679                                  SET_OF_SecurityAttribute_set_of, hf_index, ett_ess_SET_OF_SecurityAttribute);
680
681   return offset;
682 }
683
684
685 static const ber_sequence_t EnumeratedTag_sequence[] = {
686   { &hf_ess_tagName         , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ess_T_tagName },
687   { &hf_ess_attributeList   , BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ess_SET_OF_SecurityAttribute },
688   { NULL, 0, 0, 0, NULL }
689 };
690
691 static int
692 dissect_ess_EnumeratedTag(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
693   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
694                                    EnumeratedTag_sequence, hf_index, ett_ess_EnumeratedTag);
695
696   return offset;
697 }
698
699
700
701 static int
702 dissect_ess_T_permissiveTagName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
703   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
704
705   return offset;
706 }
707
708
709
710 static int
711 dissect_ess_T_permissiveAttributeFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
712 #line 85 "../../asn1/ess/ess.cnf"
713   tvbuff_t *attributes;
714
715     offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
716                                     NULL, hf_index, -1,
717                                     &attributes);
718
719   ess_dissect_attribute_flags (attributes, actx);
720
721
722
723   return offset;
724 }
725
726
727 static const ber_sequence_t PermissiveTag_sequence[] = {
728   { &hf_ess_permissiveTagName, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ess_T_permissiveTagName },
729   { &hf_ess_permissiveAttributeFlags, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_T_permissiveAttributeFlags },
730   { NULL, 0, 0, 0, NULL }
731 };
732
733 static int
734 dissect_ess_PermissiveTag(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
735   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
736                                    PermissiveTag_sequence, hf_index, ett_ess_PermissiveTag);
737
738   return offset;
739 }
740
741
742
743 static int
744 dissect_ess_T_informativeTagName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
745   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
746
747   return offset;
748 }
749
750
751
752 static int
753 dissect_ess_T_informativeAttributeFlags(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
754 #line 94 "../../asn1/ess/ess.cnf"
755   tvbuff_t *attributes;
756
757     offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
758                                     NULL, hf_index, -1,
759                                     &attributes);
760
761   ess_dissect_attribute_flags (attributes, actx);
762
763
764
765   return offset;
766 }
767
768
769 static const value_string ess_FreeFormField_vals[] = {
770   {   0, "bitSetAttributes" },
771   {   1, "securityAttributes" },
772   { 0, NULL }
773 };
774
775 static const ber_choice_t FreeFormField_choice[] = {
776   {   0, &hf_ess_informativeAttributeFlags, BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_T_informativeAttributeFlags },
777   {   1, &hf_ess_securityAttributes, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ess_SET_OF_SecurityAttribute },
778   { 0, NULL, 0, 0, 0, NULL }
779 };
780
781 static int
782 dissect_ess_FreeFormField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
783   offset = dissect_ber_choice(actx, tree, tvb, offset,
784                                  FreeFormField_choice, hf_index, ett_ess_FreeFormField,
785                                  NULL);
786
787   return offset;
788 }
789
790
791 static const ber_sequence_t InformativeTag_sequence[] = {
792   { &hf_ess_informativeTagName, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ess_T_informativeTagName },
793   { &hf_ess_attributes      , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ess_FreeFormField },
794   { NULL, 0, 0, 0, NULL }
795 };
796
797 static int
798 dissect_ess_InformativeTag(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
799   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
800                                    InformativeTag_sequence, hf_index, ett_ess_InformativeTag);
801
802   return offset;
803 }
804
805
806 static const ber_sequence_t EquivalentLabels_sequence_of[1] = {
807   { &hf_ess_EquivalentLabels_item, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ess_ESSSecurityLabel },
808 };
809
810 static int
811 dissect_ess_EquivalentLabels(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
812   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
813                                       EquivalentLabels_sequence_of, hf_index, ett_ess_EquivalentLabels);
814
815   return offset;
816 }
817
818
819 static const value_string ess_EntityIdentifier_vals[] = {
820   {   0, "issuerAndSerialNumber" },
821   {   1, "subjectKeyIdentifier" },
822   { 0, NULL }
823 };
824
825 static const ber_choice_t EntityIdentifier_choice[] = {
826   {   0, &hf_ess_issuerAndSerialNumber, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_cms_IssuerAndSerialNumber },
827   {   1, &hf_ess_subjectKeyIdentifier, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_x509ce_SubjectKeyIdentifier },
828   { 0, NULL, 0, 0, 0, NULL }
829 };
830
831 static int
832 dissect_ess_EntityIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
833   offset = dissect_ber_choice(actx, tree, tvb, offset,
834                                  EntityIdentifier_choice, hf_index, ett_ess_EntityIdentifier,
835                                  NULL);
836
837   return offset;
838 }
839
840
841
842 static int
843 dissect_ess_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
844   offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
845
846   return offset;
847 }
848
849
850
851 static int
852 dissect_ess_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
853   offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
854
855   return offset;
856 }
857
858
859 static const ber_sequence_t SEQUENCE_SIZE_1_MAX_OF_GeneralNames_sequence_of[1] = {
860   { &hf_ess_insteadOf_item  , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
861 };
862
863 static int
864 dissect_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
865   offset = dissect_ber_constrained_sequence_of(implicit_tag, actx, tree, tvb, offset,
866                                                   1, NO_BOUND, SEQUENCE_SIZE_1_MAX_OF_GeneralNames_sequence_of, hf_index, ett_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames);
867
868   return offset;
869 }
870
871
872 static const value_string ess_MLReceiptPolicy_vals[] = {
873   {   0, "none" },
874   {   1, "insteadOf" },
875   {   2, "inAdditionTo" },
876   { 0, NULL }
877 };
878
879 static const ber_choice_t MLReceiptPolicy_choice[] = {
880   {   0, &hf_ess_none            , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ess_NULL },
881   {   1, &hf_ess_insteadOf       , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames },
882   {   2, &hf_ess_inAdditionTo    , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames },
883   { 0, NULL, 0, 0, 0, NULL }
884 };
885
886 static int
887 dissect_ess_MLReceiptPolicy(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
888   offset = dissect_ber_choice(actx, tree, tvb, offset,
889                                  MLReceiptPolicy_choice, hf_index, ett_ess_MLReceiptPolicy,
890                                  NULL);
891
892   return offset;
893 }
894
895
896 static const ber_sequence_t MLData_sequence[] = {
897   { &hf_ess_mailListIdentifier, BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ess_EntityIdentifier },
898   { &hf_ess_expansionTime   , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ess_GeneralizedTime },
899   { &hf_ess_mlReceiptPolicy , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ess_MLReceiptPolicy },
900   { NULL, 0, 0, 0, NULL }
901 };
902
903 static int
904 dissect_ess_MLData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
905   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
906                                    MLData_sequence, hf_index, ett_ess_MLData);
907
908   return offset;
909 }
910
911
912 static const ber_sequence_t MLExpansionHistory_sequence_of[1] = {
913   { &hf_ess_MLExpansionHistory_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_MLData },
914 };
915
916 static int
917 dissect_ess_MLExpansionHistory(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
918   offset = dissect_ber_constrained_sequence_of(implicit_tag, actx, tree, tvb, offset,
919                                                   1, ub_ml_expansion_history, MLExpansionHistory_sequence_of, hf_index, ett_ess_MLExpansionHistory);
920
921   return offset;
922 }
923
924
925
926 static int
927 dissect_ess_Hash(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
928   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
929                                        NULL);
930
931   return offset;
932 }
933
934
935 static const ber_sequence_t IssuerSerial_sequence[] = {
936   { &hf_ess_issuer          , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
937   { &hf_ess_serialNumber    , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_x509af_CertificateSerialNumber },
938   { NULL, 0, 0, 0, NULL }
939 };
940
941 static int
942 dissect_ess_IssuerSerial(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
943   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
944                                    IssuerSerial_sequence, hf_index, ett_ess_IssuerSerial);
945
946   return offset;
947 }
948
949
950 static const ber_sequence_t ESSCertID_sequence[] = {
951   { &hf_ess_certHash        , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_Hash },
952   { &hf_ess_issuerSerial    , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_IssuerSerial },
953   { NULL, 0, 0, 0, NULL }
954 };
955
956 static int
957 dissect_ess_ESSCertID(gboolean 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_sequence(implicit_tag, actx, tree, tvb, offset,
959                                    ESSCertID_sequence, hf_index, ett_ess_ESSCertID);
960
961   return offset;
962 }
963
964
965 static const ber_sequence_t SEQUENCE_OF_ESSCertID_sequence_of[1] = {
966   { &hf_ess_certs_item      , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_ESSCertID },
967 };
968
969 static int
970 dissect_ess_SEQUENCE_OF_ESSCertID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
971   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
972                                       SEQUENCE_OF_ESSCertID_sequence_of, hf_index, ett_ess_SEQUENCE_OF_ESSCertID);
973
974   return offset;
975 }
976
977
978 static const ber_sequence_t SEQUENCE_OF_PolicyInformation_sequence_of[1] = {
979   { &hf_ess_policies_item   , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_PolicyInformation },
980 };
981
982 static int
983 dissect_ess_SEQUENCE_OF_PolicyInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
984   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
985                                       SEQUENCE_OF_PolicyInformation_sequence_of, hf_index, ett_ess_SEQUENCE_OF_PolicyInformation);
986
987   return offset;
988 }
989
990
991 static const ber_sequence_t SigningCertificate_sequence[] = {
992   { &hf_ess_certs           , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_SEQUENCE_OF_ESSCertID },
993   { &hf_ess_policies        , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_SEQUENCE_OF_PolicyInformation },
994   { NULL, 0, 0, 0, NULL }
995 };
996
997 static int
998 dissect_ess_SigningCertificate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
999   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1000                                    SigningCertificate_sequence, hf_index, ett_ess_SigningCertificate);
1001
1002   return offset;
1003 }
1004
1005
1006 static const ber_sequence_t ESSCertIDv2_sequence[] = {
1007   { &hf_ess_hashAlgorithm   , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
1008   { &hf_ess_certHash        , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ess_Hash },
1009   { &hf_ess_issuerSerial    , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_IssuerSerial },
1010   { NULL, 0, 0, 0, NULL }
1011 };
1012
1013 static int
1014 dissect_ess_ESSCertIDv2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1015   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1016                                    ESSCertIDv2_sequence, hf_index, ett_ess_ESSCertIDv2);
1017
1018   return offset;
1019 }
1020
1021
1022 static const ber_sequence_t SEQUENCE_OF_ESSCertIDv2_sequence_of[1] = {
1023   { &hf_ess_certsV2_item    , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_ESSCertIDv2 },
1024 };
1025
1026 static int
1027 dissect_ess_SEQUENCE_OF_ESSCertIDv2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1028   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
1029                                       SEQUENCE_OF_ESSCertIDv2_sequence_of, hf_index, ett_ess_SEQUENCE_OF_ESSCertIDv2);
1030
1031   return offset;
1032 }
1033
1034
1035 static const ber_sequence_t SigningCertificateV2_sequence[] = {
1036   { &hf_ess_certsV2         , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ess_SEQUENCE_OF_ESSCertIDv2 },
1037   { &hf_ess_policies        , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ess_SEQUENCE_OF_PolicyInformation },
1038   { NULL, 0, 0, 0, NULL }
1039 };
1040
1041 static int
1042 dissect_ess_SigningCertificateV2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
1043   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
1044                                    SigningCertificateV2_sequence, hf_index, ett_ess_SigningCertificateV2);
1045
1046   return offset;
1047 }
1048
1049 /*--- PDUs ---*/
1050
1051 static void dissect_ReceiptRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1052   asn1_ctx_t asn1_ctx;
1053   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1054   dissect_ess_ReceiptRequest(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_ReceiptRequest_PDU);
1055 }
1056 static void dissect_ContentIdentifier_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1057   asn1_ctx_t asn1_ctx;
1058   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1059   dissect_ess_ContentIdentifier(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_ContentIdentifier_PDU);
1060 }
1061 static void dissect_Receipt_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1062   asn1_ctx_t asn1_ctx;
1063   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1064   dissect_ess_Receipt(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_Receipt_PDU);
1065 }
1066 static void dissect_ContentHints_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1067   asn1_ctx_t asn1_ctx;
1068   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1069   dissect_ess_ContentHints(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_ContentHints_PDU);
1070 }
1071 static void dissect_MsgSigDigest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1072   asn1_ctx_t asn1_ctx;
1073   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1074   dissect_ess_MsgSigDigest(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_MsgSigDigest_PDU);
1075 }
1076 static void dissect_ContentReference_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1077   asn1_ctx_t asn1_ctx;
1078   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1079   dissect_ess_ContentReference(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_ContentReference_PDU);
1080 }
1081 void dissect_ess_ESSSecurityLabel_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1082   asn1_ctx_t asn1_ctx;
1083   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1084   dissect_ess_ESSSecurityLabel(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_ess_ESSSecurityLabel_PDU);
1085 }
1086 static void dissect_RestrictiveTag_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1087   asn1_ctx_t asn1_ctx;
1088   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1089   dissect_ess_RestrictiveTag(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_RestrictiveTag_PDU);
1090 }
1091 static void dissect_EnumeratedTag_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1092   asn1_ctx_t asn1_ctx;
1093   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1094   dissect_ess_EnumeratedTag(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_EnumeratedTag_PDU);
1095 }
1096 static void dissect_PermissiveTag_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1097   asn1_ctx_t asn1_ctx;
1098   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1099   dissect_ess_PermissiveTag(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_PermissiveTag_PDU);
1100 }
1101 static void dissect_InformativeTag_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1102   asn1_ctx_t asn1_ctx;
1103   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1104   dissect_ess_InformativeTag(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_InformativeTag_PDU);
1105 }
1106 static void dissect_EquivalentLabels_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1107   asn1_ctx_t asn1_ctx;
1108   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1109   dissect_ess_EquivalentLabels(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_EquivalentLabels_PDU);
1110 }
1111 static void dissect_MLExpansionHistory_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1112   asn1_ctx_t asn1_ctx;
1113   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1114   dissect_ess_MLExpansionHistory(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_MLExpansionHistory_PDU);
1115 }
1116 static void dissect_SigningCertificate_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1117   asn1_ctx_t asn1_ctx;
1118   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1119   dissect_ess_SigningCertificate(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_SigningCertificate_PDU);
1120 }
1121 static void dissect_SigningCertificateV2_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
1122   asn1_ctx_t asn1_ctx;
1123   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
1124   dissect_ess_SigningCertificateV2(FALSE, tvb, 0, &asn1_ctx, tree, hf_ess_SigningCertificateV2_PDU);
1125 }
1126
1127
1128 /*--- End of included file: packet-ess-fn.c ---*/
1129 #line 142 "../../asn1/ess/packet-ess-template.c"
1130
1131 /*--- proto_register_ess ----------------------------------------------*/
1132 void proto_register_ess(void) {
1133
1134   /* List of fields */
1135   static hf_register_info hf[] = {
1136     { &hf_ess_SecurityCategory_type_OID,
1137       { "type", "ess.type_OID", FT_STRING, BASE_NONE, NULL, 0,
1138         "Type of Security Category", HFILL }},
1139     { &hf_ess_Category_attribute,
1140       { "Attribute", "ess.attribute", FT_STRING, BASE_NONE, NULL, 0,
1141         NULL, HFILL }},
1142
1143 /*--- Included file: packet-ess-hfarr.c ---*/
1144 #line 1 "../../asn1/ess/packet-ess-hfarr.c"
1145     { &hf_ess_ReceiptRequest_PDU,
1146       { "ReceiptRequest", "ess.ReceiptRequest_element",
1147         FT_NONE, BASE_NONE, NULL, 0,
1148         NULL, HFILL }},
1149     { &hf_ess_ContentIdentifier_PDU,
1150       { "ContentIdentifier", "ess.ContentIdentifier",
1151         FT_BYTES, BASE_NONE, NULL, 0,
1152         NULL, HFILL }},
1153     { &hf_ess_Receipt_PDU,
1154       { "Receipt", "ess.Receipt_element",
1155         FT_NONE, BASE_NONE, NULL, 0,
1156         NULL, HFILL }},
1157     { &hf_ess_ContentHints_PDU,
1158       { "ContentHints", "ess.ContentHints_element",
1159         FT_NONE, BASE_NONE, NULL, 0,
1160         NULL, HFILL }},
1161     { &hf_ess_MsgSigDigest_PDU,
1162       { "MsgSigDigest", "ess.MsgSigDigest",
1163         FT_BYTES, BASE_NONE, NULL, 0,
1164         NULL, HFILL }},
1165     { &hf_ess_ContentReference_PDU,
1166       { "ContentReference", "ess.ContentReference_element",
1167         FT_NONE, BASE_NONE, NULL, 0,
1168         NULL, HFILL }},
1169     { &hf_ess_ess_ESSSecurityLabel_PDU,
1170       { "ESSSecurityLabel", "ess.ESSSecurityLabel_element",
1171         FT_NONE, BASE_NONE, NULL, 0,
1172         NULL, HFILL }},
1173     { &hf_ess_RestrictiveTag_PDU,
1174       { "RestrictiveTag", "ess.RestrictiveTag_element",
1175         FT_NONE, BASE_NONE, NULL, 0,
1176         NULL, HFILL }},
1177     { &hf_ess_EnumeratedTag_PDU,
1178       { "EnumeratedTag", "ess.EnumeratedTag_element",
1179         FT_NONE, BASE_NONE, NULL, 0,
1180         NULL, HFILL }},
1181     { &hf_ess_PermissiveTag_PDU,
1182       { "PermissiveTag", "ess.PermissiveTag_element",
1183         FT_NONE, BASE_NONE, NULL, 0,
1184         NULL, HFILL }},
1185     { &hf_ess_InformativeTag_PDU,
1186       { "InformativeTag", "ess.InformativeTag_element",
1187         FT_NONE, BASE_NONE, NULL, 0,
1188         NULL, HFILL }},
1189     { &hf_ess_EquivalentLabels_PDU,
1190       { "EquivalentLabels", "ess.EquivalentLabels",
1191         FT_UINT32, BASE_DEC, NULL, 0,
1192         NULL, HFILL }},
1193     { &hf_ess_MLExpansionHistory_PDU,
1194       { "MLExpansionHistory", "ess.MLExpansionHistory",
1195         FT_UINT32, BASE_DEC, NULL, 0,
1196         NULL, HFILL }},
1197     { &hf_ess_SigningCertificate_PDU,
1198       { "SigningCertificate", "ess.SigningCertificate_element",
1199         FT_NONE, BASE_NONE, NULL, 0,
1200         NULL, HFILL }},
1201     { &hf_ess_SigningCertificateV2_PDU,
1202       { "SigningCertificateV2", "ess.SigningCertificateV2_element",
1203         FT_NONE, BASE_NONE, NULL, 0,
1204         NULL, HFILL }},
1205     { &hf_ess_signedContentIdentifier,
1206       { "signedContentIdentifier", "ess.signedContentIdentifier",
1207         FT_BYTES, BASE_NONE, NULL, 0,
1208         "ContentIdentifier", HFILL }},
1209     { &hf_ess_receiptsFrom,
1210       { "receiptsFrom", "ess.receiptsFrom",
1211         FT_UINT32, BASE_DEC, VALS(ess_ReceiptsFrom_vals), 0,
1212         NULL, HFILL }},
1213     { &hf_ess_receiptsTo,
1214       { "receiptsTo", "ess.receiptsTo",
1215         FT_UINT32, BASE_DEC, NULL, 0,
1216         "SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames", HFILL }},
1217     { &hf_ess_receiptsTo_item,
1218       { "GeneralNames", "ess.GeneralNames",
1219         FT_UINT32, BASE_DEC, NULL, 0,
1220         NULL, HFILL }},
1221     { &hf_ess_allOrFirstTier,
1222       { "allOrFirstTier", "ess.allOrFirstTier",
1223         FT_INT32, BASE_DEC, VALS(ess_AllOrFirstTier_vals), 0,
1224         NULL, HFILL }},
1225     { &hf_ess_receiptList,
1226       { "receiptList", "ess.receiptList",
1227         FT_UINT32, BASE_DEC, NULL, 0,
1228         "SEQUENCE_OF_GeneralNames", HFILL }},
1229     { &hf_ess_receiptList_item,
1230       { "GeneralNames", "ess.GeneralNames",
1231         FT_UINT32, BASE_DEC, NULL, 0,
1232         NULL, HFILL }},
1233     { &hf_ess_version,
1234       { "version", "ess.version",
1235         FT_INT32, BASE_DEC, VALS(ess_ESSVersion_vals), 0,
1236         "ESSVersion", HFILL }},
1237     { &hf_ess_contentType,
1238       { "contentType", "ess.contentType",
1239         FT_OID, BASE_NONE, NULL, 0,
1240         NULL, HFILL }},
1241     { &hf_ess_originatorSignatureValue,
1242       { "originatorSignatureValue", "ess.originatorSignatureValue",
1243         FT_BYTES, BASE_NONE, NULL, 0,
1244         "OCTET_STRING", HFILL }},
1245     { &hf_ess_contentDescription,
1246       { "contentDescription", "ess.contentDescription",
1247         FT_STRING, BASE_NONE, NULL, 0,
1248         "UTF8String_SIZE_1_MAX", HFILL }},
1249     { &hf_ess_security_policy_identifier,
1250       { "security-policy-identifier", "ess.security_policy_identifier",
1251         FT_OID, BASE_NONE, NULL, 0,
1252         "SecurityPolicyIdentifier", HFILL }},
1253     { &hf_ess_security_classification,
1254       { "security-classification", "ess.security_classification",
1255         FT_UINT32, BASE_DEC, VALS(ess_SecurityClassification_vals), 0,
1256         "SecurityClassification", HFILL }},
1257     { &hf_ess_privacy_mark,
1258       { "privacy-mark", "ess.privacy_mark",
1259         FT_UINT32, BASE_DEC, VALS(ess_ESSPrivacyMark_vals), 0,
1260         "ESSPrivacyMark", HFILL }},
1261     { &hf_ess_security_categories,
1262       { "security-categories", "ess.security_categories",
1263         FT_UINT32, BASE_DEC, NULL, 0,
1264         "SecurityCategories", HFILL }},
1265     { &hf_ess_pString,
1266       { "pString", "ess.pString",
1267         FT_STRING, BASE_NONE, NULL, 0,
1268         "PrintableString_SIZE_1_ub_privacy_mark_length", HFILL }},
1269     { &hf_ess_utf8String,
1270       { "utf8String", "ess.utf8String",
1271         FT_STRING, BASE_NONE, NULL, 0,
1272         "UTF8String_SIZE_1_MAX", HFILL }},
1273     { &hf_ess_SecurityCategories_item,
1274       { "SecurityCategory", "ess.SecurityCategory_element",
1275         FT_NONE, BASE_NONE, NULL, 0,
1276         NULL, HFILL }},
1277     { &hf_ess_type,
1278       { "type", "ess.type",
1279         FT_OID, BASE_NONE, NULL, 0,
1280         NULL, HFILL }},
1281     { &hf_ess_value,
1282       { "value", "ess.value_element",
1283         FT_NONE, BASE_NONE, NULL, 0,
1284         NULL, HFILL }},
1285     { &hf_ess_restrictiveTagName,
1286       { "tagName", "ess.tagName",
1287         FT_OID, BASE_NONE, NULL, 0,
1288         "T_restrictiveTagName", HFILL }},
1289     { &hf_ess_restrictiveAttributeFlags,
1290       { "attributeFlags", "ess.attributeFlags",
1291         FT_BYTES, BASE_NONE, NULL, 0,
1292         "T_restrictiveAttributeFlags", HFILL }},
1293     { &hf_ess_tagName,
1294       { "tagName", "ess.tagName",
1295         FT_OID, BASE_NONE, NULL, 0,
1296         NULL, HFILL }},
1297     { &hf_ess_attributeList,
1298       { "attributeList", "ess.attributeList",
1299         FT_UINT32, BASE_DEC, NULL, 0,
1300         "SET_OF_SecurityAttribute", HFILL }},
1301     { &hf_ess_attributeList_item,
1302       { "SecurityAttribute", "ess.SecurityAttribute",
1303         FT_INT32, BASE_DEC, NULL, 0,
1304         NULL, HFILL }},
1305     { &hf_ess_permissiveTagName,
1306       { "tagName", "ess.tagName",
1307         FT_OID, BASE_NONE, NULL, 0,
1308         "T_permissiveTagName", HFILL }},
1309     { &hf_ess_permissiveAttributeFlags,
1310       { "attributeFlags", "ess.attributeFlags",
1311         FT_BYTES, BASE_NONE, NULL, 0,
1312         "T_permissiveAttributeFlags", HFILL }},
1313     { &hf_ess_informativeTagName,
1314       { "tagName", "ess.tagName",
1315         FT_OID, BASE_NONE, NULL, 0,
1316         "T_informativeTagName", HFILL }},
1317     { &hf_ess_attributes,
1318       { "attributes", "ess.attributes",
1319         FT_UINT32, BASE_DEC, VALS(ess_FreeFormField_vals), 0,
1320         "FreeFormField", HFILL }},
1321     { &hf_ess_informativeAttributeFlags,
1322       { "bitSetAttributes", "ess.bitSetAttributes",
1323         FT_BYTES, BASE_NONE, NULL, 0,
1324         "T_informativeAttributeFlags", HFILL }},
1325     { &hf_ess_securityAttributes,
1326       { "securityAttributes", "ess.securityAttributes",
1327         FT_UINT32, BASE_DEC, NULL, 0,
1328         "SET_OF_SecurityAttribute", HFILL }},
1329     { &hf_ess_securityAttributes_item,
1330       { "SecurityAttribute", "ess.SecurityAttribute",
1331         FT_INT32, BASE_DEC, NULL, 0,
1332         NULL, HFILL }},
1333     { &hf_ess_EquivalentLabels_item,
1334       { "ESSSecurityLabel", "ess.ESSSecurityLabel_element",
1335         FT_NONE, BASE_NONE, NULL, 0,
1336         NULL, HFILL }},
1337     { &hf_ess_MLExpansionHistory_item,
1338       { "MLData", "ess.MLData_element",
1339         FT_NONE, BASE_NONE, NULL, 0,
1340         NULL, HFILL }},
1341     { &hf_ess_mailListIdentifier,
1342       { "mailListIdentifier", "ess.mailListIdentifier",
1343         FT_UINT32, BASE_DEC, VALS(ess_EntityIdentifier_vals), 0,
1344         "EntityIdentifier", HFILL }},
1345     { &hf_ess_expansionTime,
1346       { "expansionTime", "ess.expansionTime",
1347         FT_STRING, BASE_NONE, NULL, 0,
1348         "GeneralizedTime", HFILL }},
1349     { &hf_ess_mlReceiptPolicy,
1350       { "mlReceiptPolicy", "ess.mlReceiptPolicy",
1351         FT_UINT32, BASE_DEC, VALS(ess_MLReceiptPolicy_vals), 0,
1352         NULL, HFILL }},
1353     { &hf_ess_issuerAndSerialNumber,
1354       { "issuerAndSerialNumber", "ess.issuerAndSerialNumber_element",
1355         FT_NONE, BASE_NONE, NULL, 0,
1356         NULL, HFILL }},
1357     { &hf_ess_subjectKeyIdentifier,
1358       { "subjectKeyIdentifier", "ess.subjectKeyIdentifier",
1359         FT_BYTES, BASE_NONE, NULL, 0,
1360         NULL, HFILL }},
1361     { &hf_ess_none,
1362       { "none", "ess.none_element",
1363         FT_NONE, BASE_NONE, NULL, 0,
1364         NULL, HFILL }},
1365     { &hf_ess_insteadOf,
1366       { "insteadOf", "ess.insteadOf",
1367         FT_UINT32, BASE_DEC, NULL, 0,
1368         "SEQUENCE_SIZE_1_MAX_OF_GeneralNames", HFILL }},
1369     { &hf_ess_insteadOf_item,
1370       { "GeneralNames", "ess.GeneralNames",
1371         FT_UINT32, BASE_DEC, NULL, 0,
1372         NULL, HFILL }},
1373     { &hf_ess_inAdditionTo,
1374       { "inAdditionTo", "ess.inAdditionTo",
1375         FT_UINT32, BASE_DEC, NULL, 0,
1376         "SEQUENCE_SIZE_1_MAX_OF_GeneralNames", HFILL }},
1377     { &hf_ess_inAdditionTo_item,
1378       { "GeneralNames", "ess.GeneralNames",
1379         FT_UINT32, BASE_DEC, NULL, 0,
1380         NULL, HFILL }},
1381     { &hf_ess_certs,
1382       { "certs", "ess.certs",
1383         FT_UINT32, BASE_DEC, NULL, 0,
1384         "SEQUENCE_OF_ESSCertID", HFILL }},
1385     { &hf_ess_certs_item,
1386       { "ESSCertID", "ess.ESSCertID_element",
1387         FT_NONE, BASE_NONE, NULL, 0,
1388         NULL, HFILL }},
1389     { &hf_ess_policies,
1390       { "policies", "ess.policies",
1391         FT_UINT32, BASE_DEC, NULL, 0,
1392         "SEQUENCE_OF_PolicyInformation", HFILL }},
1393     { &hf_ess_policies_item,
1394       { "PolicyInformation", "ess.PolicyInformation_element",
1395         FT_NONE, BASE_NONE, NULL, 0,
1396         NULL, HFILL }},
1397     { &hf_ess_certsV2,
1398       { "certs", "ess.certs",
1399         FT_UINT32, BASE_DEC, NULL, 0,
1400         "SEQUENCE_OF_ESSCertIDv2", HFILL }},
1401     { &hf_ess_certsV2_item,
1402       { "ESSCertIDv2", "ess.ESSCertIDv2_element",
1403         FT_NONE, BASE_NONE, NULL, 0,
1404         NULL, HFILL }},
1405     { &hf_ess_hashAlgorithm,
1406       { "hashAlgorithm", "ess.hashAlgorithm_element",
1407         FT_NONE, BASE_NONE, NULL, 0,
1408         "AlgorithmIdentifier", HFILL }},
1409     { &hf_ess_certHash,
1410       { "certHash", "ess.certHash",
1411         FT_BYTES, BASE_NONE, NULL, 0,
1412         "Hash", HFILL }},
1413     { &hf_ess_issuerSerial,
1414       { "issuerSerial", "ess.issuerSerial_element",
1415         FT_NONE, BASE_NONE, NULL, 0,
1416         NULL, HFILL }},
1417     { &hf_ess_issuer,
1418       { "issuer", "ess.issuer",
1419         FT_UINT32, BASE_DEC, NULL, 0,
1420         "GeneralNames", HFILL }},
1421     { &hf_ess_serialNumber,
1422       { "serialNumber", "ess.serialNumber",
1423         FT_INT32, BASE_DEC, NULL, 0,
1424         "CertificateSerialNumber", HFILL }},
1425
1426 /*--- End of included file: packet-ess-hfarr.c ---*/
1427 #line 155 "../../asn1/ess/packet-ess-template.c"
1428   };
1429
1430   /* List of subtrees */
1431   static gint *ett[] = {
1432      &ett_Category_attributes,
1433
1434 /*--- Included file: packet-ess-ettarr.c ---*/
1435 #line 1 "../../asn1/ess/packet-ess-ettarr.c"
1436     &ett_ess_ReceiptRequest,
1437     &ett_ess_SEQUENCE_SIZE_1_ub_receiptsTo_OF_GeneralNames,
1438     &ett_ess_ReceiptsFrom,
1439     &ett_ess_SEQUENCE_OF_GeneralNames,
1440     &ett_ess_Receipt,
1441     &ett_ess_ContentHints,
1442     &ett_ess_ContentReference,
1443     &ett_ess_ESSSecurityLabel,
1444     &ett_ess_ESSPrivacyMark,
1445     &ett_ess_SecurityCategories,
1446     &ett_ess_SecurityCategory,
1447     &ett_ess_RestrictiveTag,
1448     &ett_ess_EnumeratedTag,
1449     &ett_ess_SET_OF_SecurityAttribute,
1450     &ett_ess_PermissiveTag,
1451     &ett_ess_InformativeTag,
1452     &ett_ess_FreeFormField,
1453     &ett_ess_EquivalentLabels,
1454     &ett_ess_MLExpansionHistory,
1455     &ett_ess_MLData,
1456     &ett_ess_EntityIdentifier,
1457     &ett_ess_MLReceiptPolicy,
1458     &ett_ess_SEQUENCE_SIZE_1_MAX_OF_GeneralNames,
1459     &ett_ess_SigningCertificate,
1460     &ett_ess_SEQUENCE_OF_ESSCertID,
1461     &ett_ess_SEQUENCE_OF_PolicyInformation,
1462     &ett_ess_SigningCertificateV2,
1463     &ett_ess_SEQUENCE_OF_ESSCertIDv2,
1464     &ett_ess_ESSCertIDv2,
1465     &ett_ess_ESSCertID,
1466     &ett_ess_IssuerSerial,
1467
1468 /*--- End of included file: packet-ess-ettarr.c ---*/
1469 #line 161 "../../asn1/ess/packet-ess-template.c"
1470   };
1471
1472   static uat_field_t attributes_flds[] = {
1473     UAT_FLD_CSTRING(ess_category_attributes,oid, "Tag Set", "Category Tag Set (Object Identifier)"),
1474     UAT_FLD_DEC(ess_category_attributes,lacv, "Value", "Label And Cert Value"),
1475     UAT_FLD_CSTRING(ess_category_attributes,name, "Name", "Category Name"),
1476     UAT_END_FIELDS
1477   };
1478
1479   uat_t *attributes_uat = uat_new("ESS Category Attributes",
1480                                   sizeof(ess_category_attributes_t),
1481                                   "ess_category_attributes",
1482                                   TRUE,
1483                                   &ess_category_attributes,
1484                                   &num_ess_category_attributes,
1485                                   UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
1486                                   "ChEssCategoryAttributes",
1487                                   ess_copy_cb,
1488                                   NULL,
1489                                   ess_free_cb,
1490                                   NULL,
1491                                   attributes_flds);
1492
1493   static module_t *ess_module;
1494
1495   /* Register protocol */
1496   proto_ess = proto_register_protocol(PNAME, PSNAME, PFNAME);
1497
1498   /* Register fields and subtrees */
1499   proto_register_field_array(proto_ess, hf, array_length(hf));
1500   proto_register_subtree_array(ett, array_length(ett));
1501
1502   ess_module = prefs_register_protocol(proto_ess, NULL);
1503
1504   prefs_register_uat_preference(ess_module, "attributes_table",
1505                                 "ESS Category Attributes",
1506                                 "ESS category attributes translation table",
1507                                 attributes_uat);
1508
1509 }
1510
1511
1512 /*--- proto_reg_handoff_ess -------------------------------------------*/
1513 void proto_reg_handoff_ess(void) {
1514
1515 /*--- Included file: packet-ess-dis-tab.c ---*/
1516 #line 1 "../../asn1/ess/packet-ess-dis-tab.c"
1517   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.1", dissect_ReceiptRequest_PDU, proto_ess, "id-aa-receiptRequest");
1518   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.7", dissect_ContentIdentifier_PDU, proto_ess, "id-aa-contentIdentifier");
1519   register_ber_oid_dissector("1.2.840.113549.1.9.16.1.1", dissect_Receipt_PDU, proto_ess, "id-ct-receipt");
1520   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.4", dissect_ContentHints_PDU, proto_ess, "id-aa-contentHint");
1521   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.5", dissect_MsgSigDigest_PDU, proto_ess, "id-aa-msgSigDigest");
1522   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.10", dissect_ContentReference_PDU, proto_ess, "id-aa-contentReference");
1523   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.2", dissect_ess_ESSSecurityLabel_PDU, proto_ess, "id-aa-securityLabel");
1524   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.9", dissect_EquivalentLabels_PDU, proto_ess, "id-aa-equivalentLabels");
1525   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.3", dissect_MLExpansionHistory_PDU, proto_ess, "id-aa-mlExpandHistory");
1526   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.12", dissect_SigningCertificate_PDU, proto_ess, "id-aa-signingCertificate");
1527   register_ber_oid_dissector("1.2.840.113549.1.9.16.2.47", dissect_SigningCertificateV2_PDU, proto_ess, "id-aa-signingCertificateV2");
1528   register_ber_oid_dissector("2.16.840.1.101.2.1.8.3.0", dissect_RestrictiveTag_PDU, proto_ess, "id-restrictiveAttributes");
1529   register_ber_oid_dissector("2.16.840.1.101.2.1.8.3.1", dissect_EnumeratedTag_PDU, proto_ess, "id-enumeratedPermissiveAttributes");
1530   register_ber_oid_dissector("2.16.840.1.101.2.1.8.3.2", dissect_PermissiveTag_PDU, proto_ess, "id-permissiveAttributes");
1531   register_ber_oid_dissector("2.16.840.1.101.2.1.8.3.3", dissect_InformativeTag_PDU, proto_ess, "id-informativeAttributes");
1532   register_ber_oid_dissector("2.16.840.1.101.2.1.8.3.4", dissect_EnumeratedTag_PDU, proto_ess, "id-enumeratedRestrictiveAttributes");
1533
1534
1535 /*--- End of included file: packet-ess-dis-tab.c ---*/
1536 #line 206 "../../asn1/ess/packet-ess-template.c"
1537 }
1538