Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-pkixac.c
blob5afe464113a7549581306f11cb109d7cdd253e15
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-pkixac.c */
4 /* asn2wrs.py -b -q -L -p pkixac -c ./pkixac.cnf -s ./packet-pkixac-template -D . -O ../.. PKIXAttributeCertificate.asn */
6 /* packet-pkixac.c
8 * Routines for PKIXAttributeCertificate (RFC3281) packet dissection.
10 * Copyright 2010, Stig Bjorlykke <stig@bjorlykke.org>
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include "config.h"
21 #include <epan/packet.h>
22 #include <wsutil/array.h>
24 #include <epan/asn1.h>
25 #include "packet-ber.h"
26 #include "packet-pkixac.h"
27 #include "packet-pkix1explicit.h"
28 #include "packet-pkix1implicit.h"
29 #include "packet-x509ce.h"
31 #define PNAME "PKIX Attribute Certificate"
32 #define PSNAME "PKIXAC"
33 #define PFNAME "pkixac"
35 void proto_register_pkixac(void);
36 void proto_reg_handoff_pkixac(void);
38 /* Initialize the protocol and registered fields */
39 static int proto_pkixac;
40 static int hf_pkixac_Targets_PDU; /* Targets */
41 static int hf_pkixac_IetfAttrSyntax_PDU; /* IetfAttrSyntax */
42 static int hf_pkixac_SvceAuthInfo_PDU; /* SvceAuthInfo */
43 static int hf_pkixac_RoleSyntax_PDU; /* RoleSyntax */
44 static int hf_pkixac_Clearance_PDU; /* Clearance */
45 static int hf_pkixac_RFC3281Clearance_PDU; /* RFC3281Clearance */
46 static int hf_pkixac_AAControls_PDU; /* AAControls */
47 static int hf_pkixac_ProxyInfo_PDU; /* ProxyInfo */
48 static int hf_pkixac_digestedObjectType; /* T_digestedObjectType */
49 static int hf_pkixac_otherObjectTypeID; /* OBJECT_IDENTIFIER */
50 static int hf_pkixac_digestAlgorithm; /* AlgorithmIdentifier */
51 static int hf_pkixac_objectDigest; /* BIT_STRING */
52 static int hf_pkixac_issuer; /* GeneralNames */
53 static int hf_pkixac_serial; /* CertificateSerialNumber */
54 static int hf_pkixac_issuerUID; /* UniqueIdentifier */
55 static int hf_pkixac_Targets_item; /* Target */
56 static int hf_pkixac_targetName; /* GeneralName */
57 static int hf_pkixac_targetGroup; /* GeneralName */
58 static int hf_pkixac_targetCert; /* TargetCert */
59 static int hf_pkixac_targetCertificate; /* IssuerSerial */
60 static int hf_pkixac_certDigestInfo; /* ObjectDigestInfo */
61 static int hf_pkixac_policyAuthority; /* GeneralNames */
62 static int hf_pkixac_values; /* T_values */
63 static int hf_pkixac_values_item; /* T_values_item */
64 static int hf_pkixac_octets; /* OCTET_STRING */
65 static int hf_pkixac_oid; /* OBJECT_IDENTIFIER */
66 static int hf_pkixac_string; /* UTF8String */
67 static int hf_pkixac_service; /* GeneralName */
68 static int hf_pkixac_ident; /* GeneralName */
69 static int hf_pkixac_authInfo; /* OCTET_STRING */
70 static int hf_pkixac_roleAuthority; /* GeneralNames */
71 static int hf_pkixac_roleName; /* GeneralName */
72 static int hf_pkixac_policyId; /* OBJECT_IDENTIFIER */
73 static int hf_pkixac_classList; /* ClassList */
74 static int hf_pkixac_securityCategories; /* SET_OF_SecurityCategory */
75 static int hf_pkixac_securityCategories_item; /* SecurityCategory */
76 static int hf_pkixac_type; /* T_type */
77 static int hf_pkixac_value; /* T_value */
78 static int hf_pkixac_pathLenConstraint; /* INTEGER_0_MAX */
79 static int hf_pkixac_permittedAttrs; /* AttrSpec */
80 static int hf_pkixac_excludedAttrs; /* AttrSpec */
81 static int hf_pkixac_permitUnSpecified; /* BOOLEAN */
82 static int hf_pkixac_AttrSpec_item; /* OBJECT_IDENTIFIER */
83 static int hf_pkixac_ProxyInfo_item; /* Targets */
84 /* named bits */
85 static int hf_pkixac_ClassList_unmarked;
86 static int hf_pkixac_ClassList_unclassified;
87 static int hf_pkixac_ClassList_restricted;
88 static int hf_pkixac_ClassList_confidential;
89 static int hf_pkixac_ClassList_secret;
90 static int hf_pkixac_ClassList_topSecret;
92 /* Initialize the subtree pointers */
93 static int ett_pkixac;
94 static int ett_pkixac_ObjectDigestInfo;
95 static int ett_pkixac_IssuerSerial;
96 static int ett_pkixac_Targets;
97 static int ett_pkixac_Target;
98 static int ett_pkixac_TargetCert;
99 static int ett_pkixac_IetfAttrSyntax;
100 static int ett_pkixac_T_values;
101 static int ett_pkixac_T_values_item;
102 static int ett_pkixac_SvceAuthInfo;
103 static int ett_pkixac_RoleSyntax;
104 static int ett_pkixac_Clearance;
105 static int ett_pkixac_SET_OF_SecurityCategory;
106 static int ett_pkixac_RFC3281Clearance;
107 static int ett_pkixac_ClassList;
108 static int ett_pkixac_SecurityCategory;
109 static int ett_pkixac_AAControls;
110 static int ett_pkixac_AttrSpec;
111 static int ett_pkixac_ProxyInfo;
113 static const char *object_identifier_id;
116 static const value_string pkixac_T_digestedObjectType_vals[] = {
117 { 0, "publicKey" },
118 { 1, "publicKeyCert" },
119 { 2, "otherObjectTypes" },
120 { 0, NULL }
124 static int
125 dissect_pkixac_T_digestedObjectType(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
126 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
127 NULL);
129 return offset;
134 static int
135 dissect_pkixac_OBJECT_IDENTIFIER(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
136 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
138 return offset;
143 static int
144 dissect_pkixac_BIT_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
145 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
146 NULL, 0, hf_index, -1,
147 NULL);
149 return offset;
153 static const ber_sequence_t ObjectDigestInfo_sequence[] = {
154 { &hf_pkixac_digestedObjectType, BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_pkixac_T_digestedObjectType },
155 { &hf_pkixac_otherObjectTypeID, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
156 { &hf_pkixac_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
157 { &hf_pkixac_objectDigest , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_pkixac_BIT_STRING },
158 { NULL, 0, 0, 0, NULL }
161 static int
162 dissect_pkixac_ObjectDigestInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
163 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
164 ObjectDigestInfo_sequence, hf_index, ett_pkixac_ObjectDigestInfo);
166 return offset;
170 static const ber_sequence_t IssuerSerial_sequence[] = {
171 { &hf_pkixac_issuer , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralNames },
172 { &hf_pkixac_serial , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateSerialNumber },
173 { &hf_pkixac_issuerUID , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_UniqueIdentifier },
174 { NULL, 0, 0, 0, NULL }
177 static int
178 dissect_pkixac_IssuerSerial(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
179 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
180 IssuerSerial_sequence, hf_index, ett_pkixac_IssuerSerial);
182 return offset;
186 static const ber_sequence_t TargetCert_sequence[] = {
187 { &hf_pkixac_targetCertificate, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_IssuerSerial },
188 { &hf_pkixac_targetName , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
189 { &hf_pkixac_certDigestInfo, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_ObjectDigestInfo },
190 { NULL, 0, 0, 0, NULL }
193 static int
194 dissect_pkixac_TargetCert(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
195 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
196 TargetCert_sequence, hf_index, ett_pkixac_TargetCert);
198 return offset;
202 static const value_string pkixac_Target_vals[] = {
203 { 0, "targetName" },
204 { 1, "targetGroup" },
205 { 2, "targetCert" },
206 { 0, NULL }
209 static const ber_choice_t Target_choice[] = {
210 { 0, &hf_pkixac_targetName , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
211 { 1, &hf_pkixac_targetGroup , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
212 { 2, &hf_pkixac_targetCert , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_pkixac_TargetCert },
213 { 0, NULL, 0, 0, 0, NULL }
216 static int
217 dissect_pkixac_Target(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
218 offset = dissect_ber_choice(actx, tree, tvb, offset,
219 Target_choice, hf_index, ett_pkixac_Target,
220 NULL);
222 return offset;
226 static const ber_sequence_t Targets_sequence_of[1] = {
227 { &hf_pkixac_Targets_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkixac_Target },
230 static int
231 dissect_pkixac_Targets(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
232 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
233 Targets_sequence_of, hf_index, ett_pkixac_Targets);
235 return offset;
240 static int
241 dissect_pkixac_OCTET_STRING(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
242 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
243 NULL);
245 return offset;
250 static int
251 dissect_pkixac_UTF8String(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
252 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTF8String,
253 actx, tree, tvb, offset, hf_index,
254 NULL);
256 return offset;
260 static const value_string pkixac_T_values_item_vals[] = {
261 { 0, "octets" },
262 { 1, "oid" },
263 { 2, "string" },
264 { 0, NULL }
267 static const ber_choice_t T_values_item_choice[] = {
268 { 0, &hf_pkixac_octets , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkixac_OCTET_STRING },
269 { 1, &hf_pkixac_oid , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
270 { 2, &hf_pkixac_string , BER_CLASS_UNI, BER_UNI_TAG_UTF8String, BER_FLAGS_NOOWNTAG, dissect_pkixac_UTF8String },
271 { 0, NULL, 0, 0, 0, NULL }
274 static int
275 dissect_pkixac_T_values_item(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
276 offset = dissect_ber_choice(actx, tree, tvb, offset,
277 T_values_item_choice, hf_index, ett_pkixac_T_values_item,
278 NULL);
280 return offset;
284 static const ber_sequence_t T_values_sequence_of[1] = {
285 { &hf_pkixac_values_item , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_pkixac_T_values_item },
288 static int
289 dissect_pkixac_T_values(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
290 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
291 T_values_sequence_of, hf_index, ett_pkixac_T_values);
293 return offset;
297 static const ber_sequence_t IetfAttrSyntax_sequence[] = {
298 { &hf_pkixac_policyAuthority, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
299 { &hf_pkixac_values , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_T_values },
300 { NULL, 0, 0, 0, NULL }
303 static int
304 dissect_pkixac_IetfAttrSyntax(bool 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_sequence(implicit_tag, actx, tree, tvb, offset,
306 IetfAttrSyntax_sequence, hf_index, ett_pkixac_IetfAttrSyntax);
308 return offset;
312 static const ber_sequence_t SvceAuthInfo_sequence[] = {
313 { &hf_pkixac_service , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
314 { &hf_pkixac_ident , BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG, dissect_x509ce_GeneralName },
315 { &hf_pkixac_authInfo , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_OCTET_STRING },
316 { NULL, 0, 0, 0, NULL }
319 static int
320 dissect_pkixac_SvceAuthInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
321 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
322 SvceAuthInfo_sequence, hf_index, ett_pkixac_SvceAuthInfo);
324 return offset;
328 static const ber_sequence_t RoleSyntax_sequence[] = {
329 { &hf_pkixac_roleAuthority, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralNames },
330 { &hf_pkixac_roleName , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_x509ce_GeneralName },
331 { NULL, 0, 0, 0, NULL }
334 static int
335 dissect_pkixac_RoleSyntax(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
336 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
337 RoleSyntax_sequence, hf_index, ett_pkixac_RoleSyntax);
339 return offset;
343 static int * const ClassList_bits[] = {
344 &hf_pkixac_ClassList_unmarked,
345 &hf_pkixac_ClassList_unclassified,
346 &hf_pkixac_ClassList_restricted,
347 &hf_pkixac_ClassList_confidential,
348 &hf_pkixac_ClassList_secret,
349 &hf_pkixac_ClassList_topSecret,
350 NULL
353 static int
354 dissect_pkixac_ClassList(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
355 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
356 ClassList_bits, 6, hf_index, ett_pkixac_ClassList,
357 NULL);
359 return offset;
364 static int
365 dissect_pkixac_T_type(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
366 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_index, &object_identifier_id);
368 return offset;
373 static int
374 dissect_pkixac_T_value(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
375 if (object_identifier_id)
376 offset = call_ber_oid_callback (object_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
379 return offset;
383 static const ber_sequence_t SecurityCategory_sequence[] = {
384 { &hf_pkixac_type , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_pkixac_T_type },
385 { &hf_pkixac_value , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_pkixac_T_value },
386 { NULL, 0, 0, 0, NULL }
389 static int
390 dissect_pkixac_SecurityCategory(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
391 object_identifier_id = NULL;
392 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
393 SecurityCategory_sequence, hf_index, ett_pkixac_SecurityCategory);
397 return offset;
401 static const ber_sequence_t SET_OF_SecurityCategory_set_of[1] = {
402 { &hf_pkixac_securityCategories_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_SecurityCategory },
405 static int
406 dissect_pkixac_SET_OF_SecurityCategory(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
407 offset = dissect_ber_set_of(implicit_tag, actx, tree, tvb, offset,
408 SET_OF_SecurityCategory_set_of, hf_index, ett_pkixac_SET_OF_SecurityCategory);
410 return offset;
414 static const ber_sequence_t Clearance_sequence[] = {
415 { &hf_pkixac_policyId , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
416 { &hf_pkixac_classList , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_ClassList },
417 { &hf_pkixac_securityCategories, BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_SET_OF_SecurityCategory },
418 { NULL, 0, 0, 0, NULL }
421 static int
422 dissect_pkixac_Clearance(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
423 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
424 Clearance_sequence, hf_index, ett_pkixac_Clearance);
426 return offset;
430 static const ber_sequence_t RFC3281Clearance_sequence[] = {
431 { &hf_pkixac_policyId , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_pkixac_OBJECT_IDENTIFIER },
432 { &hf_pkixac_classList , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_ClassList },
433 { &hf_pkixac_securityCategories, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_SET_OF_SecurityCategory },
434 { NULL, 0, 0, 0, NULL }
437 static int
438 dissect_pkixac_RFC3281Clearance(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
439 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
440 RFC3281Clearance_sequence, hf_index, ett_pkixac_RFC3281Clearance);
442 return offset;
447 static int
448 dissect_pkixac_INTEGER_0_MAX(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
449 offset = dissect_ber_integer64(implicit_tag, actx, tree, tvb, offset, hf_index,
450 NULL);
452 return offset;
456 static const ber_sequence_t AttrSpec_sequence_of[1] = {
457 { &hf_pkixac_AttrSpec_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixac_OBJECT_IDENTIFIER },
460 static int
461 dissect_pkixac_AttrSpec(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
462 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
463 AttrSpec_sequence_of, hf_index, ett_pkixac_AttrSpec);
465 return offset;
470 static int
471 dissect_pkixac_BOOLEAN(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
472 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
474 return offset;
478 static const ber_sequence_t AAControls_sequence[] = {
479 { &hf_pkixac_pathLenConstraint, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_INTEGER_0_MAX },
480 { &hf_pkixac_permittedAttrs, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_AttrSpec },
481 { &hf_pkixac_excludedAttrs, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixac_AttrSpec },
482 { &hf_pkixac_permitUnSpecified, BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixac_BOOLEAN },
483 { NULL, 0, 0, 0, NULL }
486 static int
487 dissect_pkixac_AAControls(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
488 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
489 AAControls_sequence, hf_index, ett_pkixac_AAControls);
491 return offset;
495 static const ber_sequence_t ProxyInfo_sequence_of[1] = {
496 { &hf_pkixac_ProxyInfo_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixac_Targets },
499 static int
500 dissect_pkixac_ProxyInfo(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
501 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
502 ProxyInfo_sequence_of, hf_index, ett_pkixac_ProxyInfo);
504 return offset;
507 /*--- PDUs ---*/
509 static int dissect_Targets_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
510 int offset = 0;
511 asn1_ctx_t asn1_ctx;
512 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
513 offset = dissect_pkixac_Targets(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_Targets_PDU);
514 return offset;
516 static int dissect_IetfAttrSyntax_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
517 int offset = 0;
518 asn1_ctx_t asn1_ctx;
519 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
520 offset = dissect_pkixac_IetfAttrSyntax(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_IetfAttrSyntax_PDU);
521 return offset;
523 static int dissect_SvceAuthInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
524 int offset = 0;
525 asn1_ctx_t asn1_ctx;
526 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
527 offset = dissect_pkixac_SvceAuthInfo(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_SvceAuthInfo_PDU);
528 return offset;
530 static int dissect_RoleSyntax_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
531 int offset = 0;
532 asn1_ctx_t asn1_ctx;
533 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
534 offset = dissect_pkixac_RoleSyntax(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_RoleSyntax_PDU);
535 return offset;
537 static int dissect_Clearance_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
538 int offset = 0;
539 asn1_ctx_t asn1_ctx;
540 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
541 offset = dissect_pkixac_Clearance(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_Clearance_PDU);
542 return offset;
544 static int dissect_RFC3281Clearance_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
545 int offset = 0;
546 asn1_ctx_t asn1_ctx;
547 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
548 offset = dissect_pkixac_RFC3281Clearance(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_RFC3281Clearance_PDU);
549 return offset;
551 static int dissect_AAControls_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
552 int offset = 0;
553 asn1_ctx_t asn1_ctx;
554 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
555 offset = dissect_pkixac_AAControls(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_AAControls_PDU);
556 return offset;
558 static int dissect_ProxyInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
559 int offset = 0;
560 asn1_ctx_t asn1_ctx;
561 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
562 offset = dissect_pkixac_ProxyInfo(false, tvb, offset, &asn1_ctx, tree, hf_pkixac_ProxyInfo_PDU);
563 return offset;
567 /*--- proto_register_pkixac ----------------------------------------------*/
568 void proto_register_pkixac(void) {
570 /* List of fields */
571 static hf_register_info hf[] = {
572 { &hf_pkixac_Targets_PDU,
573 { "Targets", "pkixac.Targets",
574 FT_UINT32, BASE_DEC, NULL, 0,
575 NULL, HFILL }},
576 { &hf_pkixac_IetfAttrSyntax_PDU,
577 { "IetfAttrSyntax", "pkixac.IetfAttrSyntax_element",
578 FT_NONE, BASE_NONE, NULL, 0,
579 NULL, HFILL }},
580 { &hf_pkixac_SvceAuthInfo_PDU,
581 { "SvceAuthInfo", "pkixac.SvceAuthInfo_element",
582 FT_NONE, BASE_NONE, NULL, 0,
583 NULL, HFILL }},
584 { &hf_pkixac_RoleSyntax_PDU,
585 { "RoleSyntax", "pkixac.RoleSyntax_element",
586 FT_NONE, BASE_NONE, NULL, 0,
587 NULL, HFILL }},
588 { &hf_pkixac_Clearance_PDU,
589 { "Clearance", "pkixac.Clearance_element",
590 FT_NONE, BASE_NONE, NULL, 0,
591 NULL, HFILL }},
592 { &hf_pkixac_RFC3281Clearance_PDU,
593 { "RFC3281Clearance", "pkixac.RFC3281Clearance_element",
594 FT_NONE, BASE_NONE, NULL, 0,
595 NULL, HFILL }},
596 { &hf_pkixac_AAControls_PDU,
597 { "AAControls", "pkixac.AAControls_element",
598 FT_NONE, BASE_NONE, NULL, 0,
599 NULL, HFILL }},
600 { &hf_pkixac_ProxyInfo_PDU,
601 { "ProxyInfo", "pkixac.ProxyInfo",
602 FT_UINT32, BASE_DEC, NULL, 0,
603 NULL, HFILL }},
604 { &hf_pkixac_digestedObjectType,
605 { "digestedObjectType", "pkixac.digestedObjectType",
606 FT_UINT32, BASE_DEC, VALS(pkixac_T_digestedObjectType_vals), 0,
607 NULL, HFILL }},
608 { &hf_pkixac_otherObjectTypeID,
609 { "otherObjectTypeID", "pkixac.otherObjectTypeID",
610 FT_OID, BASE_NONE, NULL, 0,
611 "OBJECT_IDENTIFIER", HFILL }},
612 { &hf_pkixac_digestAlgorithm,
613 { "digestAlgorithm", "pkixac.digestAlgorithm_element",
614 FT_NONE, BASE_NONE, NULL, 0,
615 "AlgorithmIdentifier", HFILL }},
616 { &hf_pkixac_objectDigest,
617 { "objectDigest", "pkixac.objectDigest",
618 FT_BYTES, BASE_NONE, NULL, 0,
619 "BIT_STRING", HFILL }},
620 { &hf_pkixac_issuer,
621 { "issuer", "pkixac.issuer",
622 FT_UINT32, BASE_DEC, NULL, 0,
623 "GeneralNames", HFILL }},
624 { &hf_pkixac_serial,
625 { "serial", "pkixac.serial",
626 FT_INT32, BASE_DEC, NULL, 0,
627 "CertificateSerialNumber", HFILL }},
628 { &hf_pkixac_issuerUID,
629 { "issuerUID", "pkixac.issuerUID",
630 FT_BYTES, BASE_NONE, NULL, 0,
631 "UniqueIdentifier", HFILL }},
632 { &hf_pkixac_Targets_item,
633 { "Target", "pkixac.Target",
634 FT_UINT32, BASE_DEC, VALS(pkixac_Target_vals), 0,
635 NULL, HFILL }},
636 { &hf_pkixac_targetName,
637 { "targetName", "pkixac.targetName",
638 FT_UINT32, BASE_DEC, NULL, 0,
639 "GeneralName", HFILL }},
640 { &hf_pkixac_targetGroup,
641 { "targetGroup", "pkixac.targetGroup",
642 FT_UINT32, BASE_DEC, NULL, 0,
643 "GeneralName", HFILL }},
644 { &hf_pkixac_targetCert,
645 { "targetCert", "pkixac.targetCert_element",
646 FT_NONE, BASE_NONE, NULL, 0,
647 NULL, HFILL }},
648 { &hf_pkixac_targetCertificate,
649 { "targetCertificate", "pkixac.targetCertificate_element",
650 FT_NONE, BASE_NONE, NULL, 0,
651 "IssuerSerial", HFILL }},
652 { &hf_pkixac_certDigestInfo,
653 { "certDigestInfo", "pkixac.certDigestInfo_element",
654 FT_NONE, BASE_NONE, NULL, 0,
655 "ObjectDigestInfo", HFILL }},
656 { &hf_pkixac_policyAuthority,
657 { "policyAuthority", "pkixac.policyAuthority",
658 FT_UINT32, BASE_DEC, NULL, 0,
659 "GeneralNames", HFILL }},
660 { &hf_pkixac_values,
661 { "values", "pkixac.values",
662 FT_UINT32, BASE_DEC, NULL, 0,
663 NULL, HFILL }},
664 { &hf_pkixac_values_item,
665 { "values item", "pkixac.values_item",
666 FT_UINT32, BASE_DEC, VALS(pkixac_T_values_item_vals), 0,
667 NULL, HFILL }},
668 { &hf_pkixac_octets,
669 { "octets", "pkixac.octets",
670 FT_BYTES, BASE_NONE, NULL, 0,
671 "OCTET_STRING", HFILL }},
672 { &hf_pkixac_oid,
673 { "oid", "pkixac.oid",
674 FT_OID, BASE_NONE, NULL, 0,
675 "OBJECT_IDENTIFIER", HFILL }},
676 { &hf_pkixac_string,
677 { "string", "pkixac.string",
678 FT_STRING, BASE_NONE, NULL, 0,
679 "UTF8String", HFILL }},
680 { &hf_pkixac_service,
681 { "service", "pkixac.service",
682 FT_UINT32, BASE_DEC, NULL, 0,
683 "GeneralName", HFILL }},
684 { &hf_pkixac_ident,
685 { "ident", "pkixac.ident",
686 FT_UINT32, BASE_DEC, NULL, 0,
687 "GeneralName", HFILL }},
688 { &hf_pkixac_authInfo,
689 { "authInfo", "pkixac.authInfo",
690 FT_BYTES, BASE_NONE, NULL, 0,
691 "OCTET_STRING", HFILL }},
692 { &hf_pkixac_roleAuthority,
693 { "roleAuthority", "pkixac.roleAuthority",
694 FT_UINT32, BASE_DEC, NULL, 0,
695 "GeneralNames", HFILL }},
696 { &hf_pkixac_roleName,
697 { "roleName", "pkixac.roleName",
698 FT_UINT32, BASE_DEC, NULL, 0,
699 "GeneralName", HFILL }},
700 { &hf_pkixac_policyId,
701 { "policyId", "pkixac.policyId",
702 FT_OID, BASE_NONE, NULL, 0,
703 "OBJECT_IDENTIFIER", HFILL }},
704 { &hf_pkixac_classList,
705 { "classList", "pkixac.classList",
706 FT_BYTES, BASE_NONE, NULL, 0,
707 NULL, HFILL }},
708 { &hf_pkixac_securityCategories,
709 { "securityCategories", "pkixac.securityCategories",
710 FT_UINT32, BASE_DEC, NULL, 0,
711 "SET_OF_SecurityCategory", HFILL }},
712 { &hf_pkixac_securityCategories_item,
713 { "SecurityCategory", "pkixac.SecurityCategory_element",
714 FT_NONE, BASE_NONE, NULL, 0,
715 NULL, HFILL }},
716 { &hf_pkixac_type,
717 { "type", "pkixac.type",
718 FT_OID, BASE_NONE, NULL, 0,
719 NULL, HFILL }},
720 { &hf_pkixac_value,
721 { "value", "pkixac.value_element",
722 FT_NONE, BASE_NONE, NULL, 0,
723 NULL, HFILL }},
724 { &hf_pkixac_pathLenConstraint,
725 { "pathLenConstraint", "pkixac.pathLenConstraint",
726 FT_UINT64, BASE_DEC, NULL, 0,
727 "INTEGER_0_MAX", HFILL }},
728 { &hf_pkixac_permittedAttrs,
729 { "permittedAttrs", "pkixac.permittedAttrs",
730 FT_UINT32, BASE_DEC, NULL, 0,
731 "AttrSpec", HFILL }},
732 { &hf_pkixac_excludedAttrs,
733 { "excludedAttrs", "pkixac.excludedAttrs",
734 FT_UINT32, BASE_DEC, NULL, 0,
735 "AttrSpec", HFILL }},
736 { &hf_pkixac_permitUnSpecified,
737 { "permitUnSpecified", "pkixac.permitUnSpecified",
738 FT_BOOLEAN, BASE_NONE, NULL, 0,
739 "BOOLEAN", HFILL }},
740 { &hf_pkixac_AttrSpec_item,
741 { "AttrSpec item", "pkixac.AttrSpec_item",
742 FT_OID, BASE_NONE, NULL, 0,
743 "OBJECT_IDENTIFIER", HFILL }},
744 { &hf_pkixac_ProxyInfo_item,
745 { "Targets", "pkixac.Targets",
746 FT_UINT32, BASE_DEC, NULL, 0,
747 NULL, HFILL }},
748 { &hf_pkixac_ClassList_unmarked,
749 { "unmarked", "pkixac.ClassList.unmarked",
750 FT_BOOLEAN, 8, NULL, 0x80,
751 NULL, HFILL }},
752 { &hf_pkixac_ClassList_unclassified,
753 { "unclassified", "pkixac.ClassList.unclassified",
754 FT_BOOLEAN, 8, NULL, 0x40,
755 NULL, HFILL }},
756 { &hf_pkixac_ClassList_restricted,
757 { "restricted", "pkixac.ClassList.restricted",
758 FT_BOOLEAN, 8, NULL, 0x20,
759 NULL, HFILL }},
760 { &hf_pkixac_ClassList_confidential,
761 { "confidential", "pkixac.ClassList.confidential",
762 FT_BOOLEAN, 8, NULL, 0x10,
763 NULL, HFILL }},
764 { &hf_pkixac_ClassList_secret,
765 { "secret", "pkixac.ClassList.secret",
766 FT_BOOLEAN, 8, NULL, 0x08,
767 NULL, HFILL }},
768 { &hf_pkixac_ClassList_topSecret,
769 { "topSecret", "pkixac.ClassList.topSecret",
770 FT_BOOLEAN, 8, NULL, 0x04,
771 NULL, HFILL }},
774 /* List of subtrees */
775 static int *ett[] = {
776 &ett_pkixac,
777 &ett_pkixac_ObjectDigestInfo,
778 &ett_pkixac_IssuerSerial,
779 &ett_pkixac_Targets,
780 &ett_pkixac_Target,
781 &ett_pkixac_TargetCert,
782 &ett_pkixac_IetfAttrSyntax,
783 &ett_pkixac_T_values,
784 &ett_pkixac_T_values_item,
785 &ett_pkixac_SvceAuthInfo,
786 &ett_pkixac_RoleSyntax,
787 &ett_pkixac_Clearance,
788 &ett_pkixac_SET_OF_SecurityCategory,
789 &ett_pkixac_RFC3281Clearance,
790 &ett_pkixac_ClassList,
791 &ett_pkixac_SecurityCategory,
792 &ett_pkixac_AAControls,
793 &ett_pkixac_AttrSpec,
794 &ett_pkixac_ProxyInfo,
797 /* Register protocol */
798 proto_pkixac = proto_register_protocol(PNAME, PSNAME, PFNAME);
800 /* Register fields and subtrees */
801 proto_register_field_array(proto_pkixac, hf, array_length(hf));
802 proto_register_subtree_array(ett, array_length(ett));
804 /*--- Syntax registrations ---*/
805 register_ber_syntax_dissector("Clearance", proto_pkixac, dissect_Clearance_PDU);
806 register_ber_syntax_dissector("RFC3281Clearance", proto_pkixac, dissect_RFC3281Clearance_PDU);
811 /*--- proto_reg_handoff_pkixac -------------------------------------------*/
812 void proto_reg_handoff_pkixac(void) {
813 register_ber_oid_dissector("1.3.6.1.5.5.7.1.6", dissect_AAControls_PDU, proto_pkixac, "id-pe-aaControls");
814 register_ber_oid_dissector("1.3.6.1.5.5.7.1.10", dissect_ProxyInfo_PDU, proto_pkixac, "id-pe-ac-proxying");
815 register_ber_oid_dissector("1.3.6.1.5.5.7.10.1", dissect_SvceAuthInfo_PDU, proto_pkixac, "id-aca-authenticationInfo");
816 register_ber_oid_dissector("1.3.6.1.5.5.7.10.2", dissect_SvceAuthInfo_PDU, proto_pkixac, "id-aca-accessIdentity");
817 register_ber_oid_dissector("1.3.6.1.5.5.7.10.3", dissect_IetfAttrSyntax_PDU, proto_pkixac, "id-aca-chargingIdentity");
818 register_ber_oid_dissector("1.3.6.1.5.5.7.10.4", dissect_IetfAttrSyntax_PDU, proto_pkixac, "id-aca-group");
819 register_ber_oid_dissector("2.5.1.5.55", dissect_Clearance_PDU, proto_pkixac, "id-at-clearance");
820 register_ber_oid_dissector("2.5.4.55", dissect_Clearance_PDU, proto_pkixac, "id-at-clearance");
821 register_ber_oid_dissector("2.5.4.72", dissect_RoleSyntax_PDU, proto_pkixac, "id-at-role");
822 register_ber_oid_dissector("2.5.29.55", dissect_Targets_PDU, proto_pkixac, "id-ce-targetInformation");