Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-pkixproxy.c
blob13e9cd069ba71513004085c30952e5036738bc36
1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
3 /* packet-pkixproxy.c */
4 /* asn2wrs.py -b -q -L -p pkixproxy -c ./pkixproxy.cnf -s ./packet-pkixproxy-template -D . -O ../.. PKIXProxy.asn */
6 /* packet-pkixproxy.c
7 * Routines for RFC3820 PKIXProxy packet dissection
8 * Ronnie Sahlberg 2004
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * SPDX-License-Identifier: GPL-2.0-or-later
17 #include "config.h"
19 #include <epan/packet.h>
20 #include <epan/oids.h>
21 #include <epan/asn1.h>
22 #include <wsutil/array.h>
24 #include "packet-ber.h"
25 #include "packet-pkixproxy.h"
27 #define PNAME "PKIXProxy (RFC3820)"
28 #define PSNAME "PKIXPROXY"
29 #define PFNAME "pkixproxy"
31 void proto_register_pkixproxy(void);
32 void proto_reg_handoff_pkixproxy(void);
34 /* Initialize the protocol and registered fields */
35 static int proto_pkixproxy;
36 static int hf_pkixproxy_ProxyCertInfoExtension_PDU; /* ProxyCertInfoExtension */
37 static int hf_pkixproxy_pCPathLenConstraint; /* ProxyCertPathLengthConstraint */
38 static int hf_pkixproxy_proxyPolicy; /* ProxyPolicy */
39 static int hf_pkixproxy_policyLanguage; /* OBJECT_IDENTIFIER */
40 static int hf_pkixproxy_policy; /* OCTET_STRING */
42 /* Initialize the subtree pointers */
43 static int ett_pkixproxy_ProxyCertInfoExtension;
44 static int ett_pkixproxy_ProxyPolicy;
48 static int
49 dissect_pkixproxy_ProxyCertPathLengthConstraint(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
50 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
51 NULL);
53 return offset;
58 static int
59 dissect_pkixproxy_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_) {
60 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
62 return offset;
67 static int
68 dissect_pkixproxy_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_) {
69 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
70 NULL);
72 return offset;
76 static const ber_sequence_t ProxyPolicy_sequence[] = {
77 { &hf_pkixproxy_policyLanguage, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixproxy_OBJECT_IDENTIFIER },
78 { &hf_pkixproxy_policy , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixproxy_OCTET_STRING },
79 { NULL, 0, 0, 0, NULL }
82 static int
83 dissect_pkixproxy_ProxyPolicy(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
84 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
85 ProxyPolicy_sequence, hf_index, ett_pkixproxy_ProxyPolicy);
87 return offset;
91 static const ber_sequence_t ProxyCertInfoExtension_sequence[] = {
92 { &hf_pkixproxy_pCPathLenConstraint, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixproxy_ProxyCertPathLengthConstraint },
93 { &hf_pkixproxy_proxyPolicy, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixproxy_ProxyPolicy },
94 { NULL, 0, 0, 0, NULL }
97 static int
98 dissect_pkixproxy_ProxyCertInfoExtension(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
99 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
100 ProxyCertInfoExtension_sequence, hf_index, ett_pkixproxy_ProxyCertInfoExtension);
102 return offset;
105 /*--- PDUs ---*/
107 static int dissect_ProxyCertInfoExtension_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
108 int offset = 0;
109 asn1_ctx_t asn1_ctx;
110 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, true, pinfo);
111 offset = dissect_pkixproxy_ProxyCertInfoExtension(false, tvb, offset, &asn1_ctx, tree, hf_pkixproxy_ProxyCertInfoExtension_PDU);
112 return offset;
117 /*--- proto_register_pkixproxy ----------------------------------------------*/
118 void proto_register_pkixproxy(void) {
120 /* List of fields */
121 static hf_register_info hf[] = {
122 { &hf_pkixproxy_ProxyCertInfoExtension_PDU,
123 { "ProxyCertInfoExtension", "pkixproxy.ProxyCertInfoExtension_element",
124 FT_NONE, BASE_NONE, NULL, 0,
125 NULL, HFILL }},
126 { &hf_pkixproxy_pCPathLenConstraint,
127 { "pCPathLenConstraint", "pkixproxy.pCPathLenConstraint",
128 FT_INT32, BASE_DEC, NULL, 0,
129 "ProxyCertPathLengthConstraint", HFILL }},
130 { &hf_pkixproxy_proxyPolicy,
131 { "proxyPolicy", "pkixproxy.proxyPolicy_element",
132 FT_NONE, BASE_NONE, NULL, 0,
133 NULL, HFILL }},
134 { &hf_pkixproxy_policyLanguage,
135 { "policyLanguage", "pkixproxy.policyLanguage",
136 FT_OID, BASE_NONE, NULL, 0,
137 "OBJECT_IDENTIFIER", HFILL }},
138 { &hf_pkixproxy_policy,
139 { "policy", "pkixproxy.policy",
140 FT_BYTES, BASE_NONE, NULL, 0,
141 "OCTET_STRING", HFILL }},
144 /* List of subtrees */
145 static int *ett[] = {
146 &ett_pkixproxy_ProxyCertInfoExtension,
147 &ett_pkixproxy_ProxyPolicy,
150 /* Register protocol */
151 proto_pkixproxy = proto_register_protocol(PNAME, PSNAME, PFNAME);
153 /* Register fields and subtrees */
154 proto_register_field_array(proto_pkixproxy, hf, array_length(hf));
155 proto_register_subtree_array(ett, array_length(ett));
160 /*--- proto_reg_handoff_pkixproxy -------------------------------------------*/
161 void proto_reg_handoff_pkixproxy(void) {
162 register_ber_oid_dissector("1.3.6.1.5.5.7.1.14", dissect_ProxyCertInfoExtension_PDU, proto_pkixproxy, "id-pe-proxyCertInfo");
164 oid_add_from_string("id-ppl-anyLanguage","1.3.6.1.5.5.7.21.0");
165 oid_add_from_string("id-ppl-inheritAll","1.3.6.1.5.5.7.21.1");
166 oid_add_from_string("id-ppl-independent","1.3.6.1.5.5.7.21.2");