1 /* Do not modify this file. Changes will be overwritten. */
2 /* Generated automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2wrs.py -b -p ocsp -c ./ocsp.cnf -s ./packet-ocsp-template -D . -O ../../epan/dissectors OCSP.asn */
6 /* Input file: packet-ocsp-template.c */
8 #line 1 "../../asn1/ocsp/packet-ocsp-template.c"
10 * Routines for Online Certificate Status Protocol (RFC2560) packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37 #include <epan/packet.h>
41 #include "packet-ber.h"
42 #include "packet-ocsp.h"
43 #include "packet-x509af.h"
44 #include "packet-x509ce.h"
45 #include "packet-pkix1implicit.h"
46 #include "packet-pkix1explicit.h"
48 #define PNAME "Online Certificate Status Protocol"
52 /* Initialize the protocol and registered fields */
54 static int hf_ocsp_responseType_id = -1;
56 /*--- Included file: packet-ocsp-hf.c ---*/
57 #line 1 "../../asn1/ocsp/packet-ocsp-hf.c"
58 static int hf_ocsp_BasicOCSPResponse_PDU = -1; /* BasicOCSPResponse */
59 static int hf_ocsp_ArchiveCutoff_PDU = -1; /* ArchiveCutoff */
60 static int hf_ocsp_AcceptableResponses_PDU = -1; /* AcceptableResponses */
61 static int hf_ocsp_ServiceLocator_PDU = -1; /* ServiceLocator */
62 static int hf_ocsp_CrlID_PDU = -1; /* CrlID */
63 static int hf_ocsp_NULL_PDU = -1; /* NULL */
64 static int hf_ocsp_tbsRequest = -1; /* TBSRequest */
65 static int hf_ocsp_optionalSignature = -1; /* Signature */
66 static int hf_ocsp_version = -1; /* Version */
67 static int hf_ocsp_requestorName = -1; /* GeneralName */
68 static int hf_ocsp_requestList = -1; /* SEQUENCE_OF_Request */
69 static int hf_ocsp_requestList_item = -1; /* Request */
70 static int hf_ocsp_requestExtensions = -1; /* Extensions */
71 static int hf_ocsp_signatureAlgorithm = -1; /* AlgorithmIdentifier */
72 static int hf_ocsp_signature = -1; /* BIT_STRING */
73 static int hf_ocsp_certs = -1; /* SEQUENCE_OF_Certificate */
74 static int hf_ocsp_certs_item = -1; /* Certificate */
75 static int hf_ocsp_reqCert = -1; /* CertID */
76 static int hf_ocsp_singleRequestExtensions = -1; /* Extensions */
77 static int hf_ocsp_hashAlgorithm = -1; /* AlgorithmIdentifier */
78 static int hf_ocsp_issuerNameHash = -1; /* OCTET_STRING */
79 static int hf_ocsp_issuerKeyHash = -1; /* OCTET_STRING */
80 static int hf_ocsp_serialNumber = -1; /* CertificateSerialNumber */
81 static int hf_ocsp_responseStatus = -1; /* OCSPResponseStatus */
82 static int hf_ocsp_responseBytes = -1; /* ResponseBytes */
83 static int hf_ocsp_responseType = -1; /* T_responseType */
84 static int hf_ocsp_response = -1; /* T_response */
85 static int hf_ocsp_tbsResponseData = -1; /* ResponseData */
86 static int hf_ocsp_responderID = -1; /* ResponderID */
87 static int hf_ocsp_producedAt = -1; /* GeneralizedTime */
88 static int hf_ocsp_responses = -1; /* SEQUENCE_OF_SingleResponse */
89 static int hf_ocsp_responses_item = -1; /* SingleResponse */
90 static int hf_ocsp_responseExtensions = -1; /* Extensions */
91 static int hf_ocsp_byName = -1; /* Name */
92 static int hf_ocsp_byKey = -1; /* KeyHash */
93 static int hf_ocsp_certID = -1; /* CertID */
94 static int hf_ocsp_certStatus = -1; /* CertStatus */
95 static int hf_ocsp_thisUpdate = -1; /* GeneralizedTime */
96 static int hf_ocsp_nextUpdate = -1; /* GeneralizedTime */
97 static int hf_ocsp_singleExtensions = -1; /* Extensions */
98 static int hf_ocsp_good = -1; /* NULL */
99 static int hf_ocsp_revoked = -1; /* RevokedInfo */
100 static int hf_ocsp_unknown = -1; /* UnknownInfo */
101 static int hf_ocsp_revocationTime = -1; /* GeneralizedTime */
102 static int hf_ocsp_revocationReason = -1; /* CRLReason */
103 static int hf_ocsp_AcceptableResponses_item = -1; /* OBJECT_IDENTIFIER */
104 static int hf_ocsp_issuer = -1; /* Name */
105 static int hf_ocsp_locator = -1; /* AuthorityInfoAccessSyntax */
106 static int hf_ocsp_crlUrl = -1; /* IA5String */
107 static int hf_ocsp_crlNum = -1; /* INTEGER */
108 static int hf_ocsp_crlTime = -1; /* GeneralizedTime */
110 /*--- End of included file: packet-ocsp-hf.c ---*/
111 #line 48 "../../asn1/ocsp/packet-ocsp-template.c"
113 /* Initialize the subtree pointers */
114 static gint ett_ocsp = -1;
116 /*--- Included file: packet-ocsp-ett.c ---*/
117 #line 1 "../../asn1/ocsp/packet-ocsp-ett.c"
118 static gint ett_ocsp_OCSPRequest = -1;
119 static gint ett_ocsp_TBSRequest = -1;
120 static gint ett_ocsp_SEQUENCE_OF_Request = -1;
121 static gint ett_ocsp_Signature = -1;
122 static gint ett_ocsp_SEQUENCE_OF_Certificate = -1;
123 static gint ett_ocsp_Request = -1;
124 static gint ett_ocsp_CertID = -1;
125 static gint ett_ocsp_OCSPResponse = -1;
126 static gint ett_ocsp_ResponseBytes = -1;
127 static gint ett_ocsp_BasicOCSPResponse = -1;
128 static gint ett_ocsp_ResponseData = -1;
129 static gint ett_ocsp_SEQUENCE_OF_SingleResponse = -1;
130 static gint ett_ocsp_ResponderID = -1;
131 static gint ett_ocsp_SingleResponse = -1;
132 static gint ett_ocsp_CertStatus = -1;
133 static gint ett_ocsp_RevokedInfo = -1;
134 static gint ett_ocsp_AcceptableResponses = -1;
135 static gint ett_ocsp_ServiceLocator = -1;
136 static gint ett_ocsp_CrlID = -1;
138 /*--- End of included file: packet-ocsp-ett.c ---*/
139 #line 52 "../../asn1/ocsp/packet-ocsp-template.c"
141 static const char *responseType_id;
145 /*--- Included file: packet-ocsp-fn.c ---*/
146 #line 1 "../../asn1/ocsp/packet-ocsp-fn.c"
148 static const value_string ocsp_Version_vals[] = {
155 dissect_ocsp_Version(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
156 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
165 dissect_ocsp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
166 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
173 static const ber_sequence_t CertID_sequence[] = {
174 { &hf_ocsp_hashAlgorithm , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
175 { &hf_ocsp_issuerNameHash , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCTET_STRING },
176 { &hf_ocsp_issuerKeyHash , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCTET_STRING },
177 { &hf_ocsp_serialNumber , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateSerialNumber },
178 { NULL, 0, 0, 0, NULL }
182 dissect_ocsp_CertID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
183 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
184 CertID_sequence, hf_index, ett_ocsp_CertID);
190 static const ber_sequence_t Request_sequence[] = {
191 { &hf_ocsp_reqCert , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_CertID },
192 { &hf_ocsp_singleRequestExtensions, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
193 { NULL, 0, 0, 0, NULL }
197 dissect_ocsp_Request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
198 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
199 Request_sequence, hf_index, ett_ocsp_Request);
205 static const ber_sequence_t SEQUENCE_OF_Request_sequence_of[1] = {
206 { &hf_ocsp_requestList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_Request },
210 dissect_ocsp_SEQUENCE_OF_Request(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
211 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
212 SEQUENCE_OF_Request_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Request);
218 static const ber_sequence_t TBSRequest_sequence[] = {
219 { &hf_ocsp_version , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Version },
220 { &hf_ocsp_requestorName , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_GeneralName },
221 { &hf_ocsp_requestList , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SEQUENCE_OF_Request },
222 { &hf_ocsp_requestExtensions, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
223 { NULL, 0, 0, 0, NULL }
227 dissect_ocsp_TBSRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
228 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
229 TBSRequest_sequence, hf_index, ett_ocsp_TBSRequest);
237 dissect_ocsp_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
238 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
246 static const ber_sequence_t SEQUENCE_OF_Certificate_sequence_of[1] = {
247 { &hf_ocsp_certs_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
251 dissect_ocsp_SEQUENCE_OF_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
252 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
253 SEQUENCE_OF_Certificate_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Certificate);
259 static const ber_sequence_t Signature_sequence[] = {
260 { &hf_ocsp_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
261 { &hf_ocsp_signature , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_BIT_STRING },
262 { &hf_ocsp_certs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_SEQUENCE_OF_Certificate },
263 { NULL, 0, 0, 0, NULL }
267 dissect_ocsp_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
268 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
269 Signature_sequence, hf_index, ett_ocsp_Signature);
275 static const ber_sequence_t OCSPRequest_sequence[] = {
276 { &hf_ocsp_tbsRequest , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_TBSRequest },
277 { &hf_ocsp_optionalSignature, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Signature },
278 { NULL, 0, 0, 0, NULL }
282 dissect_ocsp_OCSPRequest(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
283 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
284 OCSPRequest_sequence, hf_index, ett_ocsp_OCSPRequest);
290 static const value_string ocsp_OCSPResponseStatus_vals[] = {
292 { 1, "malformedRequest" },
293 { 2, "internalError" },
295 { 5, "sigRequired" },
296 { 6, "unauthorized" },
302 dissect_ocsp_OCSPResponseStatus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
303 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
312 dissect_ocsp_T_responseType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
313 offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_ocsp_responseType_id, &responseType_id);
321 dissect_ocsp_T_response(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
322 #line 38 "../../asn1/ocsp/ocsp.cnf"
327 /* skip past the T and L */
328 offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &appclass, &pc, &tag);
329 offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
330 offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree);
338 static const ber_sequence_t ResponseBytes_sequence[] = {
339 { &hf_ocsp_responseType , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ocsp_T_responseType },
340 { &hf_ocsp_response , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_T_response },
341 { NULL, 0, 0, 0, NULL }
345 dissect_ocsp_ResponseBytes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
346 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
347 ResponseBytes_sequence, hf_index, ett_ocsp_ResponseBytes);
353 static const ber_sequence_t OCSPResponse_sequence[] = {
354 { &hf_ocsp_responseStatus , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCSPResponseStatus },
355 { &hf_ocsp_responseBytes , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_ResponseBytes },
356 { NULL, 0, 0, 0, NULL }
360 dissect_ocsp_OCSPResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
361 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
362 OCSPResponse_sequence, hf_index, ett_ocsp_OCSPResponse);
370 dissect_ocsp_KeyHash(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
371 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
378 static const value_string ocsp_ResponderID_vals[] = {
384 static const ber_choice_t ResponderID_choice[] = {
385 { 1, &hf_ocsp_byName , BER_CLASS_CON, 1, 0, dissect_pkix1explicit_Name },
386 { 2, &hf_ocsp_byKey , BER_CLASS_CON, 2, 0, dissect_ocsp_KeyHash },
387 { 0, NULL, 0, 0, 0, NULL }
391 dissect_ocsp_ResponderID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
392 offset = dissect_ber_choice(actx, tree, tvb, offset,
393 ResponderID_choice, hf_index, ett_ocsp_ResponderID,
402 dissect_ocsp_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
403 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
411 dissect_ocsp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
412 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
418 static const ber_sequence_t RevokedInfo_sequence[] = {
419 { &hf_ocsp_revocationTime , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
420 { &hf_ocsp_revocationReason, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_x509ce_CRLReason },
421 { NULL, 0, 0, 0, NULL }
425 dissect_ocsp_RevokedInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
426 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
427 RevokedInfo_sequence, hf_index, ett_ocsp_RevokedInfo);
435 dissect_ocsp_UnknownInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
436 offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
442 static const value_string ocsp_CertStatus_vals[] = {
449 static const ber_choice_t CertStatus_choice[] = {
450 { 0, &hf_ocsp_good , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ocsp_NULL },
451 { 1, &hf_ocsp_revoked , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ocsp_RevokedInfo },
452 { 2, &hf_ocsp_unknown , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ocsp_UnknownInfo },
453 { 0, NULL, 0, 0, 0, NULL }
457 dissect_ocsp_CertStatus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
458 offset = dissect_ber_choice(actx, tree, tvb, offset,
459 CertStatus_choice, hf_index, ett_ocsp_CertStatus,
466 static const ber_sequence_t SingleResponse_sequence[] = {
467 { &hf_ocsp_certID , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_CertID },
468 { &hf_ocsp_certStatus , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ocsp_CertStatus },
469 { &hf_ocsp_thisUpdate , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
470 { &hf_ocsp_nextUpdate , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_GeneralizedTime },
471 { &hf_ocsp_singleExtensions, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
472 { NULL, 0, 0, 0, NULL }
476 dissect_ocsp_SingleResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
477 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
478 SingleResponse_sequence, hf_index, ett_ocsp_SingleResponse);
484 static const ber_sequence_t SEQUENCE_OF_SingleResponse_sequence_of[1] = {
485 { &hf_ocsp_responses_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SingleResponse },
489 dissect_ocsp_SEQUENCE_OF_SingleResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
490 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
491 SEQUENCE_OF_SingleResponse_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_SingleResponse);
497 static const ber_sequence_t ResponseData_sequence[] = {
498 { &hf_ocsp_version , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Version },
499 { &hf_ocsp_responderID , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ocsp_ResponderID },
500 { &hf_ocsp_producedAt , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
501 { &hf_ocsp_responses , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SEQUENCE_OF_SingleResponse },
502 { &hf_ocsp_responseExtensions, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
503 { NULL, 0, 0, 0, NULL }
507 dissect_ocsp_ResponseData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
508 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
509 ResponseData_sequence, hf_index, ett_ocsp_ResponseData);
515 static const ber_sequence_t BasicOCSPResponse_sequence[] = {
516 { &hf_ocsp_tbsResponseData, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_ResponseData },
517 { &hf_ocsp_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
518 { &hf_ocsp_signature , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_BIT_STRING },
519 { &hf_ocsp_certs , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_SEQUENCE_OF_Certificate },
520 { NULL, 0, 0, 0, NULL }
524 dissect_ocsp_BasicOCSPResponse(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
525 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
526 BasicOCSPResponse_sequence, hf_index, ett_ocsp_BasicOCSPResponse);
534 dissect_ocsp_ArchiveCutoff(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
535 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
543 dissect_ocsp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
544 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
550 static const ber_sequence_t AcceptableResponses_sequence_of[1] = {
551 { &hf_ocsp_AcceptableResponses_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ocsp_OBJECT_IDENTIFIER },
555 dissect_ocsp_AcceptableResponses(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
556 offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
557 AcceptableResponses_sequence_of, hf_index, ett_ocsp_AcceptableResponses);
563 static const ber_sequence_t ServiceLocator_sequence[] = {
564 { &hf_ocsp_issuer , BER_CLASS_ANY, -1, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_Name },
565 { &hf_ocsp_locator , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1implicit_AuthorityInfoAccessSyntax },
566 { NULL, 0, 0, 0, NULL }
570 dissect_ocsp_ServiceLocator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
571 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
572 ServiceLocator_sequence, hf_index, ett_ocsp_ServiceLocator);
580 dissect_ocsp_IA5String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
581 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String,
582 actx, tree, tvb, offset, hf_index,
591 dissect_ocsp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
592 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
599 static const ber_sequence_t CrlID_sequence[] = {
600 { &hf_ocsp_crlUrl , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_IA5String },
601 { &hf_ocsp_crlNum , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ocsp_INTEGER },
602 { &hf_ocsp_crlTime , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_ocsp_GeneralizedTime },
603 { NULL, 0, 0, 0, NULL }
607 dissect_ocsp_CrlID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
608 offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
609 CrlID_sequence, hf_index, ett_ocsp_CrlID);
616 static void dissect_BasicOCSPResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
618 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
619 dissect_ocsp_BasicOCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_BasicOCSPResponse_PDU);
621 static void dissect_ArchiveCutoff_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
623 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
624 dissect_ocsp_ArchiveCutoff(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_ArchiveCutoff_PDU);
626 static void dissect_AcceptableResponses_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
628 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
629 dissect_ocsp_AcceptableResponses(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_AcceptableResponses_PDU);
631 static void dissect_ServiceLocator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
633 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
634 dissect_ocsp_ServiceLocator(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_ServiceLocator_PDU);
636 static void dissect_CrlID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
638 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
639 dissect_ocsp_CrlID(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_CrlID_PDU);
641 static void dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
643 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
644 dissect_ocsp_NULL(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_NULL_PDU);
648 /*--- End of included file: packet-ocsp-fn.c ---*/
649 #line 57 "../../asn1/ocsp/packet-ocsp-template.c"
653 dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
655 proto_item *item=NULL;
656 proto_tree *tree=NULL;
658 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
660 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
662 col_set_str(pinfo->cinfo, COL_INFO, "Request");
666 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
667 tree = proto_item_add_subtree(item, ett_ocsp);
670 return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, &asn1_ctx, tree, -1);
675 dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
677 proto_item *item=NULL;
678 proto_tree *tree=NULL;
680 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
682 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
684 col_set_str(pinfo->cinfo, COL_INFO, "Response");
688 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
689 tree = proto_item_add_subtree(item, ett_ocsp);
692 return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, -1);
695 /*--- proto_register_ocsp ----------------------------------------------*/
696 void proto_register_ocsp(void) {
699 static hf_register_info hf[] = {
700 { &hf_ocsp_responseType_id,
701 { "ResponseType Id", "x509af.responseType.id",
702 FT_STRING, BASE_NONE, NULL, 0,
705 /*--- Included file: packet-ocsp-hfarr.c ---*/
706 #line 1 "../../asn1/ocsp/packet-ocsp-hfarr.c"
707 { &hf_ocsp_BasicOCSPResponse_PDU,
708 { "BasicOCSPResponse", "ocsp.BasicOCSPResponse_element",
709 FT_NONE, BASE_NONE, NULL, 0,
711 { &hf_ocsp_ArchiveCutoff_PDU,
712 { "ArchiveCutoff", "ocsp.ArchiveCutoff",
713 FT_STRING, BASE_NONE, NULL, 0,
715 { &hf_ocsp_AcceptableResponses_PDU,
716 { "AcceptableResponses", "ocsp.AcceptableResponses",
717 FT_UINT32, BASE_DEC, NULL, 0,
719 { &hf_ocsp_ServiceLocator_PDU,
720 { "ServiceLocator", "ocsp.ServiceLocator_element",
721 FT_NONE, BASE_NONE, NULL, 0,
723 { &hf_ocsp_CrlID_PDU,
724 { "CrlID", "ocsp.CrlID_element",
725 FT_NONE, BASE_NONE, NULL, 0,
728 { "NULL", "ocsp.NULL_element",
729 FT_NONE, BASE_NONE, NULL, 0,
731 { &hf_ocsp_tbsRequest,
732 { "tbsRequest", "ocsp.tbsRequest_element",
733 FT_NONE, BASE_NONE, NULL, 0,
735 { &hf_ocsp_optionalSignature,
736 { "optionalSignature", "ocsp.optionalSignature_element",
737 FT_NONE, BASE_NONE, NULL, 0,
738 "Signature", HFILL }},
740 { "version", "ocsp.version",
741 FT_INT32, BASE_DEC, VALS(pkix1explicit_Version_vals), 0,
743 { &hf_ocsp_requestorName,
744 { "requestorName", "ocsp.requestorName",
745 FT_UINT32, BASE_DEC, VALS(x509ce_GeneralName_vals), 0,
746 "GeneralName", HFILL }},
747 { &hf_ocsp_requestList,
748 { "requestList", "ocsp.requestList",
749 FT_UINT32, BASE_DEC, NULL, 0,
750 "SEQUENCE_OF_Request", HFILL }},
751 { &hf_ocsp_requestList_item,
752 { "Request", "ocsp.Request_element",
753 FT_NONE, BASE_NONE, NULL, 0,
755 { &hf_ocsp_requestExtensions,
756 { "requestExtensions", "ocsp.requestExtensions",
757 FT_UINT32, BASE_DEC, NULL, 0,
758 "Extensions", HFILL }},
759 { &hf_ocsp_signatureAlgorithm,
760 { "signatureAlgorithm", "ocsp.signatureAlgorithm_element",
761 FT_NONE, BASE_NONE, NULL, 0,
762 "AlgorithmIdentifier", HFILL }},
763 { &hf_ocsp_signature,
764 { "signature", "ocsp.signature",
765 FT_BYTES, BASE_NONE, NULL, 0,
766 "BIT_STRING", HFILL }},
768 { "certs", "ocsp.certs",
769 FT_UINT32, BASE_DEC, NULL, 0,
770 "SEQUENCE_OF_Certificate", HFILL }},
771 { &hf_ocsp_certs_item,
772 { "Certificate", "ocsp.Certificate_element",
773 FT_NONE, BASE_NONE, NULL, 0,
776 { "reqCert", "ocsp.reqCert_element",
777 FT_NONE, BASE_NONE, NULL, 0,
779 { &hf_ocsp_singleRequestExtensions,
780 { "singleRequestExtensions", "ocsp.singleRequestExtensions",
781 FT_UINT32, BASE_DEC, NULL, 0,
782 "Extensions", HFILL }},
783 { &hf_ocsp_hashAlgorithm,
784 { "hashAlgorithm", "ocsp.hashAlgorithm_element",
785 FT_NONE, BASE_NONE, NULL, 0,
786 "AlgorithmIdentifier", HFILL }},
787 { &hf_ocsp_issuerNameHash,
788 { "issuerNameHash", "ocsp.issuerNameHash",
789 FT_BYTES, BASE_NONE, NULL, 0,
790 "OCTET_STRING", HFILL }},
791 { &hf_ocsp_issuerKeyHash,
792 { "issuerKeyHash", "ocsp.issuerKeyHash",
793 FT_BYTES, BASE_NONE, NULL, 0,
794 "OCTET_STRING", HFILL }},
795 { &hf_ocsp_serialNumber,
796 { "serialNumber", "ocsp.serialNumber",
797 FT_INT32, BASE_DEC, NULL, 0,
798 "CertificateSerialNumber", HFILL }},
799 { &hf_ocsp_responseStatus,
800 { "responseStatus", "ocsp.responseStatus",
801 FT_UINT32, BASE_DEC, VALS(ocsp_OCSPResponseStatus_vals), 0,
802 "OCSPResponseStatus", HFILL }},
803 { &hf_ocsp_responseBytes,
804 { "responseBytes", "ocsp.responseBytes_element",
805 FT_NONE, BASE_NONE, NULL, 0,
807 { &hf_ocsp_responseType,
808 { "responseType", "ocsp.responseType",
809 FT_OID, BASE_NONE, NULL, 0,
812 { "response", "ocsp.response",
813 FT_BYTES, BASE_NONE, NULL, 0,
815 { &hf_ocsp_tbsResponseData,
816 { "tbsResponseData", "ocsp.tbsResponseData_element",
817 FT_NONE, BASE_NONE, NULL, 0,
818 "ResponseData", HFILL }},
819 { &hf_ocsp_responderID,
820 { "responderID", "ocsp.responderID",
821 FT_UINT32, BASE_DEC, VALS(ocsp_ResponderID_vals), 0,
823 { &hf_ocsp_producedAt,
824 { "producedAt", "ocsp.producedAt",
825 FT_STRING, BASE_NONE, NULL, 0,
826 "GeneralizedTime", HFILL }},
827 { &hf_ocsp_responses,
828 { "responses", "ocsp.responses",
829 FT_UINT32, BASE_DEC, NULL, 0,
830 "SEQUENCE_OF_SingleResponse", HFILL }},
831 { &hf_ocsp_responses_item,
832 { "SingleResponse", "ocsp.SingleResponse_element",
833 FT_NONE, BASE_NONE, NULL, 0,
835 { &hf_ocsp_responseExtensions,
836 { "responseExtensions", "ocsp.responseExtensions",
837 FT_UINT32, BASE_DEC, NULL, 0,
838 "Extensions", HFILL }},
840 { "byName", "ocsp.byName",
841 FT_UINT32, BASE_DEC, NULL, 0,
844 { "byKey", "ocsp.byKey",
845 FT_BYTES, BASE_NONE, NULL, 0,
848 { "certID", "ocsp.certID_element",
849 FT_NONE, BASE_NONE, NULL, 0,
851 { &hf_ocsp_certStatus,
852 { "certStatus", "ocsp.certStatus",
853 FT_UINT32, BASE_DEC, VALS(ocsp_CertStatus_vals), 0,
855 { &hf_ocsp_thisUpdate,
856 { "thisUpdate", "ocsp.thisUpdate",
857 FT_STRING, BASE_NONE, NULL, 0,
858 "GeneralizedTime", HFILL }},
859 { &hf_ocsp_nextUpdate,
860 { "nextUpdate", "ocsp.nextUpdate",
861 FT_STRING, BASE_NONE, NULL, 0,
862 "GeneralizedTime", HFILL }},
863 { &hf_ocsp_singleExtensions,
864 { "singleExtensions", "ocsp.singleExtensions",
865 FT_UINT32, BASE_DEC, NULL, 0,
866 "Extensions", HFILL }},
868 { "good", "ocsp.good_element",
869 FT_NONE, BASE_NONE, NULL, 0,
872 { "revoked", "ocsp.revoked_element",
873 FT_NONE, BASE_NONE, NULL, 0,
874 "RevokedInfo", HFILL }},
876 { "unknown", "ocsp.unknown_element",
877 FT_NONE, BASE_NONE, NULL, 0,
878 "UnknownInfo", HFILL }},
879 { &hf_ocsp_revocationTime,
880 { "revocationTime", "ocsp.revocationTime",
881 FT_STRING, BASE_NONE, NULL, 0,
882 "GeneralizedTime", HFILL }},
883 { &hf_ocsp_revocationReason,
884 { "revocationReason", "ocsp.revocationReason",
885 FT_UINT32, BASE_DEC, VALS(x509ce_CRLReason_vals), 0,
886 "CRLReason", HFILL }},
887 { &hf_ocsp_AcceptableResponses_item,
888 { "AcceptableResponses item", "ocsp.AcceptableResponses_item",
889 FT_OID, BASE_NONE, NULL, 0,
890 "OBJECT_IDENTIFIER", HFILL }},
892 { "issuer", "ocsp.issuer",
893 FT_UINT32, BASE_DEC, NULL, 0,
896 { "locator", "ocsp.locator",
897 FT_UINT32, BASE_DEC, NULL, 0,
898 "AuthorityInfoAccessSyntax", HFILL }},
900 { "crlUrl", "ocsp.crlUrl",
901 FT_STRING, BASE_NONE, NULL, 0,
902 "IA5String", HFILL }},
904 { "crlNum", "ocsp.crlNum",
905 FT_INT32, BASE_DEC, NULL, 0,
908 { "crlTime", "ocsp.crlTime",
909 FT_STRING, BASE_NONE, NULL, 0,
910 "GeneralizedTime", HFILL }},
912 /*--- End of included file: packet-ocsp-hfarr.c ---*/
913 #line 112 "../../asn1/ocsp/packet-ocsp-template.c"
916 /* List of subtrees */
917 static gint *ett[] = {
920 /*--- Included file: packet-ocsp-ettarr.c ---*/
921 #line 1 "../../asn1/ocsp/packet-ocsp-ettarr.c"
922 &ett_ocsp_OCSPRequest,
923 &ett_ocsp_TBSRequest,
924 &ett_ocsp_SEQUENCE_OF_Request,
926 &ett_ocsp_SEQUENCE_OF_Certificate,
929 &ett_ocsp_OCSPResponse,
930 &ett_ocsp_ResponseBytes,
931 &ett_ocsp_BasicOCSPResponse,
932 &ett_ocsp_ResponseData,
933 &ett_ocsp_SEQUENCE_OF_SingleResponse,
934 &ett_ocsp_ResponderID,
935 &ett_ocsp_SingleResponse,
936 &ett_ocsp_CertStatus,
937 &ett_ocsp_RevokedInfo,
938 &ett_ocsp_AcceptableResponses,
939 &ett_ocsp_ServiceLocator,
942 /*--- End of included file: packet-ocsp-ettarr.c ---*/
943 #line 118 "../../asn1/ocsp/packet-ocsp-template.c"
946 /* Register protocol */
947 proto_ocsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
949 /* Register fields and subtrees */
950 proto_register_field_array(proto_ocsp, hf, array_length(hf));
951 proto_register_subtree_array(ett, array_length(ett));
955 /*--- proto_reg_handoff_ocsp -------------------------------------------*/
956 void proto_reg_handoff_ocsp(void) {
957 dissector_handle_t ocsp_request_handle;
958 dissector_handle_t ocsp_response_handle;
960 ocsp_request_handle = new_create_dissector_handle(dissect_ocsp_request, proto_ocsp);
961 ocsp_response_handle = new_create_dissector_handle(dissect_ocsp_response, proto_ocsp);
963 dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle);
964 dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle);
967 /*--- Included file: packet-ocsp-dis-tab.c ---*/
968 #line 1 "../../asn1/ocsp/packet-ocsp-dis-tab.c"
969 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.1", dissect_BasicOCSPResponse_PDU, proto_ocsp, "id-pkix-ocsp-basic");
970 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.3", dissect_CrlID_PDU, proto_ocsp, "id-pkix-ocsp-crl");
971 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.4", dissect_AcceptableResponses_PDU, proto_ocsp, "id-pkix-ocsp-response");
972 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.5", dissect_NULL_PDU, proto_ocsp, "id-pkix-ocsp-nocheck");
973 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.6", dissect_ArchiveCutoff_PDU, proto_ocsp, "id-pkix-ocsp-archive-cutoff");
974 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.7", dissect_ServiceLocator_PDU, proto_ocsp, "id-pkix-ocsp-service-locator");
977 /*--- End of included file: packet-ocsp-dis-tab.c ---*/
978 #line 141 "../../asn1/ocsp/packet-ocsp-template.c"