aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/ocsp
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-09 03:17:51 +0000
committerJoão Valverde <j@v6e.pt>2016-03-13 21:30:24 +0000
commit54a520d4a1151c68d0b4e5f09a8d82466fa499f3 (patch)
tree7aacae160382098ce651ac862a5dfd5de4beff94 /epan/dissectors/asn1/ocsp
parentc1f3c935bdd33090c87f0d2f84842ce9729b747a (diff)
Move /asn1 to /epan/dissectors
Change-Id: I1208fe3c2ba428995526f561e8f792b8d871e9a9 Reviewed-on: https://code.wireshark.org/review/14388 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/dissectors/asn1/ocsp')
-rw-r--r--epan/dissectors/asn1/ocsp/CMakeLists.txt53
-rw-r--r--epan/dissectors/asn1/ocsp/Makefile.am23
-rw-r--r--epan/dissectors/asn1/ocsp/Makefile.common51
-rw-r--r--epan/dissectors/asn1/ocsp/Makefile.nmake26
-rw-r--r--epan/dissectors/asn1/ocsp/OCSP.asn186
-rw-r--r--epan/dissectors/asn1/ocsp/ocsp.cnf55
-rw-r--r--epan/dissectors/asn1/ocsp/packet-ocsp-template.c139
-rw-r--r--epan/dissectors/asn1/ocsp/packet-ocsp-template.h33
8 files changed, 566 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/ocsp/CMakeLists.txt b/epan/dissectors/asn1/ocsp/CMakeLists.txt
new file mode 100644
index 0000000000..70b40fac44
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/CMakeLists.txt
@@ -0,0 +1,53 @@
+# 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 ocsp )
+
+set( PROTO_OPT )
+
+set( EXT_ASN_FILE_LIST
+)
+
+set( ASN_FILE_LIST
+ OCSP.asn
+)
+
+set( EXTRA_DIST
+ ${ASN_FILE_LIST}
+ packet-${PROTOCOL_NAME}-template.c
+ packet-${PROTOCOL_NAME}-template.h
+ ${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"
+ "${CMAKE_CURRENT_BINARY_DIR}/../x509ce/x509ce-exp.cnf"
+)
+
+ASN2WRS()
+
diff --git a/epan/dissectors/asn1/ocsp/Makefile.am b/epan/dissectors/asn1/ocsp/Makefile.am
new file mode 100644
index 0000000000..72d28e600b
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/Makefile.am
@@ -0,0 +1,23 @@
+# 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.preinc
+include Makefile.common
+include ../Makefile.inc
+
diff --git a/epan/dissectors/asn1/ocsp/Makefile.common b/epan/dissectors/asn1/ocsp/Makefile.common
new file mode 100644
index 0000000000..d1d3eaed64
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/Makefile.common
@@ -0,0 +1,51 @@
+# 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.
+
+
+PROTOCOL_NAME=ocsp
+
+EXT_ASN_FILE_LIST =
+
+ASN_FILE_LIST = \
+ OCSP.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 \
+ packet-$(PROTOCOL_NAME)-template.h \
+ $(PROTOCOL_NAME).cnf
+
+SRC_FILES = \
+ $(EXTRA_DIST) \
+ $(EXT_ASN_FILE_LIST)
+
+A2W_FLAGS= -b
+
+EXTRA_CNF= \
+ $(builddir)/../x509af/x509af-exp.cnf \
+ $(builddir)/../x509ce/x509ce-exp.cnf
+
+$(builddir)/../x509af/x509af-exp.cnf:
+ (cd $(builddir)/../x509af && $(MAKE_CNF_EXPORT))
+
+$(builddir)/../x509ce/x509ce-exp.cnf:
+ (cd $(builddir)/../x509ce && $(MAKE_CNF_EXPORT))
+
diff --git a/epan/dissectors/asn1/ocsp/Makefile.nmake b/epan/dissectors/asn1/ocsp/Makefile.nmake
new file mode 100644
index 0000000000..d296638ddd
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/Makefile.nmake
@@ -0,0 +1,26 @@
+## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
+#
+# 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.nmake
+include ../Makefile.preinc.nmake
+include Makefile.common
+include ../Makefile.inc.nmake
+
diff --git a/epan/dissectors/asn1/ocsp/OCSP.asn b/epan/dissectors/asn1/ocsp/OCSP.asn
new file mode 100644
index 0000000000..c2e17297f9
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/OCSP.asn
@@ -0,0 +1,186 @@
+-- Online Certificate Status Protocol
+-- RFC 2560
+-- This definition was taken from RFC2560 and modified to pass through
+-- asn2wrs.
+-- The original copyright from RFC2650 follows below
+--
+-- Full Copyright Statement
+--
+-- Copyright (C) The Internet Society (1999). All Rights Reserved.
+--
+-- This document and translations of it may be copied and furnished to
+-- others, and derivative works that comment on or otherwise explain it
+-- or assist in its implementation may be prepared, copied, published
+-- and distributed, in whole or in part, without restriction of any
+-- kind, provided that the above copyright notice and this paragraph are
+-- included on all such copies and derivative works. However, this
+-- document itself may not be modified in any way, such as by removing
+-- the copyright notice or references to the Internet Society or other
+-- Internet organizations, except as needed for the purpose of
+-- developing Internet standards in which case the procedures for
+-- copyrights defined in the Internet Standards process must be
+-- followed, or as required to translate it into languages other than
+-- English.
+--
+-- The limited permissions granted above are perpetual and will not be
+-- revoked by the Internet Society or its successors or assigns.
+--
+-- This document and the information contained herein is provided on an
+-- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+-- TASK FORCE DISCLAIMS 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.
+--
+
+OCSP DEFINITIONS EXPLICIT TAGS::=
+
+BEGIN
+
+IMPORTS
+
+ authenticationFramework
+ FROM UsefulDefinitions {joint-iso-itu-t ds(5) module(1)
+ usefulDefinitions(0) 5}
+
+ EXTENSION
+ FROM AuthenticationFramework authenticationFramework
+
+ -- Directory Authentication Framework (X.509)
+ Certificate, AlgorithmIdentifier
+ FROM AuthenticationFramework { joint-iso-itu-t ds(5)
+ module(1) authenticationFramework(7) 3 }
+
+ CRLReason
+ FROM CertificateExtensions
+
+ -- PKIX Certificate Extensions
+ AuthorityInfoAccessSyntax
+ FROM PKIX1Implicit88 {iso(1) identified-organization(3)
+ dod(6) internet(1) security(5) mechanisms(5) pkix(7)
+ id-mod(0) id-pkix1-implicit-88(2)}
+
+ Name, GeneralName, CertificateSerialNumber, Extensions, id-kp, id-ad-ocsp
+ FROM PKIX1Explicit88 {iso(1) identified-organization(3)
+ dod(6) internet(1) security(5) mechanisms(5) pkix(7)
+ id-mod(0) id-pkix1-explicit-88(1)};
+
+OCSPRequest ::= SEQUENCE {
+ tbsRequest TBSRequest,
+ optionalSignature [0] EXPLICIT Signature OPTIONAL }
+
+TBSRequest ::= SEQUENCE {
+ version [0] EXPLICIT Version DEFAULT v1,
+ requestorName [1] EXPLICIT GeneralName OPTIONAL,
+ requestList SEQUENCE OF Request,
+ requestExtensions [2] EXPLICIT Extensions OPTIONAL }
+
+Signature ::= SEQUENCE {
+ signatureAlgorithm AlgorithmIdentifier,
+ signature BIT STRING,
+ certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+
+Version ::= INTEGER { v1(0) }
+
+Request ::= SEQUENCE {
+ reqCert CertID,
+ singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
+
+CertID ::= SEQUENCE {
+ hashAlgorithm AlgorithmIdentifier,
+ issuerNameHash OCTET STRING, -- Hash of Issuer's DN
+ issuerKeyHash OCTET STRING, -- Hash of Issuers public key
+ serialNumber CertificateSerialNumber }
+
+OCSPResponse ::= SEQUENCE {
+ responseStatus OCSPResponseStatus,
+ responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
+
+OCSPResponseStatus ::= ENUMERATED {
+ successful (0), --Response has valid confirmations
+ malformedRequest (1), --Illegal confirmation request
+ internalError (2), --Internal error in issuer
+ tryLater (3), --Try again later
+ --(4) is not used
+ sigRequired (5), --Must sign the request
+ unauthorized (6) --Request unauthorized
+}
+
+ResponseBytes ::= SEQUENCE {
+ responseType OBJECT IDENTIFIER,
+ response OCTET STRING }
+
+BasicOCSPResponse ::= SEQUENCE {
+ tbsResponseData ResponseData,
+ signatureAlgorithm AlgorithmIdentifier,
+ signature BIT STRING,
+ certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
+
+ResponseData ::= SEQUENCE {
+ version [0] EXPLICIT Version DEFAULT v1,
+ responderID ResponderID,
+ producedAt GeneralizedTime,
+ responses SEQUENCE OF SingleResponse,
+ responseExtensions [1] EXPLICIT Extensions OPTIONAL }
+
+ResponderID ::= CHOICE {
+ byName [1] Name,
+ byKey [2] KeyHash }
+
+KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key
+ --(excluding the tag and length fields)
+
+SingleResponse ::= SEQUENCE {
+ certID CertID,
+ certStatus CertStatus,
+ thisUpdate GeneralizedTime,
+ nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
+ singleExtensions [1] EXPLICIT Extensions OPTIONAL }
+
+CertStatus ::= CHOICE {
+ good [0] IMPLICIT NULL,
+ revoked [1] IMPLICIT RevokedInfo,
+ unknown [2] IMPLICIT UnknownInfo }
+
+RevokedInfo ::= SEQUENCE {
+ revocationTime GeneralizedTime,
+ revocationReason [0] EXPLICIT CRLReason OPTIONAL }
+
+UnknownInfo ::= NULL -- this can be replaced with an enumeration
+
+ArchiveCutoff ::= GeneralizedTime
+
+AcceptableResponses ::= SEQUENCE OF OBJECT IDENTIFIER
+
+ServiceLocator ::= SEQUENCE {
+ issuer Name,
+ locator AuthorityInfoAccessSyntax }
+
+CrlID ::= SEQUENCE {
+ crlUrl [0] EXPLICIT IA5String OPTIONAL,
+ crlNum [1] EXPLICIT INTEGER OPTIONAL,
+ crlTime [2] EXPLICIT GeneralizedTime OPTIONAL }
+
+re-ocsp-nonce EXTENSION ::= {
+ SYNTAX ReOcspNonce
+ IDENTIFIED BY id-pkix-ocsp-nonce
+}
+
+ReOcspNonce ::= OCTET STRING
+
+
+-- Object Identifiers
+
+id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 }
+id-pkix-ocsp OBJECT IDENTIFIER ::= { id-ad-ocsp }
+id-pkix-ocsp-basic OBJECT IDENTIFIER ::= { id-pkix-ocsp 1 }
+id-pkix-ocsp-nonce OBJECT IDENTIFIER ::= { id-pkix-ocsp 2 }
+id-pkix-ocsp-crl OBJECT IDENTIFIER ::= { id-pkix-ocsp 3 }
+id-pkix-ocsp-response OBJECT IDENTIFIER ::= { id-pkix-ocsp 4 }
+id-pkix-ocsp-nocheck OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 }
+id-pkix-ocsp-archive-cutoff OBJECT IDENTIFIER ::= { id-pkix-ocsp 6 }
+id-pkix-ocsp-service-locator OBJECT IDENTIFIER ::= { id-pkix-ocsp 7 }
+
+
+END
+
diff --git a/epan/dissectors/asn1/ocsp/ocsp.cnf b/epan/dissectors/asn1/ocsp/ocsp.cnf
new file mode 100644
index 0000000000..551b4583cc
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/ocsp.cnf
@@ -0,0 +1,55 @@
+# ocsp.cnf
+# OCSP conformation file
+
+#.TYPE_ATTR
+# pkix1explicit also exports the type CertificateSerialNumber. This makes sure asn2wrs uses the locally defined version.
+CertificateSerialNumber TYPE = FT_UINT64 DISPLAY = BASE_DEC STRINGS = NULL BITMASK = 0
+#.END
+
+#.MODULE_IMPORT
+PKIX1Implicit88 pkix1implicit
+PKIX1Explicit88 pkix1explicit
+
+#.IMPORT ../x509af/x509af-exp.cnf
+#.IMPORT ../x509ce/x509ce-exp.cnf
+#.INCLUDE ../pkix1implicit/pkix1implicit_exp.cnf
+#.INCLUDE ../pkix1explicit/pkix1explicit_exp.cnf
+
+#.EXPORTS
+OCSPResponse
+
+#.PDU
+
+#.REGISTER
+BasicOCSPResponse B "1.3.6.1.5.5.7.48.1.1" "id-pkix-ocsp-basic"
+ReOcspNonce B "1.3.6.1.5.5.7.48.1.2" "id-pkix-ocsp-nonce"
+CrlID B "1.3.6.1.5.5.7.48.1.3" "id-pkix-ocsp-crl"
+AcceptableResponses B "1.3.6.1.5.5.7.48.1.4" "id-pkix-ocsp-response"
+NULL B "1.3.6.1.5.5.7.48.1.5" "id-pkix-ocsp-nocheck"
+ArchiveCutoff B "1.3.6.1.5.5.7.48.1.6" "id-pkix-ocsp-archive-cutoff"
+ServiceLocator B "1.3.6.1.5.5.7.48.1.7" "id-pkix-ocsp-service-locator"
+
+#.NO_EMIT ONLY_VALS
+Version
+
+#.TYPE_RENAME
+
+#.FIELD_RENAME
+
+#.FN_BODY ResponseBytes/responseType FN_VARIANT = _str HF_INDEX = hf_ocsp_responseType_id VAL_PTR = &actx->external.direct_reference
+%(DEFAULT_BODY)s
+ actx->external.direct_ref_present = (actx->external.direct_reference != NULL) ? TRUE : FALSE;
+
+#.FN_BODY ResponseBytes/response
+ gint8 appclass;
+ gboolean pc, ind;
+ gint32 tag;
+ guint32 len;
+ /* skip past the T and L */
+ offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
+ offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
+ if (actx->external.direct_ref_present) {
+ offset = call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
+ }
+
+#.END
diff --git a/epan/dissectors/asn1/ocsp/packet-ocsp-template.c b/epan/dissectors/asn1/ocsp/packet-ocsp-template.c
new file mode 100644
index 0000000000..17fc57ac9e
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/packet-ocsp-template.c
@@ -0,0 +1,139 @@
+/* packet-ocsp.c
+ * Routines for Online Certificate Status Protocol (RFC2560) packet dissection
+ * Ronnie Sahlberg 2004
+ *
+ * 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 <asn1.h>
+
+#include "packet-ber.h"
+#include "packet-ocsp.h"
+#include "packet-x509af.h"
+#include "packet-x509ce.h"
+#include "packet-pkix1implicit.h"
+#include "packet-pkix1explicit.h"
+
+#define PNAME "Online Certificate Status Protocol"
+#define PSNAME "OCSP"
+#define PFNAME "ocsp"
+
+void proto_register_ocsp(void);
+void proto_reg_handoff_ocsp(void);
+
+/* Initialize the protocol and registered fields */
+int proto_ocsp = -1;
+static int hf_ocsp_responseType_id = -1;
+#include "packet-ocsp-hf.c"
+
+/* Initialize the subtree pointers */
+static gint ett_ocsp = -1;
+#include "packet-ocsp-ett.c"
+
+#include "packet-ocsp-fn.c"
+
+
+static int
+dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
+{
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ asn1_ctx_t asn1_ctx;
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
+
+ col_set_str(pinfo->cinfo, COL_INFO, "Request");
+
+
+ if(parent_tree){
+ item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
+ tree = proto_item_add_subtree(item, ett_ocsp);
+ }
+
+ return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, &asn1_ctx, tree, -1);
+}
+
+
+static int
+dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
+{
+ proto_item *item=NULL;
+ proto_tree *tree=NULL;
+ asn1_ctx_t asn1_ctx;
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
+
+ col_set_str(pinfo->cinfo, COL_INFO, "Response");
+
+
+ if(parent_tree){
+ item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
+ tree = proto_item_add_subtree(item, ett_ocsp);
+ }
+
+ return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, -1);
+}
+
+/*--- proto_register_ocsp ----------------------------------------------*/
+void proto_register_ocsp(void) {
+
+ /* List of fields */
+ static hf_register_info hf[] = {
+ { &hf_ocsp_responseType_id,
+ { "ResponseType Id", "ocsp.responseType.id",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
+#include "packet-ocsp-hfarr.c"
+ };
+
+ /* List of subtrees */
+ static gint *ett[] = {
+ &ett_ocsp,
+#include "packet-ocsp-ettarr.c"
+ };
+
+ /* Register protocol */
+ proto_ocsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
+
+ /* Register fields and subtrees */
+ proto_register_field_array(proto_ocsp, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+
+}
+
+/*--- proto_reg_handoff_ocsp -------------------------------------------*/
+void proto_reg_handoff_ocsp(void) {
+ dissector_handle_t ocsp_request_handle;
+ dissector_handle_t ocsp_response_handle;
+
+ ocsp_request_handle = create_dissector_handle(dissect_ocsp_request, proto_ocsp);
+ ocsp_response_handle = create_dissector_handle(dissect_ocsp_response, proto_ocsp);
+
+ dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle);
+ dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle);
+
+#include "packet-ocsp-dis-tab.c"
+}
+
diff --git a/epan/dissectors/asn1/ocsp/packet-ocsp-template.h b/epan/dissectors/asn1/ocsp/packet-ocsp-template.h
new file mode 100644
index 0000000000..5e75d633c3
--- /dev/null
+++ b/epan/dissectors/asn1/ocsp/packet-ocsp-template.h
@@ -0,0 +1,33 @@
+/* packet-ocsp.h
+ * Routines for Online Certificate Status Protocol (RFC2560) packet dissection
+ * Ronnie Sahlberg 2004
+ *
+ * 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.
+ */
+
+#ifndef PACKET_OCSP_H
+#define PACKET_OCSP_H
+
+/*#include "packet-ocsp-exp.h"*/
+
+extern int proto_ocsp;
+int dissect_ocsp_OCSPResponse(gboolean implicit_tag, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index);
+
+#endif /* PACKET_OCSP_H */
+