2 * Routines for X.509 Certificate Extensions packet dissection
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #include <epan/packet.h>
32 #include <epan/conversation.h>
37 #include "packet-ber.h"
38 #include "packet-x509ce.h"
39 #include "packet-x509af.h"
40 #include "packet-x509if.h"
41 #include "packet-x509sat.h"
42 #include "packet-x411.h"
44 #define PNAME "X.509 Certificate Extensions"
45 #define PSNAME "X509CE"
46 #define PFNAME "x509ce"
48 /* Initialize the protocol and registered fields */
49 int proto_x509ce = -1;
50 static int hf_x509ce_id_ce_invalidityDate = -1;
51 static int hf_x509ce_id_ce_baseUpdateTime = -1;
52 static int hf_x509ce_object_identifier_id = -1;
53 static int hf_x509ce_IPAddress = -1;
54 #include "packet-x509ce-hf.c"
56 /* Initialize the subtree pointers */
57 #include "packet-x509ce-ett.c"
59 static const char *object_identifier_id;
61 #include "packet-x509ce-fn.c"
65 dissect_x509ce_invalidityDate_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
67 dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, pinfo, tree, hf_x509ce_id_ce_invalidityDate);
71 dissect_x509ce_baseUpdateTime_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
73 dissect_x509ce_GeneralizedTime(FALSE, tvb, 0, pinfo, tree, hf_x509ce_id_ce_baseUpdateTime);
76 /*--- proto_register_x509ce ----------------------------------------------*/
77 void proto_register_x509ce(void) {
80 static hf_register_info hf[] = {
81 { &hf_x509ce_id_ce_baseUpdateTime,
82 { "baseUpdateTime", "x509ce.id_ce_baseUpdateTime",
83 FT_STRING, BASE_NONE, NULL, 0,
84 "baseUpdateTime", HFILL }},
85 { &hf_x509ce_id_ce_invalidityDate,
86 { "invalidityDate", "x509ce.id_ce_invalidityDate",
87 FT_STRING, BASE_NONE, NULL, 0,
88 "invalidityDate", HFILL }},
89 { &hf_x509ce_object_identifier_id,
90 { "Id", "x509ce.id", FT_OID, BASE_NONE, NULL, 0,
91 "Object identifier Id", HFILL }},
92 { &hf_x509ce_IPAddress,
93 { "iPAddress", "x509ce.IPAddress", FT_IPv4, BASE_NONE, NULL, 0,
94 "IP Address", HFILL }},
96 #include "packet-x509ce-hfarr.c"
99 /* List of subtrees */
100 static gint *ett[] = {
101 #include "packet-x509ce-ettarr.c"
104 /* Register protocol */
105 proto_x509ce = proto_register_protocol(PNAME, PSNAME, PFNAME);
107 /* Register fields and subtrees */
108 proto_register_field_array(proto_x509ce, hf, array_length(hf));
109 proto_register_subtree_array(ett, array_length(ett));
114 /*--- proto_reg_handoff_x509ce -------------------------------------------*/
115 void proto_reg_handoff_x509ce(void) {
116 #include "packet-x509ce-dis-tab.c"
117 register_ber_oid_dissector("2.5.29.24", dissect_x509ce_invalidityDate_callback, proto_x509ce, "id-ce-invalidityDate");
118 register_ber_oid_dissector("2.5.29.51", dissect_x509ce_baseUpdateTime_callback, proto_x509ce, "id-ce-baseUpdateTime");