2006-05-23 15:17:14 +00:00
|
|
|
#define BER_UNI_TAG_TeletexString 20 /* workaround bug in asn2wrs */
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
/* packet-pkix1explicit.c
|
|
|
|
* Routines for PKIX1Explitic packet dissection
|
|
|
|
*
|
2004-10-05 09:18:55 +00:00
|
|
|
* $Id$
|
2004-09-16 08:58:28 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-09-16 08:58:28 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-09-16 08:58:28 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 01:29:52 +00:00
|
|
|
#include "config.h"
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <epan/packet.h>
|
2007-05-13 20:58:29 +00:00
|
|
|
#include <epan/asn1.h>
|
2008-02-25 22:17:24 +00:00
|
|
|
#include <epan/oids.h>
|
2008-02-27 16:13:57 +00:00
|
|
|
#include <epan/afn.h>
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
#include "packet-ber.h"
|
|
|
|
#include "packet-pkix1explicit.h"
|
|
|
|
#include "packet-x509af.h"
|
|
|
|
#include "packet-x509if.h"
|
2004-11-29 08:43:19 +00:00
|
|
|
#include "packet-x509ce.h"
|
2004-09-16 08:58:28 +00:00
|
|
|
|
2008-03-17 23:19:49 +00:00
|
|
|
#define PNAME "PKIX1Explicit"
|
2004-09-16 08:58:28 +00:00
|
|
|
#define PSNAME "PKIX1EXPLICIT"
|
|
|
|
#define PFNAME "pkix1explicit"
|
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_pkix1explicit = -1;
|
2004-11-29 08:43:19 +00:00
|
|
|
static int hf_pkix1explicit_object_identifier_id = -1;
|
2008-02-27 16:13:57 +00:00
|
|
|
static int hf_pkix1explicit_addressFamily_afn = -1;
|
|
|
|
static int hf_pkix1explicit_addressFamily_safi = -1;
|
|
|
|
|
|
|
|
static int ett_pkix1explicit_addressFamily = -1;
|
|
|
|
|
2004-09-16 08:58:28 +00:00
|
|
|
#include "packet-pkix1explicit-hf.c"
|
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
#include "packet-pkix1explicit-ett.c"
|
|
|
|
|
|
|
|
|
2005-11-14 10:02:31 +00:00
|
|
|
static const char *object_identifier_id;
|
2004-11-29 08:43:19 +00:00
|
|
|
|
2004-12-24 12:16:27 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509af_Certificate(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-12-24 12:16:27 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_CertificateList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509af_CertificateList(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-12-24 12:16:27 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
2004-09-16 08:58:28 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_GeneralName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509ce_GeneralName(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_Name(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509if_Name(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
2004-09-17 23:23:40 +00:00
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_AlgorithmIdentifier(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-05-13 20:58:29 +00:00
|
|
|
dissect_pkix1explicit_SubjectPublicKeyInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_, proto_tree *tree, int hf_index) {
|
|
|
|
offset = dissect_x509af_SubjectPublicKeyInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
|
2004-09-16 08:58:28 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "packet-pkix1explicit-fn.c"
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_register_pkix1explicit ----------------------------------------------*/
|
|
|
|
void proto_register_pkix1explicit(void) {
|
|
|
|
|
|
|
|
/* List of fields */
|
|
|
|
static hf_register_info hf[] = {
|
2008-03-17 23:19:49 +00:00
|
|
|
{ &hf_pkix1explicit_object_identifier_id,
|
2004-11-29 08:43:19 +00:00
|
|
|
{ "Id", "pkix1explicit.id", FT_STRING, BASE_NONE, NULL, 0,
|
|
|
|
"Object identifier Id", HFILL }},
|
2008-02-27 16:13:57 +00:00
|
|
|
|
2008-03-17 23:19:49 +00:00
|
|
|
{ &hf_pkix1explicit_addressFamily_afn,
|
2008-02-27 16:13:57 +00:00
|
|
|
{ "Address family(AFN)", "pkix1explicit.addressfamily", FT_UINT16, BASE_DEC, VALS(afn_vals), 0,
|
2009-06-23 06:02:12 +00:00
|
|
|
NULL, HFILL }},
|
2008-02-27 16:13:57 +00:00
|
|
|
|
2008-03-17 23:19:49 +00:00
|
|
|
{ &hf_pkix1explicit_addressFamily_safi,
|
2008-02-27 16:13:57 +00:00
|
|
|
{ "Subsequent Address Family Identifiers (SAFI)", "pkix1explicit.addressfamily.safi", FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
"Subsequent Address Family Identifiers (SAFI) RFC4760", HFILL }},
|
2004-09-16 08:58:28 +00:00
|
|
|
#include "packet-pkix1explicit-hfarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
/* List of subtrees */
|
|
|
|
static gint *ett[] = {
|
2008-02-27 16:13:57 +00:00
|
|
|
&ett_pkix1explicit_addressFamily,
|
2004-09-16 08:58:28 +00:00
|
|
|
#include "packet-pkix1explicit-ettarr.c"
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Register protocol */
|
|
|
|
proto_pkix1explicit = proto_register_protocol(PNAME, PSNAME, PFNAME);
|
|
|
|
|
|
|
|
/* Register fields and subtrees */
|
|
|
|
proto_register_field_array(proto_pkix1explicit, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*--- proto_reg_handoff_pkix1explicit -------------------------------------------*/
|
|
|
|
void proto_reg_handoff_pkix1explicit(void) {
|
2008-02-25 22:17:24 +00:00
|
|
|
oid_add_from_string("id-pkix","1.3.6.1.5.5.7");
|
2012-04-09 15:00:23 +00:00
|
|
|
oid_add_from_string("id-dsa-with-sha1","1.2.840.10040.4.3");
|
2004-11-01 18:11:48 +00:00
|
|
|
#include "packet-pkix1explicit-dis-tab.c"
|
2004-09-16 08:58:28 +00:00
|
|
|
}
|
|
|
|
|