diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-07-16 01:04:36 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-07-16 01:04:36 +0000 |
commit | ee55c8a608d5ac803b0dd700d1ca80a32056da28 (patch) | |
tree | 78ec7a6c9cacbad396a204a63c431dce97d5db4d | |
parent | aef7edb1d10de3f1482e31e2ec12d1906a545277 (diff) | |
download | wireshark-ee55c8a608d5ac803b0dd700d1ca80a32056da28.tar.gz |
new protocol
RFC3770 Wlan Certificate Extensions
svn path=/trunk/; revision=14935
-rw-r--r-- | asn1/wlancertextn/Makefile | 16 | ||||
-rw-r--r-- | asn1/wlancertextn/Makefile.nmake | 41 | ||||
-rw-r--r-- | asn1/wlancertextn/WLANCERTEXTN.asn | 93 | ||||
-rw-r--r-- | asn1/wlancertextn/packet-wlancertextn-template.c | 86 | ||||
-rw-r--r-- | asn1/wlancertextn/packet-wlancertextn-template.h | 32 | ||||
-rw-r--r-- | asn1/wlancertextn/wlancertextn.cnf | 23 | ||||
-rw-r--r-- | epan/dissectors/Makefile.common | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-wlancertextn.c | 172 | ||||
-rw-r--r-- | epan/dissectors/packet-wlancertextn.h | 39 |
9 files changed, 504 insertions, 0 deletions
diff --git a/asn1/wlancertextn/Makefile b/asn1/wlancertextn/Makefile new file mode 100644 index 0000000000..e51e9730dd --- /dev/null +++ b/asn1/wlancertextn/Makefile @@ -0,0 +1,16 @@ +# $Id: Makefile 13071 2005-01-16 10:19:21Z guy $ + +DISSECTOR_FILES=packet-wlancertextn.c packet-wlancertextn.h + +all: generate_dissector + +generate_dissector: $(DISSECTOR_FILES) + +$(DISSECTOR_FILES): ../../tools/asn2eth.py WLANCERTEXTN.asn packet-wlancertextn-template.c packet-wlancertextn-template.h wlancertextn.cnf + python ../../tools/asn2eth.py -X -b -e -p wlancertextn -c wlancertextn.cnf -s packet-wlancertextn-template WLANCERTEXTN.asn + +clean: + rm -f parsetab.py $(DISSECTOR_FILES) + +copy_files: generate_dissector + cp $(DISSECTOR_FILES) ../../epan/dissectors diff --git a/asn1/wlancertextn/Makefile.nmake b/asn1/wlancertextn/Makefile.nmake new file mode 100644 index 0000000000..88c348999b --- /dev/null +++ b/asn1/wlancertextn/Makefile.nmake @@ -0,0 +1,41 @@ +## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake +# +# $Id: Makefile.nmake 13077 2005-01-16 23:26:02Z lroland $ + +include ../../config.nmake + +UNIX2DOS=$(PERL) ../../tools/unix2dos.pl + +PROTOCOL_NAME=wlancertextn +DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h + +all: generate_dissector + +generate_dissector: $(DISSECTOR_FILES) + +$(DISSECTOR_FILES): ../../tools/asn2eth.py WLANCERTEXTN.asn packet-wlancertextn-template.c packet-wlancertextn-template.h wlancertextn.cnf +!IFDEF PYTHON + $(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c wlancertextn.cnf -s packet-wlancertextn-template WLANCERTEXTN.asn +!ELSE + @echo Error: You need Python to use asn2eth.py + @exit 1 +!ENDIF + +clean: + rm -f parsetab.py $(DISSECTOR_FILES) + +# Fix EOL in generated dissectors. Cygwin's python generates files with +# mixed EOL styles, which can't be commited to the SVN repository. +# Stuff included from template and "cnf" files has "\r\n" on windows, while +# the generated stuff has "\n". + +fix_eol: generate_dissector + move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp + move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp + $(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c + $(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h + del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp + +copy_files: generate_dissector fix_eol + xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y + xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y diff --git a/asn1/wlancertextn/WLANCERTEXTN.asn b/asn1/wlancertextn/WLANCERTEXTN.asn new file mode 100644 index 0000000000..52bda2c963 --- /dev/null +++ b/asn1/wlancertextn/WLANCERTEXTN.asn @@ -0,0 +1,93 @@ +-- ASN definitions taken from RFC3770 +-- Copyright notice from RFC3770 follows below +-- +-- RFC 3770 PPP and WLAN May 2004 +-- +-- 10. Full Copyright Statement +-- +-- Copyright (C) The Internet Society (2004). This document is subject +-- to the rights, licenses and restrictions contained in BCP 78, and +-- except as set forth therein, the authors retain all their rights. +-- +-- This document and the information contained herein are provided on an +-- "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS +-- OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET +-- ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, +-- INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE +-- INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED +-- WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +-- +-- Intellectual Property +-- +-- The IETF takes no position regarding the validity or scope of any +-- Intellectual Property Rights or other rights that might be claimed to +-- pertain to the implementation or use of the technology described in +-- this document or the extent to which any license under such rights +-- might or might not be available; nor does it represent that it has +-- made any independent effort to identify any such rights. Information +-- on the procedures with respect to rights in RFC documents can be +-- found in BCP 78 and BCP 79. +-- +-- Copies of IPR disclosures made to the IETF Secretariat and any +-- assurances of licenses to be made available, or the result of an +-- attempt made to obtain a general license or permission for the use of +-- such proprietary rights by implementers or users of this +-- specification can be obtained from the IETF on-line IPR repository at +-- http://www.ietf.org/ipr. +-- +-- The IETF invites any interested party to bring to its attention any +-- copyrights, patents or patent applications, or other proprietary +-- rights that may cover technology that may be required to implement +-- this standard. Please address the information to the IETF at ietf- +-- ipr@ietf.org. +-- +-- Acknowledgement +-- +-- Funding for the RFC Editor function is currently provided by the +-- Internet Society. +-- + + + WLANCertExtn + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) id-mod(0) + id-mod-wlan-extns(24) } + + DEFINITIONS IMPLICIT TAGS ::= + BEGIN + + -- OID Arcs + + id-pe OBJECT IDENTIFIER ::= + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) 1 } + + id-kp OBJECT IDENTIFIER ::= + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) 3 } + + id-aca OBJECT IDENTIFIER ::= + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) 10 } + + -- Extended Key Usage Values + + id-kp-eapOverPPP OBJECT IDENTIFIER ::= { id-kp 13 } + + id-kp-eapOverLAN OBJECT IDENTIFIER ::= { id-kp 14 } + + + -- Wireless LAN SSID Extension + + id-pe-wlanSSID OBJECT IDENTIFIER ::= { id-pe 13 } + + SSIDList ::= SEQUENCE SIZE (1..MAX) OF SSID + + SSID ::= OCTET STRING (SIZE (1..32)) + + -- Wireless LAN SSID Attribute Certificate Attribute + -- Uses same syntax as the certificate extension: SSIDList + + id-aca-wlanSSID OBJECT IDENTIFIER ::= { id-aca 6 } + + END diff --git a/asn1/wlancertextn/packet-wlancertextn-template.c b/asn1/wlancertextn/packet-wlancertextn-template.c new file mode 100644 index 0000000000..3dcd04b0e5 --- /dev/null +++ b/asn1/wlancertextn/packet-wlancertextn-template.c @@ -0,0 +1,86 @@ +/* packet-wlancertextn.c + * Routines for Wireless Certificate Extension (RFC3770) + * Ronnie Sahlberg 2005 + * + * $Id: packet-wlancertextn-template.c 12434 2004-10-29 12:11:42Z sahlberg $ + * + * 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" +#include "packet-wlancertextn.h" +#include "packet-x509af.h" +#include "packet-x509ce.h" +#include "packet-x509sat.h" + +#define PNAME "Wlan Certificate Extension" +#define PSNAME "WLANCERTEXTN" +#define PFNAME "wlancertextn" + +/* Initialize the protocol and registered fields */ +int proto_wlancertextn = -1; +#include "packet-wlancertextn-hf.c" + +/* Initialize the subtree pointers */ +#include "packet-wlancertextn-ett.c" + +#include "packet-wlancertextn-fn.c" + + +/*--- proto_register_wlancertextn ----------------------------------------------*/ +void proto_register_wlancertextn(void) { + + /* List of fields */ + static hf_register_info hf[] = { +#include "packet-wlancertextn-hfarr.c" + }; + + /* List of subtrees */ + static gint *ett[] = { +#include "packet-wlancertextn-ettarr.c" + }; + + /* Register protocol */ + proto_wlancertextn = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_wlancertextn, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_wlancertextn -------------------------------------------*/ +void proto_reg_handoff_wlancertextn(void) { +#include "packet-wlancertextn-dis-tab.c" + register_ber_oid_name("1.3.6.1.5.5.7.3.13","id-kp-eapOverPPP"); + register_ber_oid_name("1.3.6.1.5.5.7.3.14","id-kp-eapOverLAN"); +} + diff --git a/asn1/wlancertextn/packet-wlancertextn-template.h b/asn1/wlancertextn/packet-wlancertextn-template.h new file mode 100644 index 0000000000..8cfb3c4342 --- /dev/null +++ b/asn1/wlancertextn/packet-wlancertextn-template.h @@ -0,0 +1,32 @@ +/* packet-wlancertextn.h + * Routines for Wireless Certificate Extensions (RFC3770) packet dissection + * Ronnie Sahlberg 2005 + * + * $Id: packet-wlancertextn-template.h 12573 2004-11-22 03:36:26Z sahlberg $ + * + * 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_WLANCERTEXTN_H +#define PACKET_WLANCERTEXTN_H + +/*#include "packet-wlancertextn-exp.h"*/ + +#endif /* PACKET_WLANCERTEXTN_H */ + diff --git a/asn1/wlancertextn/wlancertextn.cnf b/asn1/wlancertextn/wlancertextn.cnf new file mode 100644 index 0000000000..d89c0849a0 --- /dev/null +++ b/asn1/wlancertextn/wlancertextn.cnf @@ -0,0 +1,23 @@ +# WlanCertExtn.cnf +# WlanCertExtn conformation file + +# $Id: WlanCertExtn.cnf 12434 2004-10-29 12:11:42Z sahlberg $ + +#.MODULE_IMPORT + +#.EXPORTS + +#.REGISTER + +SSIDList B "1.3.6.1.5.5.7.1.13" "id-pe-wlanSSID" +SSIDList B "1.3.6.1.5.5.7.10.6" "id-aca-wlanSSID" + +#.NO_EMIT + +#.TYPE_RENAME + +#.FIELD_RENAME + +#.END + + diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index ec19f01b4a..07692920ad 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -590,6 +590,7 @@ DISSECTOR_SRC = \ packet-who.c \ packet-windows-common.c \ packet-wlancap.c \ + packet-wlancertextn.c \ packet-wsp.c \ packet-wtls.c \ packet-wtp.c \ @@ -837,6 +838,7 @@ DISSECTOR_INCLUDES = \ packet-wccp.h \ packet-windows-common.h \ packet-wlancap.h \ + packet-wlancertextn.h \ packet-wsp.h \ packet-wtls.h \ packet-wtp.h \ diff --git a/epan/dissectors/packet-wlancertextn.c b/epan/dissectors/packet-wlancertextn.c new file mode 100644 index 0000000000..ab8f6a914f --- /dev/null +++ b/epan/dissectors/packet-wlancertextn.c @@ -0,0 +1,172 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* ./packet-wlancertextn.c */ +/* ../../tools/asn2eth.py -X -b -e -p wlancertextn -c wlancertextn.cnf -s packet-wlancertextn-template WLANCERTEXTN.asn */ + +/* Input file: packet-wlancertextn-template.c */ + +/* packet-wlancertextn.c + * Routines for Wireless Certificate Extension (RFC3770) + * Ronnie Sahlberg 2005 + * + * $Id: packet-wlancertextn-template.c 12434 2004-10-29 12:11:42Z sahlberg $ + * + * 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" +#include "packet-wlancertextn.h" +#include "packet-x509af.h" +#include "packet-x509ce.h" +#include "packet-x509sat.h" + +#define PNAME "Wlan Certificate Extension" +#define PSNAME "WLANCERTEXTN" +#define PFNAME "wlancertextn" + +/* Initialize the protocol and registered fields */ +int proto_wlancertextn = -1; + +/*--- Included file: packet-wlancertextn-hf.c ---*/ + +static int hf_wlancertextn_SSIDList_PDU = -1; /* SSIDList */ +static int hf_wlancertextn_SSIDList_item = -1; /* SSID */ + +/*--- End of included file: packet-wlancertextn-hf.c ---*/ + + +/* Initialize the subtree pointers */ + +/*--- Included file: packet-wlancertextn-ett.c ---*/ + +static gint ett_wlancertextn_SSIDList = -1; + +/*--- End of included file: packet-wlancertextn-ett.c ---*/ + + + +/*--- Included file: packet-wlancertextn-fn.c ---*/ + +/*--- Fields for imported types ---*/ + + + + +static int +dissect_wlancertextn_SSID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_SSIDList_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_wlancertextn_SSID(FALSE, tvb, offset, pinfo, tree, hf_wlancertextn_SSIDList_item); +} + +static const ber_sequence_t SSIDList_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_SSIDList_item }, +}; + +static int +dissect_wlancertextn_SSIDList(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + SSIDList_sequence_of, hf_index, ett_wlancertextn_SSIDList); + + return offset; +} + +/*--- PDUs ---*/ + +static void dissect_SSIDList_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + dissect_wlancertextn_SSIDList(FALSE, tvb, 0, pinfo, tree, hf_wlancertextn_SSIDList_PDU); +} + + +/*--- End of included file: packet-wlancertextn-fn.c ---*/ + + + +/*--- proto_register_wlancertextn ----------------------------------------------*/ +void proto_register_wlancertextn(void) { + + /* List of fields */ + static hf_register_info hf[] = { + +/*--- Included file: packet-wlancertextn-hfarr.c ---*/ + + { &hf_wlancertextn_SSIDList_PDU, + { "SSIDList", "wlancertextn.SSIDList", + FT_NONE, BASE_NONE, NULL, 0, + "SSIDList", HFILL }}, + { &hf_wlancertextn_SSIDList_item, + { "Item", "wlancertextn.SSIDList_item", + FT_BYTES, BASE_HEX, NULL, 0, + "SSIDList/_item", HFILL }}, + +/*--- End of included file: packet-wlancertextn-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + +/*--- Included file: packet-wlancertextn-ettarr.c ---*/ + + &ett_wlancertextn_SSIDList, + +/*--- End of included file: packet-wlancertextn-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_wlancertextn = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_wlancertextn, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_wlancertextn -------------------------------------------*/ +void proto_reg_handoff_wlancertextn(void) { + +/*--- Included file: packet-wlancertextn-dis-tab.c ---*/ + + register_ber_oid_dissector("1.3.6.1.5.5.7.1.13", dissect_SSIDList_PDU, proto_wlancertextn, "id-pe-wlanSSID"); + register_ber_oid_dissector("1.3.6.1.5.5.7.10.6", dissect_SSIDList_PDU, proto_wlancertextn, "id-aca-wlanSSID"); + + +/*--- End of included file: packet-wlancertextn-dis-tab.c ---*/ + + register_ber_oid_name("1.3.6.1.5.5.7.3.13","id-kp-eapOverPPP"); + register_ber_oid_name("1.3.6.1.5.5.7.3.14","id-kp-eapOverLAN"); +} + diff --git a/epan/dissectors/packet-wlancertextn.h b/epan/dissectors/packet-wlancertextn.h new file mode 100644 index 0000000000..7e681887dd --- /dev/null +++ b/epan/dissectors/packet-wlancertextn.h @@ -0,0 +1,39 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* ./packet-wlancertextn.h */ +/* ../../tools/asn2eth.py -X -b -e -p wlancertextn -c wlancertextn.cnf -s packet-wlancertextn-template WLANCERTEXTN.asn */ + +/* Input file: packet-wlancertextn-template.h */ + +/* packet-wlancertextn.h + * Routines for Wireless Certificate Extensions (RFC3770) packet dissection + * Ronnie Sahlberg 2005 + * + * $Id: packet-wlancertextn-template.h 12573 2004-11-22 03:36:26Z sahlberg $ + * + * 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_WLANCERTEXTN_H +#define PACKET_WLANCERTEXTN_H + +/*#include "packet-wlancertextn-exp.h"*/ + +#endif /* PACKET_WLANCERTEXTN_H */ + |