1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
3 /* ./packet-pkixproxy.c */
4 /* ../../tools/asn2wrs.py -b -e -p pkixproxy -c pkixproxy.cnf -s packet-pkixproxy-template PKIXProxy.asn */
6 /* Input file: packet-pkixproxy-template.c */
8 #line 1 "packet-pkixproxy-template.c"
10 * Routines for RFC3820 PKIXProxy packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
40 #include <epan/oids.h>
41 #include <epan/asn1.h>
46 #include "packet-ber.h"
47 #include "packet-pkixproxy.h"
49 #define PNAME "PKIXProxy (RFC3820)"
50 #define PSNAME "PKIXPROXY"
51 #define PFNAME "pkixproxy"
53 /* Initialize the protocol and registered fields */
54 static int proto_pkixproxy = -1;
56 /*--- Included file: packet-pkixproxy-hf.c ---*/
57 #line 1 "packet-pkixproxy-hf.c"
58 static int hf_pkixproxy_ProxyCertInfoExtension_PDU = -1; /* ProxyCertInfoExtension */
59 static int hf_pkixproxy_pCPathLenConstraint = -1; /* ProxyCertPathLengthConstraint */
60 static int hf_pkixproxy_proxyPolicy = -1; /* ProxyPolicy */
61 static int hf_pkixproxy_policyLanguage = -1; /* OBJECT_IDENTIFIER */
62 static int hf_pkixproxy_policy = -1; /* OCTET_STRING */
64 /*--- End of included file: packet-pkixproxy-hf.c ---*/
65 #line 48 "packet-pkixproxy-template.c"
67 /* Initialize the subtree pointers */
69 /*--- Included file: packet-pkixproxy-ett.c ---*/
70 #line 1 "packet-pkixproxy-ett.c"
71 static gint ett_pkixproxy_ProxyCertInfoExtension = -1;
72 static gint ett_pkixproxy_ProxyPolicy = -1;
74 /*--- End of included file: packet-pkixproxy-ett.c ---*/
75 #line 51 "packet-pkixproxy-template.c"
78 /*--- Included file: packet-pkixproxy-fn.c ---*/
79 #line 1 "packet-pkixproxy-fn.c"
80 /*--- Fields for imported types ---*/
86 dissect_pkixproxy_ProxyCertPathLengthConstraint(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
87 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
92 static int dissect_pCPathLenConstraint(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
93 return dissect_pkixproxy_ProxyCertPathLengthConstraint(FALSE, tvb, offset, actx, tree, hf_pkixproxy_pCPathLenConstraint);
99 dissect_pkixproxy_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
100 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
104 static int dissect_policyLanguage(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
105 return dissect_pkixproxy_OBJECT_IDENTIFIER(FALSE, tvb, offset, actx, tree, hf_pkixproxy_policyLanguage);
111 dissect_pkixproxy_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_) {
112 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
117 static int dissect_policy(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
118 return dissect_pkixproxy_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_pkixproxy_policy);
122 static const ber_old_sequence_t ProxyPolicy_sequence[] = {
123 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_policyLanguage },
124 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_policy },
129 dissect_pkixproxy_ProxyPolicy(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
130 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
131 ProxyPolicy_sequence, hf_index, ett_pkixproxy_ProxyPolicy);
135 static int dissect_proxyPolicy(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
136 return dissect_pkixproxy_ProxyPolicy(FALSE, tvb, offset, actx, tree, hf_pkixproxy_proxyPolicy);
140 static const ber_old_sequence_t ProxyCertInfoExtension_sequence[] = {
141 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pCPathLenConstraint },
142 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_proxyPolicy },
147 dissect_pkixproxy_ProxyCertInfoExtension(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
148 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
149 ProxyCertInfoExtension_sequence, hf_index, ett_pkixproxy_ProxyCertInfoExtension);
156 static void dissect_ProxyCertInfoExtension_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
158 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
159 dissect_pkixproxy_ProxyCertInfoExtension(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkixproxy_ProxyCertInfoExtension_PDU);
163 /*--- End of included file: packet-pkixproxy-fn.c ---*/
164 #line 53 "packet-pkixproxy-template.c"
167 /*--- proto_register_pkixproxy ----------------------------------------------*/
168 void proto_register_pkixproxy(void) {
171 static hf_register_info hf[] = {
173 /*--- Included file: packet-pkixproxy-hfarr.c ---*/
174 #line 1 "packet-pkixproxy-hfarr.c"
175 { &hf_pkixproxy_ProxyCertInfoExtension_PDU,
176 { "ProxyCertInfoExtension", "pkixproxy.ProxyCertInfoExtension",
177 FT_NONE, BASE_NONE, NULL, 0,
178 "pkixproxy.ProxyCertInfoExtension", HFILL }},
179 { &hf_pkixproxy_pCPathLenConstraint,
180 { "pCPathLenConstraint", "pkixproxy.pCPathLenConstraint",
181 FT_INT32, BASE_DEC, NULL, 0,
182 "pkixproxy.ProxyCertPathLengthConstraint", HFILL }},
183 { &hf_pkixproxy_proxyPolicy,
184 { "proxyPolicy", "pkixproxy.proxyPolicy",
185 FT_NONE, BASE_NONE, NULL, 0,
186 "pkixproxy.ProxyPolicy", HFILL }},
187 { &hf_pkixproxy_policyLanguage,
188 { "policyLanguage", "pkixproxy.policyLanguage",
189 FT_OID, BASE_NONE, NULL, 0,
190 "pkixproxy.OBJECT_IDENTIFIER", HFILL }},
191 { &hf_pkixproxy_policy,
192 { "policy", "pkixproxy.policy",
193 FT_BYTES, BASE_HEX, NULL, 0,
194 "pkixproxy.OCTET_STRING", HFILL }},
196 /*--- End of included file: packet-pkixproxy-hfarr.c ---*/
197 #line 61 "packet-pkixproxy-template.c"
200 /* List of subtrees */
201 static gint *ett[] = {
203 /*--- Included file: packet-pkixproxy-ettarr.c ---*/
204 #line 1 "packet-pkixproxy-ettarr.c"
205 &ett_pkixproxy_ProxyCertInfoExtension,
206 &ett_pkixproxy_ProxyPolicy,
208 /*--- End of included file: packet-pkixproxy-ettarr.c ---*/
209 #line 66 "packet-pkixproxy-template.c"
212 /* Register protocol */
213 proto_pkixproxy = proto_register_protocol(PNAME, PSNAME, PFNAME);
215 /* Register fields and subtrees */
216 proto_register_field_array(proto_pkixproxy, hf, array_length(hf));
217 proto_register_subtree_array(ett, array_length(ett));
222 /*--- proto_reg_handoff_pkixproxy -------------------------------------------*/
223 void proto_reg_handoff_pkixproxy(void) {
225 /*--- Included file: packet-pkixproxy-dis-tab.c ---*/
226 #line 1 "packet-pkixproxy-dis-tab.c"
227 register_ber_oid_dissector("1.3.6.1.5.5.7.1.14", dissect_ProxyCertInfoExtension_PDU, proto_pkixproxy, "id-pe-proxyCertInfo");
230 /*--- End of included file: packet-pkixproxy-dis-tab.c ---*/
231 #line 81 "packet-pkixproxy-template.c"
232 add_oid_str_name("1.3.6.1.5.5.7.21.0", "id-ppl-anyLanguage");
233 add_oid_str_name("1.3.6.1.5.5.7.21.1", "id-ppl-inheritAll");
234 add_oid_str_name("1.3.6.1.5.5.7.21.2", "id-ppl-independent");