1 #define BER_UNI_TAG_TeletexString 20 /* workaround bug in asn2wrs */
3 /* packet-pkix1explicit.c
4 * Routines for PKIX1Explitic packet dissection
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/asn1.h>
32 #include <epan/oids.h>
35 #include "packet-ber.h"
36 #include "packet-pkix1explicit.h"
37 #include "packet-x509af.h"
38 #include "packet-x509if.h"
39 #include "packet-x509ce.h"
41 #define PNAME "PKIX1Explicit"
42 #define PSNAME "PKIX1EXPLICIT"
43 #define PFNAME "pkix1explicit"
45 /* Initialize the protocol and registered fields */
46 static int proto_pkix1explicit
= -1;
47 static int hf_pkix1explicit_object_identifier_id
= -1;
48 static int hf_pkix1explicit_addressFamily_afn
= -1;
49 static int hf_pkix1explicit_addressFamily_safi
= -1;
51 static int ett_pkix1explicit_addressFamily
= -1;
53 #include "packet-pkix1explicit-hf.c"
55 /* Initialize the subtree pointers */
56 #include "packet-pkix1explicit-ett.c"
59 static const char *object_identifier_id
;
62 dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
63 offset
= dissect_x509af_Certificate(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
68 dissect_pkix1explicit_CertificateList(gboolean implicit_tag _U_
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
69 offset
= dissect_x509af_CertificateList(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
74 dissect_pkix1explicit_GeneralName(gboolean implicit_tag _U_
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
75 offset
= dissect_x509ce_GeneralName(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
80 dissect_pkix1explicit_Name(gboolean implicit_tag _U_
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
81 offset
= dissect_x509if_Name(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
86 dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag _U_
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
87 offset
= dissect_x509af_AlgorithmIdentifier(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
93 dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag
, tvbuff_t
*tvb
, int offset
, asn1_ctx_t
*actx _U_
, proto_tree
*tree
, int hf_index
) {
94 offset
= dissect_x509af_SubjectPublicKeyInfo(implicit_tag
, tvb
, offset
, actx
, tree
, hf_index
);
100 #include "packet-pkix1explicit-fn.c"
103 /*--- proto_register_pkix1explicit ----------------------------------------------*/
104 void proto_register_pkix1explicit(void) {
107 static hf_register_info hf
[] = {
108 { &hf_pkix1explicit_object_identifier_id
,
109 { "Id", "pkix1explicit.id", FT_STRING
, BASE_NONE
, NULL
, 0,
110 "Object identifier Id", HFILL
}},
112 { &hf_pkix1explicit_addressFamily_afn
,
113 { "Address family(AFN)", "pkix1explicit.addressfamily", FT_UINT16
, BASE_DEC
, VALS(afn_vals
), 0,
116 { &hf_pkix1explicit_addressFamily_safi
,
117 { "Subsequent Address Family Identifiers (SAFI)", "pkix1explicit.addressfamily.safi", FT_UINT16
, BASE_DEC
, NULL
, 0,
118 "Subsequent Address Family Identifiers (SAFI) RFC4760", HFILL
}},
119 #include "packet-pkix1explicit-hfarr.c"
122 /* List of subtrees */
123 static gint
*ett
[] = {
124 &ett_pkix1explicit_addressFamily
,
125 #include "packet-pkix1explicit-ettarr.c"
128 /* Register protocol */
129 proto_pkix1explicit
= proto_register_protocol(PNAME
, PSNAME
, PFNAME
);
131 /* Register fields and subtrees */
132 proto_register_field_array(proto_pkix1explicit
, hf
, array_length(hf
));
133 proto_register_subtree_array(ett
, array_length(ett
));
138 /*--- proto_reg_handoff_pkix1explicit -------------------------------------------*/
139 void proto_reg_handoff_pkix1explicit(void) {
140 oid_add_from_string("id-pkix","1.3.6.1.5.5.7");
141 oid_add_from_string("id-dsa-with-sha1","1.2.840.10040.4.3");
142 #include "packet-pkix1explicit-dis-tab.c"