diff options
Diffstat (limited to 'epan/dissectors/asn1/mudurl')
-rw-r--r-- | epan/dissectors/asn1/mudurl/CMakeLists.txt | 38 | ||||
-rw-r--r-- | epan/dissectors/asn1/mudurl/MUDURL.asn | 64 | ||||
-rw-r--r-- | epan/dissectors/asn1/mudurl/mudurl.cnf | 18 | ||||
-rw-r--r-- | epan/dissectors/asn1/mudurl/packet-mudurl-template.c | 67 |
4 files changed, 187 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/mudurl/CMakeLists.txt b/epan/dissectors/asn1/mudurl/CMakeLists.txt new file mode 100644 index 00000000..7032ae31 --- /dev/null +++ b/epan/dissectors/asn1/mudurl/CMakeLists.txt @@ -0,0 +1,38 @@ +# CMakeLists.txt +# +# Wireshark - Network traffic analyzer +# By Gerald Combs <gerald@wireshark.org> +# Copyright 1998 Gerald Combs +# +# SPDX-License-Identifier: GPL-2.0-or-later +# + +set( PROTOCOL_NAME mudurl ) + +set( PROTO_OPT ) + +set( EXT_ASN_FILE_LIST +) + +set( ASN_FILE_LIST + MUDURL.asn +) + +set( EXTRA_DIST + ${ASN_FILE_LIST} + packet-${PROTOCOL_NAME}-template.c + ${PROTOCOL_NAME}.cnf +) + +set( SRC_FILES + ${EXTRA_DIST} + ${EXT_ASN_FILE_LIST} +) + +set( A2W_FLAGS -b ) + +set( EXTRA_CNF + "${CMAKE_CURRENT_BINARY_DIR}/../x509af/x509af-exp.cnf" +) + +ASN2WRS() diff --git a/epan/dissectors/asn1/mudurl/MUDURL.asn b/epan/dissectors/asn1/mudurl/MUDURL.asn new file mode 100644 index 00000000..34a06b60 --- /dev/null +++ b/epan/dissectors/asn1/mudurl/MUDURL.asn @@ -0,0 +1,64 @@ +-- Taken originally from draft-ietf-opsawg-mud. +-- +-- Copyright (c) 2016 IETF Trust and Eliot Lear +-- All Rights Reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- +-- o Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- o Redistributions in binary form must reproduce the above +-- copyright notice, this list of conditions and the following +-- disclaimer in the documentation and/or other materials provided +-- with the distribution. +-- o Neither the name of Internet Society, IETF or IETF Trust, nor +-- the names of specific contributors, may be used to endorse or +-- promote products derived from this software without specific prior +-- written permission. +-- +-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-- “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +-- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +-- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +-- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +-- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +-- OF THE POSSIBILITY OF SUCH DAMAGE. + + +MUDURLExtnModule-2016 { iso(1) identified-organization(3) dod(6) + internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) + id-mod-mudURLExtn2016(88) } + +DEFINITIONS IMPLICIT TAGS ::= BEGIN + +-- EXPORTS ALL -- + +-- EXTENSION is modified. It would normally be taken from PKIX1Explicit-2009. +-- For reasons passing my understanding, id-pe is already understood. + +IMPORTS + EXTENSION + FROM AuthenticationFramework {joint-iso-itu-t ds(5) module(1) + authenticationFramework(7) 3} + id-pe + FROM PKIX1Explicit-2009 + { iso(1) identified-organization(3) dod(6) internet(1) + security(5) mechanisms(5) pkix(7) id-mod(0) + id-mod-pkix1-explicit-02(51) }; + + MUDCertExtensions EXTENSION ::= { ext-MUDURL, ... } + ext-MUDURL EXTENSION ::= { SYNTAX MUDURLSyntax + IDENTIFIED BY id-pe-mud-url } + + id-pe-mud-url OBJECT IDENTIFIER ::= { id-pe 25 } + + MUDURLSyntax ::= IA5String + + END diff --git a/epan/dissectors/asn1/mudurl/mudurl.cnf b/epan/dissectors/asn1/mudurl/mudurl.cnf new file mode 100644 index 00000000..fe492922 --- /dev/null +++ b/epan/dissectors/asn1/mudurl/mudurl.cnf @@ -0,0 +1,18 @@ +# mudurl.cnf +# mudurl conformation file + +#.INCLUDE ../x509af/x509af-exp.cnf + +#.MODULE_IMPORT +EXTENSION x509af + +#.EXPORTS + +#.REGISTER +MUDURLSyntax B "1.3.6.1.5.5.7.1.25" "id-pe-mud-url" + +#.TYPE_RENAME + +#.FIELD_RENAME + +#.END diff --git a/epan/dissectors/asn1/mudurl/packet-mudurl-template.c b/epan/dissectors/asn1/mudurl/packet-mudurl-template.c new file mode 100644 index 00000000..1861a39c --- /dev/null +++ b/epan/dissectors/asn1/mudurl/packet-mudurl-template.c @@ -0,0 +1,67 @@ +/* packet-mudurl-template.c + * Routines for mudurl found in draft-ietf-opsawg-mud + * by Eliot Lear + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "config.h" + +#include <epan/packet.h> +#include <epan/asn1.h> + +#include "packet-ber.h" +/* #include "packet-mudurl.h" */ // At the moment we are not exporting. +#include "packet-x509af.h" + +#define PNAME "MUDURL" +#define PSNAME "MUDURL" +#define PFNAME "mudurl" + +void proto_register_mudurl(void); +void proto_reg_handoff_mudurl(void); + + +/* Initialize the protocol and registered fields */ +static int proto_mudurl = -1; +#include "packet-mudurl-hf.c" + +/* Initialize the subtree pointers */ +/* #include "packet-mudurl-ett.c" */ + +// static const char *object_identifier_id; + +#include "packet-mudurl-fn.c" + + +/*--- proto_register_mudurl ----------------------------------------------*/ +void proto_register_mudurl(void) { + + /* List of fields */ + static hf_register_info hf[] = { +#include "packet-mudurl-hfarr.c" + }; + + /* List of subtrees */ + /* static gint *ett[] = { +#include "packet-mudurl-ettarr.c" + }; */ + + /* Register protocol */ + proto_mudurl = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_mudurl, hf, array_length(hf)); + // proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_mudurl -------------------------------------------*/ +void proto_reg_handoff_mudurl(void) { +#include "packet-mudurl-dis-tab.c" +} |