forked from osmocom/wireshark
Add MUD-URL manufacturer usage description certificate extension.
See draft-ietf-opsawg-mud for details. File changes include addition of new asn1 directory and associated files, as well as edits to various other files to support the change. Change-Id: Ib910980e1ddcafaa31aa07cf049562520b61a3aa Reviewed-on: https://code.wireshark.org/review/19505 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
165c8b0422
commit
03a8884989
|
@ -2911,6 +2911,7 @@ AC_CONFIG_FILES(
|
|||
epan/dissectors/asn1/mms/Makefile
|
||||
epan/dissectors/asn1/mpeg-audio/Makefile
|
||||
epan/dissectors/asn1/mpeg-pes/Makefile
|
||||
epan/dissectors/asn1/mudurl/Makefile
|
||||
epan/dissectors/asn1/nbap/Makefile
|
||||
epan/dissectors/asn1/ns_cert_exts/Makefile
|
||||
epan/dissectors/asn1/novell_pkis/Makefile
|
||||
|
|
|
@ -112,6 +112,7 @@ set(CLEAN_ASN1_DISSECTOR_SRC
|
|||
packet-mms.c
|
||||
packet-mpeg-audio.c
|
||||
packet-mpeg-pes.c
|
||||
packet-mudurl.c
|
||||
packet-nbap.c
|
||||
packet-novell_pkis.c
|
||||
packet-ns_cert_exts.c
|
||||
|
|
|
@ -157,6 +157,7 @@ ASN1_DISSECTOR_SRC = \
|
|||
packet-mms.c \
|
||||
packet-mpeg-audio.c \
|
||||
packet-mpeg-pes.c \
|
||||
packet-mudurl.c \
|
||||
packet-nbap.c \
|
||||
packet-novell_pkis.c \
|
||||
packet-ns_cert_exts.c \
|
||||
|
|
|
@ -77,6 +77,7 @@ set(ASN1_SRC_DIRS
|
|||
mms
|
||||
mpeg-audio
|
||||
mpeg-pes
|
||||
mudurl
|
||||
nbap
|
||||
ns_cert_exts
|
||||
novell_pkis
|
||||
|
|
|
@ -78,6 +78,7 @@ SUBDIRS = \
|
|||
mms \
|
||||
mpeg-audio \
|
||||
mpeg-pes \
|
||||
mudurl \
|
||||
nbap \
|
||||
novell_pkis \
|
||||
ns_cert_exts \
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
# CMakeLists.txt
|
||||
#
|
||||
# Wireshark - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@wireshark.org>
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
|
||||
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()
|
|
@ -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
|
|
@ -0,0 +1,46 @@
|
|||
# Wireshark - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@wireshark.org>
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
include ../Makefile.inc
|
||||
|
||||
PROTOCOL_NAME=mudurl
|
||||
|
||||
EXT_ASN_FILE_LIST =
|
||||
|
||||
ASN_FILE_LIST = \
|
||||
MUDURL.asn
|
||||
|
||||
# The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn
|
||||
# files do not exist for all protocols: Please add/remove as required.
|
||||
EXTRA_DIST = \
|
||||
$(EXTRA_DIST_COMMON) \
|
||||
$(ASN_FILE_LIST) \
|
||||
packet-$(PROTOCOL_NAME)-template.c \
|
||||
$(PROTOCOL_NAME).cnf
|
||||
|
||||
SRC_FILES = \
|
||||
$(EXTRA_DIST) \
|
||||
$(EXT_ASN_FILE_LIST)
|
||||
|
||||
A2W_FLAGS= -b
|
||||
|
||||
EXTRA_CNF= \
|
||||
$(builddir)/../x509af/x509af-exp.cnf
|
||||
|
||||
$(builddir)/../x509af/x509af-exp.cnf:
|
||||
(cd $(builddir)/../x509af && $(MAKE_CNF_EXPORT))
|
|
@ -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
|
|
@ -0,0 +1,79 @@
|
|||
/* 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
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#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"
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
/* Do not modify this file. Changes will be overwritten. */
|
||||
/* Generated automatically by the ASN.1 to Wireshark dissector compiler */
|
||||
/* packet-mudurl.c */
|
||||
/* asn2wrs.py -b -p mudurl -c ./mudurl.cnf -s ./packet-mudurl-template -D . -O ../.. MUDURL.asn */
|
||||
|
||||
/* Input file: packet-mudurl-template.c */
|
||||
|
||||
#line 1 "./asn1/mudurl/packet-mudurl-template.c"
|
||||
/* 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
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#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;
|
||||
|
||||
/*--- Included file: packet-mudurl-hf.c ---*/
|
||||
#line 1 "./asn1/mudurl/packet-mudurl-hf.c"
|
||||
static int hf_mudurl_MUDURLSyntax_PDU = -1; /* MUDURLSyntax */
|
||||
|
||||
/*--- End of included file: packet-mudurl-hf.c ---*/
|
||||
#line 44 "./asn1/mudurl/packet-mudurl-template.c"
|
||||
|
||||
/* Initialize the subtree pointers */
|
||||
/* #include "packet-mudurl-ett.c" */
|
||||
|
||||
// static const char *object_identifier_id;
|
||||
|
||||
|
||||
/*--- Included file: packet-mudurl-fn.c ---*/
|
||||
#line 1 "./asn1/mudurl/packet-mudurl-fn.c"
|
||||
|
||||
|
||||
static int
|
||||
dissect_mudurl_MUDURLSyntax(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
|
||||
offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String,
|
||||
actx, tree, tvb, offset, hf_index,
|
||||
NULL);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
/*--- PDUs ---*/
|
||||
|
||||
static int dissect_MUDURLSyntax_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
|
||||
int offset = 0;
|
||||
asn1_ctx_t asn1_ctx;
|
||||
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
|
||||
offset = dissect_mudurl_MUDURLSyntax(FALSE, tvb, offset, &asn1_ctx, tree, hf_mudurl_MUDURLSyntax_PDU);
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
/*--- End of included file: packet-mudurl-fn.c ---*/
|
||||
#line 51 "./asn1/mudurl/packet-mudurl-template.c"
|
||||
|
||||
|
||||
/*--- proto_register_mudurl ----------------------------------------------*/
|
||||
void proto_register_mudurl(void) {
|
||||
|
||||
/* List of fields */
|
||||
static hf_register_info hf[] = {
|
||||
|
||||
/*--- Included file: packet-mudurl-hfarr.c ---*/
|
||||
#line 1 "./asn1/mudurl/packet-mudurl-hfarr.c"
|
||||
{ &hf_mudurl_MUDURLSyntax_PDU,
|
||||
{ "MUDURLSyntax", "mudurl.MUDURLSyntax",
|
||||
FT_STRING, BASE_NONE, NULL, 0,
|
||||
NULL, HFILL }},
|
||||
|
||||
/*--- End of included file: packet-mudurl-hfarr.c ---*/
|
||||
#line 59 "./asn1/mudurl/packet-mudurl-template.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) {
|
||||
|
||||
/*--- Included file: packet-mudurl-dis-tab.c ---*/
|
||||
#line 1 "./asn1/mudurl/packet-mudurl-dis-tab.c"
|
||||
register_ber_oid_dissector("1.3.6.1.5.5.7.1.25", dissect_MUDURLSyntax_PDU, proto_mudurl, "id-pe-mud-url");
|
||||
|
||||
|
||||
/*--- End of included file: packet-mudurl-dis-tab.c ---*/
|
||||
#line 79 "./asn1/mudurl/packet-mudurl-template.c"
|
||||
}
|
Loading…
Reference in New Issue