diff options
author | Gerald Combs <gerald@wireshark.org> | 2004-08-15 18:32:24 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2004-08-15 18:32:24 +0000 |
commit | 85f3fff1efcbbf2ab25f2bb0978e5257fcab9116 (patch) | |
tree | dfbdb2122ede9fc6f55419754314222c160fb41d /asn1/ns-cert-exts | |
parent | 4bd2d5b0bea9462aae339d36d7645f669b09c86d (diff) | |
download | wireshark-85f3fff1efcbbf2ab25f2bb0978e5257fcab9116.tar.gz |
From Ronnie Sahlberg: Netscape certificate extensions.
svn path=/trunk/; revision=11743
Diffstat (limited to 'asn1/ns-cert-exts')
-rw-r--r-- | asn1/ns-cert-exts/NETSCAPE-CERT-EXTS.asn | 28 | ||||
-rw-r--r-- | asn1/ns-cert-exts/ns_cert_exts.cnf | 18 | ||||
-rw-r--r-- | asn1/ns-cert-exts/packet-ns_cert_exts-template.c | 173 | ||||
-rw-r--r-- | asn1/ns-cert-exts/packet-ns_cert_exts-template.h | 31 |
4 files changed, 250 insertions, 0 deletions
diff --git a/asn1/ns-cert-exts/NETSCAPE-CERT-EXTS.asn b/asn1/ns-cert-exts/NETSCAPE-CERT-EXTS.asn new file mode 100644 index 0000000000..c541bdef14 --- /dev/null +++ b/asn1/ns-cert-exts/NETSCAPE-CERT-EXTS.asn @@ -0,0 +1,28 @@ +-- NetScape Certificate Extensions +-- based on information from http://wp.netscape.com/eng/security/cert-exts.html + +NS-CERT-EXTS { 2 16 840 1 113730 1 } DEFINITIONS EXPLICIT TAGS ::= +BEGIN + +BaseUrl ::= IA5String + +RevocationUrl ::= IA5String + +CaRevocationUrl ::= IA5String + +CaPolicyUrl ::= IA5String + +Comment ::= IA5String + +SslServerName ::= IA5String + +CertRenewalUrl ::= IA5String + +CertType ::= BIT STRING { + client(0), + server(1), + ca(5) +} + +END -- of NS-CERT-EXTS + diff --git a/asn1/ns-cert-exts/ns_cert_exts.cnf b/asn1/ns-cert-exts/ns_cert_exts.cnf new file mode 100644 index 0000000000..a3b4c0d605 --- /dev/null +++ b/asn1/ns-cert-exts/ns_cert_exts.cnf @@ -0,0 +1,18 @@ +# NS-CERT-EXT.cnf
+# NetScape Certificate Extensions conformation file
+
+# $Id: cms.cnf,v 1.2 2004/06/03 08:35:44 guy Exp $
+
+#.MODULE_IMPORT
+
+#.EXPORTS
+
+#.NO_EMIT
+
+#.TYPE_RENAME
+
+#.FIELD_RENAME
+
+#.END
+
+
diff --git a/asn1/ns-cert-exts/packet-ns_cert_exts-template.c b/asn1/ns-cert-exts/packet-ns_cert_exts-template.c new file mode 100644 index 0000000000..df3eb8bf40 --- /dev/null +++ b/asn1/ns-cert-exts/packet-ns_cert_exts-template.c @@ -0,0 +1,173 @@ +/* packet-ns_cert_exts.c + * Routines for NetScape Certificate Extensions packet dissection + * + * $Id: packet-ns_cert_exts-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * 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 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" + +#define PNAME "NetScape Certificate Extensions" +#define PSNAME "NS_CERT_EXTS" +#define PFNAME "ns_cert_exts" + +/* Initialize the protocol and registered fields */ +int proto_ns_cert_exts = -1; +static int hf_ns_cert_exts_comment = -1; +static int hf_ns_cert_exts_ssl_server_name = -1; +static int hf_ns_cert_exts_ca_policy_url = -1; +static int hf_ns_cert_exts_cert_renewal_url = -1; +static int hf_ns_cert_exts_ca_revocation_url = -1; +static int hf_ns_cert_exts_revocation_url = -1; +static int hf_ns_cert_exts_base_url = -1; +static int hf_ns_cert_exts_cert_type = -1; +#include "packet-ns_cert_exts-hf.c" + +/* Initialize the subtree pointers */ +#include "packet-ns_cert_exts-ett.c" + +#include "packet-ns_cert_exts-fn.c" + + +static void +dissect_ns_cert_exts_cert_type_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_CertType(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_cert_type); +} + +static void +dissect_ns_cert_exts_base_url_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_BaseUrl(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_base_url); +} + +static void +dissect_ns_cert_exts_revocation_url_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_RevocationUrl(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_revocation_url); +} + +static void +dissect_ns_cert_exts_ca_revocation_url_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_CaRevocationUrl(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_ca_revocation_url); +} + +static void +dissect_ns_cert_exts_cert_renewal_url_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_CertRenewalUrl(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_cert_renewal_url); +} + +static void +dissect_ns_cert_exts_ca_policy_url_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_CaPolicyUrl(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_ca_policy_url); +} + +static void +dissect_ns_cert_exts_ssl_server_name_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_SslServerName(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_ssl_server_name); +} + +static void +dissect_ns_cert_exts_comment_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_ns_cert_exts_Comment(FALSE, tvb, 0, pinfo, tree, hf_ns_cert_exts_comment); +} +/*--- proto_register_ns_cert_exts -------------------------------------------*/ +void proto_register_ns_cert_exts(void) { + + /* List of fields */ + static hf_register_info hf[] = { + { &hf_ns_cert_exts_cert_type, + { "Cert Type", "ns_cert_exts.cert-type", + FT_BYTES, BASE_HEX, NULL, 0, + "Cert Type", HFILL }}, + { &hf_ns_cert_exts_base_url, + { "Base URL", "ns_cert_exts.base-url", + FT_STRING, BASE_NONE, NULL, 0, + "Base URL", HFILL }}, + { &hf_ns_cert_exts_revocation_url, + { "Revocation URL", "ns_cert_exts.revocation-url", + FT_STRING, BASE_NONE, NULL, 0, + "Revocation URL", HFILL }}, + { &hf_ns_cert_exts_ca_revocation_url, + { "CA Revocation URL", "ns_cert_exts.ca-revocation-url", + FT_STRING, BASE_NONE, NULL, 0, + "CA Revocation URL", HFILL }}, + { &hf_ns_cert_exts_cert_renewal_url, + { "Cert Renewal URL", "ns_cert_exts.cert-renewal-url", + FT_STRING, BASE_NONE, NULL, 0, + "Cert Renewal URL", HFILL }}, + { &hf_ns_cert_exts_ca_policy_url, + { "CA Policy URL", "ns_cert_exts.ca-policy-url", + FT_STRING, BASE_NONE, NULL, 0, + "CA Policy URL", HFILL }}, + { &hf_ns_cert_exts_ssl_server_name, + { "SSL Server name", "ns_cert_exts.ssl-server-name", + FT_STRING, BASE_NONE, NULL, 0, + "SSL server Name", HFILL }}, + { &hf_ns_cert_exts_comment, + { "Comment", "ns_cert_exts.comment", + FT_STRING, BASE_NONE, NULL, 0, + "Comment", HFILL }}, +#include "packet-ns_cert_exts-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { +#include "packet-ns_cert_exts-ettarr.c" + }; + + /* Register protocol */ + proto_ns_cert_exts = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_ns_cert_exts, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_ns_cert_exts ---------------------------------------*/ +void proto_reg_handoff_ns_cert_exts(void) { + register_ber_oid_dissector("2.16.840.1.113730.1.1", dissect_ns_cert_exts_cert_type_callback, proto_ns_cert_exts, "ns-cert-exts.cert_type"); + register_ber_oid_dissector("2.16.840.1.113730.1.2", dissect_ns_cert_exts_base_url_callback, proto_ns_cert_exts, "ns-cert-exts.base_url"); + register_ber_oid_dissector("2.16.840.1.113730.1.3", dissect_ns_cert_exts_revocation_url_callback, proto_ns_cert_exts, "ns-cert-exts.revocation-url"); + register_ber_oid_dissector("2.16.840.1.113730.1.4", dissect_ns_cert_exts_ca_revocation_url_callback, proto_ns_cert_exts, "ns-cert-exts.ca-revocation-url"); + register_ber_oid_dissector("2.16.840.1.113730.1.7", dissect_ns_cert_exts_cert_renewal_url_callback, proto_ns_cert_exts, "ns-cert-exts.cert-renewal-url"); + register_ber_oid_dissector("2.16.840.1.113730.1.8", dissect_ns_cert_exts_ca_policy_url_callback, proto_ns_cert_exts, "ns-cert-exts.ca-policy-url"); + register_ber_oid_dissector("2.16.840.1.113730.1.12", dissect_ns_cert_exts_ssl_server_name_callback, proto_ns_cert_exts, "ns-cert-exts.ssl-server-name"); + register_ber_oid_dissector("2.16.840.1.113730.1.13", dissect_ns_cert_exts_comment_callback, proto_ns_cert_exts, "ns-cert-exts.comment"); +} + diff --git a/asn1/ns-cert-exts/packet-ns_cert_exts-template.h b/asn1/ns-cert-exts/packet-ns_cert_exts-template.h new file mode 100644 index 0000000000..8a72c72fff --- /dev/null +++ b/asn1/ns-cert-exts/packet-ns_cert_exts-template.h @@ -0,0 +1,31 @@ +/* packet-ns-cert-exts.h + * Routines for NetScape Certificate Extensions packet dissection + * + * $Id: packet-cms-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * 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 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_NS_CERT_EXTS_H +#define PACKET_NS_CERT_EXTS_H + +#include "packet-ns-cert-exts-exp.h" + +#endif /* PACKET_NS_CERT_EXTS_H */ + |