1 /* Do not modify this file. */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler */
4 /* ../../tools/asn2eth.py -X -b -e -p ocsp -c ocsp.cnf -s packet-ocsp-template OCSP.asn */
6 /* Input file: packet-ocsp-template.c */
8 #line 1 "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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
44 #include "packet-ber.h"
45 #include "packet-ocsp.h"
46 #include "packet-x509af.h"
47 #include "packet-x509ce.h"
48 #include "packet-pkix1implicit.h"
49 #include "packet-pkix1explicit.h"
51 #define PNAME "Online Certificate Status Protocol"
55 /* Initialize the protocol and registered fields */
56 static int proto_ocsp = -1;
57 static int hf_ocsp_responseType_id = -1;
59 /*--- Included file: packet-ocsp-hf.c ---*/
60 #line 1 "packet-ocsp-hf.c"
61 static int hf_ocsp_BasicOCSPResponse_PDU = -1; /* BasicOCSPResponse */
62 static int hf_ocsp_ArchiveCutoff_PDU = -1; /* ArchiveCutoff */
63 static int hf_ocsp_AcceptableResponses_PDU = -1; /* AcceptableResponses */
64 static int hf_ocsp_ServiceLocator_PDU = -1; /* ServiceLocator */
65 static int hf_ocsp_CrlID_PDU = -1; /* CrlID */
66 static int hf_ocsp_tbsRequest = -1; /* TBSRequest */
67 static int hf_ocsp_optionalSignature = -1; /* Signature */
68 static int hf_ocsp_version = -1; /* Version */
69 static int hf_ocsp_requestorName = -1; /* GeneralName */
70 static int hf_ocsp_requestList = -1; /* SEQUENCE_OF_Request */
71 static int hf_ocsp_requestList_item = -1; /* Request */
72 static int hf_ocsp_requestExtensions = -1; /* Extensions */
73 static int hf_ocsp_signatureAlgorithm = -1; /* AlgorithmIdentifier */
74 static int hf_ocsp_signature = -1; /* BIT_STRING */
75 static int hf_ocsp_certs = -1; /* SEQUENCE_OF_Certificate */
76 static int hf_ocsp_certs_item = -1; /* Certificate */
77 static int hf_ocsp_reqCert = -1; /* CertID */
78 static int hf_ocsp_singleRequestExtensions = -1; /* Extensions */
79 static int hf_ocsp_hashAlgorithm = -1; /* AlgorithmIdentifier */
80 static int hf_ocsp_issuerNameHash = -1; /* OCTET_STRING */
81 static int hf_ocsp_issuerKeyHash = -1; /* OCTET_STRING */
82 static int hf_ocsp_serialNumber = -1; /* CertificateSerialNumber */
83 static int hf_ocsp_responseStatus = -1; /* OCSPResponseStatus */
84 static int hf_ocsp_responseBytes = -1; /* ResponseBytes */
85 static int hf_ocsp_responseType = -1; /* T_responseType */
86 static int hf_ocsp_response = -1; /* T_response */
87 static int hf_ocsp_tbsResponseData = -1; /* ResponseData */
88 static int hf_ocsp_responderID = -1; /* ResponderID */
89 static int hf_ocsp_producedAt = -1; /* GeneralizedTime */
90 static int hf_ocsp_responses = -1; /* SEQUENCE_OF_SingleResponse */
91 static int hf_ocsp_responses_item = -1; /* SingleResponse */
92 static int hf_ocsp_responseExtensions = -1; /* Extensions */
93 static int hf_ocsp_byName = -1; /* Name */
94 static int hf_ocsp_byKey = -1; /* KeyHash */
95 static int hf_ocsp_certID = -1; /* CertID */
96 static int hf_ocsp_certStatus = -1; /* CertStatus */
97 static int hf_ocsp_thisUpdate = -1; /* GeneralizedTime */
98 static int hf_ocsp_nextUpdate = -1; /* GeneralizedTime */
99 static int hf_ocsp_singleExtensions = -1; /* Extensions */
100 static int hf_ocsp_good = -1; /* NULL */
101 static int hf_ocsp_revoked = -1; /* RevokedInfo */
102 static int hf_ocsp_unknown = -1; /* UnknownInfo */
103 static int hf_ocsp_revocationTime = -1; /* GeneralizedTime */
104 static int hf_ocsp_revocationReason = -1; /* CRLReason */
105 static int hf_ocsp_AcceptableResponses_item = -1; /* OBJECT_IDENTIFIER */
106 static int hf_ocsp_issuer = -1; /* Name */
107 static int hf_ocsp_locator = -1; /* AuthorityInfoAccessSyntax */
108 static int hf_ocsp_crlUrl = -1; /* IA5String */
109 static int hf_ocsp_crlNum = -1; /* INTEGER */
110 static int hf_ocsp_crlTime = -1; /* GeneralizedTime */
112 /*--- End of included file: packet-ocsp-hf.c ---*/
113 #line 51 "packet-ocsp-template.c"
115 /* Initialize the subtree pointers */
116 static gint ett_ocsp = -1;
118 /*--- Included file: packet-ocsp-ett.c ---*/
119 #line 1 "packet-ocsp-ett.c"
120 static gint ett_ocsp_OCSPRequest = -1;
121 static gint ett_ocsp_TBSRequest = -1;
122 static gint ett_ocsp_SEQUENCE_OF_Request = -1;
123 static gint ett_ocsp_Signature = -1;
124 static gint ett_ocsp_SEQUENCE_OF_Certificate = -1;
125 static gint ett_ocsp_Request = -1;
126 static gint ett_ocsp_CertID = -1;
127 static gint ett_ocsp_OCSPResponse = -1;
128 static gint ett_ocsp_ResponseBytes = -1;
129 static gint ett_ocsp_BasicOCSPResponse = -1;
130 static gint ett_ocsp_ResponseData = -1;
131 static gint ett_ocsp_SEQUENCE_OF_SingleResponse = -1;
132 static gint ett_ocsp_ResponderID = -1;
133 static gint ett_ocsp_SingleResponse = -1;
134 static gint ett_ocsp_CertStatus = -1;
135 static gint ett_ocsp_RevokedInfo = -1;
136 static gint ett_ocsp_AcceptableResponses = -1;
137 static gint ett_ocsp_ServiceLocator = -1;
138 static gint ett_ocsp_CrlID = -1;
140 /*--- End of included file: packet-ocsp-ett.c ---*/
141 #line 55 "packet-ocsp-template.c"
143 static const char *responseType_id;
147 /*--- Included file: packet-ocsp-fn.c ---*/
148 #line 1 "packet-ocsp-fn.c"
149 /*--- Fields for imported types ---*/
151 static int dissect_requestorName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
152 return dissect_pkix1explicit_GeneralName(FALSE, tvb, offset, pinfo, tree, hf_ocsp_requestorName);
154 static int dissect_requestExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
155 return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_ocsp_requestExtensions);
157 static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
158 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ocsp_signatureAlgorithm);
160 static int dissect_certs_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
161 return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_ocsp_certs_item);
163 static int dissect_singleRequestExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
164 return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_ocsp_singleRequestExtensions);
166 static int dissect_hashAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
167 return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_ocsp_hashAlgorithm);
169 static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
170 return dissect_pkix1explicit_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_ocsp_serialNumber);
172 static int dissect_responseExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
173 return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responseExtensions);
175 static int dissect_byName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
176 return dissect_pkix1explicit_Name(FALSE, tvb, offset, pinfo, tree, hf_ocsp_byName);
178 static int dissect_singleExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
179 return dissect_pkix1explicit_Extensions(FALSE, tvb, offset, pinfo, tree, hf_ocsp_singleExtensions);
181 static int dissect_revocationReason(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
182 return dissect_x509ce_CRLReason(FALSE, tvb, offset, pinfo, tree, hf_ocsp_revocationReason);
184 static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
185 return dissect_pkix1explicit_Name(FALSE, tvb, offset, pinfo, tree, hf_ocsp_issuer);
187 static int dissect_locator(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
188 return dissect_pkix1implicit_AuthorityInfoAccessSyntax(FALSE, tvb, offset, pinfo, tree, hf_ocsp_locator);
192 static const value_string ocsp_Version_vals[] = {
199 dissect_ocsp_Version(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
200 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
205 static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
206 return dissect_ocsp_Version(FALSE, tvb, offset, pinfo, tree, hf_ocsp_version);
212 dissect_ocsp_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
213 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
218 static int dissect_issuerNameHash(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
219 return dissect_ocsp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_ocsp_issuerNameHash);
221 static int dissect_issuerKeyHash(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
222 return dissect_ocsp_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_ocsp_issuerKeyHash);
226 static const ber_sequence_t CertID_sequence[] = {
227 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_hashAlgorithm },
228 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_issuerNameHash },
229 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_issuerKeyHash },
230 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
235 dissect_ocsp_CertID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
236 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
237 CertID_sequence, hf_index, ett_ocsp_CertID);
241 static int dissect_reqCert(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
242 return dissect_ocsp_CertID(FALSE, tvb, offset, pinfo, tree, hf_ocsp_reqCert);
244 static int dissect_certID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
245 return dissect_ocsp_CertID(FALSE, tvb, offset, pinfo, tree, hf_ocsp_certID);
249 static const ber_sequence_t Request_sequence[] = {
250 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_reqCert },
251 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_singleRequestExtensions },
256 dissect_ocsp_Request(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
257 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
258 Request_sequence, hf_index, ett_ocsp_Request);
262 static int dissect_requestList_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
263 return dissect_ocsp_Request(FALSE, tvb, offset, pinfo, tree, hf_ocsp_requestList_item);
267 static const ber_sequence_t SEQUENCE_OF_Request_sequence_of[1] = {
268 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_requestList_item },
272 dissect_ocsp_SEQUENCE_OF_Request(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
273 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
274 SEQUENCE_OF_Request_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Request);
278 static int dissect_requestList(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
279 return dissect_ocsp_SEQUENCE_OF_Request(FALSE, tvb, offset, pinfo, tree, hf_ocsp_requestList);
283 static const ber_sequence_t TBSRequest_sequence[] = {
284 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version },
285 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_requestorName },
286 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_requestList },
287 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_requestExtensions },
292 dissect_ocsp_TBSRequest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
293 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
294 TBSRequest_sequence, hf_index, ett_ocsp_TBSRequest);
298 static int dissect_tbsRequest(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
299 return dissect_ocsp_TBSRequest(FALSE, tvb, offset, pinfo, tree, hf_ocsp_tbsRequest);
305 dissect_ocsp_BIT_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
306 offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset,
312 static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
313 return dissect_ocsp_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_ocsp_signature);
317 static const ber_sequence_t SEQUENCE_OF_Certificate_sequence_of[1] = {
318 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certs_item },
322 dissect_ocsp_SEQUENCE_OF_Certificate(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
323 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
324 SEQUENCE_OF_Certificate_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Certificate);
328 static int dissect_certs(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
329 return dissect_ocsp_SEQUENCE_OF_Certificate(FALSE, tvb, offset, pinfo, tree, hf_ocsp_certs);
333 static const ber_sequence_t Signature_sequence[] = {
334 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
335 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
336 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_certs },
341 dissect_ocsp_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
342 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
343 Signature_sequence, hf_index, ett_ocsp_Signature);
347 static int dissect_optionalSignature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
348 return dissect_ocsp_Signature(FALSE, tvb, offset, pinfo, tree, hf_ocsp_optionalSignature);
352 static const ber_sequence_t OCSPRequest_sequence[] = {
353 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_tbsRequest },
354 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_optionalSignature },
359 dissect_ocsp_OCSPRequest(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
360 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
361 OCSPRequest_sequence, hf_index, ett_ocsp_OCSPRequest);
367 static const value_string ocsp_OCSPResponseStatus_vals[] = {
369 { 1, "malformedRequest" },
370 { 2, "internalError" },
372 { 5, "sigRequired" },
373 { 6, "unauthorized" },
379 dissect_ocsp_OCSPResponseStatus(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
380 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
385 static int dissect_responseStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
386 return dissect_ocsp_OCSPResponseStatus(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responseStatus);
392 dissect_ocsp_T_responseType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
393 offset = dissect_ber_object_identifier_str(implicit_tag, pinfo, tree, tvb, offset, hf_ocsp_responseType_id, &responseType_id);
397 static int dissect_responseType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
398 return dissect_ocsp_T_responseType(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responseType);
404 dissect_ocsp_T_response(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
410 /* skip past the T and L */
411 offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
412 offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
413 offset=call_ber_oid_callback(responseType_id, tvb, offset, pinfo, tree);
419 static int dissect_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
420 return dissect_ocsp_T_response(FALSE, tvb, offset, pinfo, tree, hf_ocsp_response);
424 static const ber_sequence_t ResponseBytes_sequence[] = {
425 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_responseType },
426 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_response },
431 dissect_ocsp_ResponseBytes(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
432 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
433 ResponseBytes_sequence, hf_index, ett_ocsp_ResponseBytes);
437 static int dissect_responseBytes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
438 return dissect_ocsp_ResponseBytes(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responseBytes);
442 static const ber_sequence_t OCSPResponse_sequence[] = {
443 { BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_responseStatus },
444 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_responseBytes },
449 dissect_ocsp_OCSPResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
450 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
451 OCSPResponse_sequence, hf_index, ett_ocsp_OCSPResponse);
459 dissect_ocsp_KeyHash(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
460 offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index,
465 static int dissect_byKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
466 return dissect_ocsp_KeyHash(FALSE, tvb, offset, pinfo, tree, hf_ocsp_byKey);
470 static const value_string ocsp_ResponderID_vals[] = {
476 static const ber_choice_t ResponderID_choice[] = {
477 { 1, BER_CLASS_CON, 1, 0, dissect_byName },
478 { 2, BER_CLASS_CON, 2, 0, dissect_byKey },
483 dissect_ocsp_ResponderID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
484 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
485 ResponderID_choice, hf_index, ett_ocsp_ResponderID,
490 static int dissect_responderID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
491 return dissect_ocsp_ResponderID(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responderID);
497 dissect_ocsp_GeneralizedTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
498 offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
502 static int dissect_producedAt(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
503 return dissect_ocsp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ocsp_producedAt);
505 static int dissect_thisUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
506 return dissect_ocsp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ocsp_thisUpdate);
508 static int dissect_nextUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
509 return dissect_ocsp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ocsp_nextUpdate);
511 static int dissect_revocationTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
512 return dissect_ocsp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ocsp_revocationTime);
514 static int dissect_crlTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
515 return dissect_ocsp_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_ocsp_crlTime);
521 dissect_ocsp_NULL(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
522 offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index);
526 static int dissect_good_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
527 return dissect_ocsp_NULL(TRUE, tvb, offset, pinfo, tree, hf_ocsp_good);
531 static const ber_sequence_t RevokedInfo_sequence[] = {
532 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_revocationTime },
533 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_revocationReason },
538 dissect_ocsp_RevokedInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
539 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
540 RevokedInfo_sequence, hf_index, ett_ocsp_RevokedInfo);
544 static int dissect_revoked_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
545 return dissect_ocsp_RevokedInfo(TRUE, tvb, offset, pinfo, tree, hf_ocsp_revoked);
551 dissect_ocsp_UnknownInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
552 offset = dissect_ber_null(implicit_tag, pinfo, tree, tvb, offset, hf_index);
556 static int dissect_unknown_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
557 return dissect_ocsp_UnknownInfo(TRUE, tvb, offset, pinfo, tree, hf_ocsp_unknown);
561 static const value_string ocsp_CertStatus_vals[] = {
568 static const ber_choice_t CertStatus_choice[] = {
569 { 0, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_good_impl },
570 { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_revoked_impl },
571 { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_unknown_impl },
576 dissect_ocsp_CertStatus(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
577 offset = dissect_ber_choice(pinfo, tree, tvb, offset,
578 CertStatus_choice, hf_index, ett_ocsp_CertStatus,
583 static int dissect_certStatus(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
584 return dissect_ocsp_CertStatus(FALSE, tvb, offset, pinfo, tree, hf_ocsp_certStatus);
588 static const ber_sequence_t SingleResponse_sequence[] = {
589 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certID },
590 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_certStatus },
591 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_thisUpdate },
592 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_nextUpdate },
593 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_singleExtensions },
598 dissect_ocsp_SingleResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
599 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
600 SingleResponse_sequence, hf_index, ett_ocsp_SingleResponse);
604 static int dissect_responses_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
605 return dissect_ocsp_SingleResponse(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responses_item);
609 static const ber_sequence_t SEQUENCE_OF_SingleResponse_sequence_of[1] = {
610 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_responses_item },
614 dissect_ocsp_SEQUENCE_OF_SingleResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
615 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
616 SEQUENCE_OF_SingleResponse_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_SingleResponse);
620 static int dissect_responses(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
621 return dissect_ocsp_SEQUENCE_OF_SingleResponse(FALSE, tvb, offset, pinfo, tree, hf_ocsp_responses);
625 static const ber_sequence_t ResponseData_sequence[] = {
626 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version },
627 { BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_responderID },
628 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_producedAt },
629 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_responses },
630 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_responseExtensions },
635 dissect_ocsp_ResponseData(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
636 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
637 ResponseData_sequence, hf_index, ett_ocsp_ResponseData);
641 static int dissect_tbsResponseData(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
642 return dissect_ocsp_ResponseData(FALSE, tvb, offset, pinfo, tree, hf_ocsp_tbsResponseData);
646 static const ber_sequence_t BasicOCSPResponse_sequence[] = {
647 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_tbsResponseData },
648 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm },
649 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature },
650 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_certs },
655 dissect_ocsp_BasicOCSPResponse(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
656 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
657 BasicOCSPResponse_sequence, hf_index, ett_ocsp_BasicOCSPResponse);
665 dissect_ocsp_ArchiveCutoff(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
666 offset = dissect_ber_GeneralizedTime(implicit_tag, pinfo, tree, tvb, offset, hf_index);
674 dissect_ocsp_OBJECT_IDENTIFIER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
675 offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
679 static int dissect_AcceptableResponses_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
680 return dissect_ocsp_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_ocsp_AcceptableResponses_item);
684 static const ber_sequence_t AcceptableResponses_sequence_of[1] = {
685 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_AcceptableResponses_item },
689 dissect_ocsp_AcceptableResponses(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
690 offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset,
691 AcceptableResponses_sequence_of, hf_index, ett_ocsp_AcceptableResponses);
697 static const ber_sequence_t ServiceLocator_sequence[] = {
698 { BER_CLASS_ANY, -1, BER_FLAGS_NOOWNTAG, dissect_issuer },
699 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_locator },
704 dissect_ocsp_ServiceLocator(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
705 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
706 ServiceLocator_sequence, hf_index, ett_ocsp_ServiceLocator);
714 dissect_ocsp_IA5String(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
715 offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String,
716 pinfo, tree, tvb, offset, hf_index,
721 static int dissect_crlUrl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
722 return dissect_ocsp_IA5String(FALSE, tvb, offset, pinfo, tree, hf_ocsp_crlUrl);
728 dissect_ocsp_INTEGER(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
729 offset = dissect_ber_integer(implicit_tag, pinfo, tree, tvb, offset, hf_index,
734 static int dissect_crlNum(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
735 return dissect_ocsp_INTEGER(FALSE, tvb, offset, pinfo, tree, hf_ocsp_crlNum);
739 static const ber_sequence_t CrlID_sequence[] = {
740 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_crlUrl },
741 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_crlNum },
742 { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_crlTime },
747 dissect_ocsp_CrlID(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
748 offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
749 CrlID_sequence, hf_index, ett_ocsp_CrlID);
756 static void dissect_BasicOCSPResponse_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
757 dissect_ocsp_BasicOCSPResponse(FALSE, tvb, 0, pinfo, tree, hf_ocsp_BasicOCSPResponse_PDU);
759 static void dissect_ArchiveCutoff_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
760 dissect_ocsp_ArchiveCutoff(FALSE, tvb, 0, pinfo, tree, hf_ocsp_ArchiveCutoff_PDU);
762 static void dissect_AcceptableResponses_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
763 dissect_ocsp_AcceptableResponses(FALSE, tvb, 0, pinfo, tree, hf_ocsp_AcceptableResponses_PDU);
765 static void dissect_ServiceLocator_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
766 dissect_ocsp_ServiceLocator(FALSE, tvb, 0, pinfo, tree, hf_ocsp_ServiceLocator_PDU);
768 static void dissect_CrlID_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
769 dissect_ocsp_CrlID(FALSE, tvb, 0, pinfo, tree, hf_ocsp_CrlID_PDU);
773 /*--- End of included file: packet-ocsp-fn.c ---*/
774 #line 60 "packet-ocsp-template.c"
778 dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
780 proto_item *item=NULL;
781 proto_tree *tree=NULL;
783 if (check_col(pinfo->cinfo, COL_PROTOCOL))
784 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
786 if (check_col(pinfo->cinfo, COL_INFO)) {
787 col_clear(pinfo->cinfo, COL_INFO);
789 col_add_fstr(pinfo->cinfo, COL_INFO, "Request");
794 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, FALSE);
795 tree = proto_item_add_subtree(item, ett_ocsp);
798 return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, pinfo, tree, -1);
803 dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
805 proto_item *item=NULL;
806 proto_tree *tree=NULL;
808 if (check_col(pinfo->cinfo, COL_PROTOCOL))
809 col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
811 if (check_col(pinfo->cinfo, COL_INFO)) {
812 col_clear(pinfo->cinfo, COL_INFO);
814 col_add_fstr(pinfo->cinfo, COL_INFO, "Response");
819 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, FALSE);
820 tree = proto_item_add_subtree(item, ett_ocsp);
823 return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, pinfo, tree, -1);
826 /*--- proto_register_ocsp ----------------------------------------------*/
827 void proto_register_ocsp(void) {
830 static hf_register_info hf[] = {
831 { &hf_ocsp_responseType_id,
832 { "ResponseType Id", "x509af.responseType.id",
833 FT_STRING, BASE_NONE, NULL, 0,
834 "ResponseType Id", HFILL }},
836 /*--- Included file: packet-ocsp-hfarr.c ---*/
837 #line 1 "packet-ocsp-hfarr.c"
838 { &hf_ocsp_BasicOCSPResponse_PDU,
839 { "BasicOCSPResponse", "ocsp.BasicOCSPResponse",
840 FT_NONE, BASE_NONE, NULL, 0,
841 "BasicOCSPResponse", HFILL }},
842 { &hf_ocsp_ArchiveCutoff_PDU,
843 { "ArchiveCutoff", "ocsp.ArchiveCutoff",
844 FT_STRING, BASE_NONE, NULL, 0,
845 "ArchiveCutoff", HFILL }},
846 { &hf_ocsp_AcceptableResponses_PDU,
847 { "AcceptableResponses", "ocsp.AcceptableResponses",
848 FT_UINT32, BASE_DEC, NULL, 0,
849 "AcceptableResponses", HFILL }},
850 { &hf_ocsp_ServiceLocator_PDU,
851 { "ServiceLocator", "ocsp.ServiceLocator",
852 FT_NONE, BASE_NONE, NULL, 0,
853 "ServiceLocator", HFILL }},
854 { &hf_ocsp_CrlID_PDU,
855 { "CrlID", "ocsp.CrlID",
856 FT_NONE, BASE_NONE, NULL, 0,
858 { &hf_ocsp_tbsRequest,
859 { "tbsRequest", "ocsp.tbsRequest",
860 FT_NONE, BASE_NONE, NULL, 0,
861 "OCSPRequest/tbsRequest", HFILL }},
862 { &hf_ocsp_optionalSignature,
863 { "optionalSignature", "ocsp.optionalSignature",
864 FT_NONE, BASE_NONE, NULL, 0,
865 "OCSPRequest/optionalSignature", HFILL }},
867 { "version", "ocsp.version",
868 FT_INT32, BASE_DEC, VALS(x509af_Version_vals), 0,
870 { &hf_ocsp_requestorName,
871 { "requestorName", "ocsp.requestorName",
872 FT_UINT32, BASE_DEC, VALS(x509ce_GeneralName_vals), 0,
873 "TBSRequest/requestorName", HFILL }},
874 { &hf_ocsp_requestList,
875 { "requestList", "ocsp.requestList",
876 FT_UINT32, BASE_DEC, NULL, 0,
877 "TBSRequest/requestList", HFILL }},
878 { &hf_ocsp_requestList_item,
879 { "Item", "ocsp.requestList_item",
880 FT_NONE, BASE_NONE, NULL, 0,
881 "TBSRequest/requestList/_item", HFILL }},
882 { &hf_ocsp_requestExtensions,
883 { "requestExtensions", "ocsp.requestExtensions",
884 FT_UINT32, BASE_DEC, NULL, 0,
885 "TBSRequest/requestExtensions", HFILL }},
886 { &hf_ocsp_signatureAlgorithm,
887 { "signatureAlgorithm", "ocsp.signatureAlgorithm",
888 FT_NONE, BASE_NONE, NULL, 0,
890 { &hf_ocsp_signature,
891 { "signature", "ocsp.signature",
892 FT_BYTES, BASE_HEX, NULL, 0,
895 { "certs", "ocsp.certs",
896 FT_UINT32, BASE_DEC, NULL, 0,
898 { &hf_ocsp_certs_item,
899 { "Item", "ocsp.certs_item",
900 FT_NONE, BASE_NONE, NULL, 0,
903 { "reqCert", "ocsp.reqCert",
904 FT_NONE, BASE_NONE, NULL, 0,
905 "Request/reqCert", HFILL }},
906 { &hf_ocsp_singleRequestExtensions,
907 { "singleRequestExtensions", "ocsp.singleRequestExtensions",
908 FT_UINT32, BASE_DEC, NULL, 0,
909 "Request/singleRequestExtensions", HFILL }},
910 { &hf_ocsp_hashAlgorithm,
911 { "hashAlgorithm", "ocsp.hashAlgorithm",
912 FT_NONE, BASE_NONE, NULL, 0,
913 "CertID/hashAlgorithm", HFILL }},
914 { &hf_ocsp_issuerNameHash,
915 { "issuerNameHash", "ocsp.issuerNameHash",
916 FT_BYTES, BASE_HEX, NULL, 0,
917 "CertID/issuerNameHash", HFILL }},
918 { &hf_ocsp_issuerKeyHash,
919 { "issuerKeyHash", "ocsp.issuerKeyHash",
920 FT_BYTES, BASE_HEX, NULL, 0,
921 "CertID/issuerKeyHash", HFILL }},
922 { &hf_ocsp_serialNumber,
923 { "serialNumber", "ocsp.serialNumber",
924 FT_INT32, BASE_DEC, NULL, 0,
925 "CertID/serialNumber", HFILL }},
926 { &hf_ocsp_responseStatus,
927 { "responseStatus", "ocsp.responseStatus",
928 FT_UINT32, BASE_DEC, VALS(ocsp_OCSPResponseStatus_vals), 0,
929 "OCSPResponse/responseStatus", HFILL }},
930 { &hf_ocsp_responseBytes,
931 { "responseBytes", "ocsp.responseBytes",
932 FT_NONE, BASE_NONE, NULL, 0,
933 "OCSPResponse/responseBytes", HFILL }},
934 { &hf_ocsp_responseType,
935 { "responseType", "ocsp.responseType",
936 FT_OID, BASE_NONE, NULL, 0,
937 "ResponseBytes/responseType", HFILL }},
939 { "response", "ocsp.response",
940 FT_BYTES, BASE_HEX, NULL, 0,
941 "ResponseBytes/response", HFILL }},
942 { &hf_ocsp_tbsResponseData,
943 { "tbsResponseData", "ocsp.tbsResponseData",
944 FT_NONE, BASE_NONE, NULL, 0,
945 "BasicOCSPResponse/tbsResponseData", HFILL }},
946 { &hf_ocsp_responderID,
947 { "responderID", "ocsp.responderID",
948 FT_UINT32, BASE_DEC, VALS(ocsp_ResponderID_vals), 0,
949 "ResponseData/responderID", HFILL }},
950 { &hf_ocsp_producedAt,
951 { "producedAt", "ocsp.producedAt",
952 FT_STRING, BASE_NONE, NULL, 0,
953 "ResponseData/producedAt", HFILL }},
954 { &hf_ocsp_responses,
955 { "responses", "ocsp.responses",
956 FT_UINT32, BASE_DEC, NULL, 0,
957 "ResponseData/responses", HFILL }},
958 { &hf_ocsp_responses_item,
959 { "Item", "ocsp.responses_item",
960 FT_NONE, BASE_NONE, NULL, 0,
961 "ResponseData/responses/_item", HFILL }},
962 { &hf_ocsp_responseExtensions,
963 { "responseExtensions", "ocsp.responseExtensions",
964 FT_UINT32, BASE_DEC, NULL, 0,
965 "ResponseData/responseExtensions", HFILL }},
967 { "byName", "ocsp.byName",
968 FT_UINT32, BASE_DEC, NULL, 0,
969 "ResponderID/byName", HFILL }},
971 { "byKey", "ocsp.byKey",
972 FT_BYTES, BASE_HEX, NULL, 0,
973 "ResponderID/byKey", HFILL }},
975 { "certID", "ocsp.certID",
976 FT_NONE, BASE_NONE, NULL, 0,
977 "SingleResponse/certID", HFILL }},
978 { &hf_ocsp_certStatus,
979 { "certStatus", "ocsp.certStatus",
980 FT_UINT32, BASE_DEC, VALS(ocsp_CertStatus_vals), 0,
981 "SingleResponse/certStatus", HFILL }},
982 { &hf_ocsp_thisUpdate,
983 { "thisUpdate", "ocsp.thisUpdate",
984 FT_STRING, BASE_NONE, NULL, 0,
985 "SingleResponse/thisUpdate", HFILL }},
986 { &hf_ocsp_nextUpdate,
987 { "nextUpdate", "ocsp.nextUpdate",
988 FT_STRING, BASE_NONE, NULL, 0,
989 "SingleResponse/nextUpdate", HFILL }},
990 { &hf_ocsp_singleExtensions,
991 { "singleExtensions", "ocsp.singleExtensions",
992 FT_UINT32, BASE_DEC, NULL, 0,
993 "SingleResponse/singleExtensions", HFILL }},
995 { "good", "ocsp.good",
996 FT_NONE, BASE_NONE, NULL, 0,
997 "CertStatus/good", HFILL }},
999 { "revoked", "ocsp.revoked",
1000 FT_NONE, BASE_NONE, NULL, 0,
1001 "CertStatus/revoked", HFILL }},
1003 { "unknown", "ocsp.unknown",
1004 FT_NONE, BASE_NONE, NULL, 0,
1005 "CertStatus/unknown", HFILL }},
1006 { &hf_ocsp_revocationTime,
1007 { "revocationTime", "ocsp.revocationTime",
1008 FT_STRING, BASE_NONE, NULL, 0,
1009 "RevokedInfo/revocationTime", HFILL }},
1010 { &hf_ocsp_revocationReason,
1011 { "revocationReason", "ocsp.revocationReason",
1012 FT_UINT32, BASE_DEC, VALS(x509ce_CRLReason_vals), 0,
1013 "RevokedInfo/revocationReason", HFILL }},
1014 { &hf_ocsp_AcceptableResponses_item,
1015 { "Item", "ocsp.AcceptableResponses_item",
1016 FT_OID, BASE_NONE, NULL, 0,
1017 "AcceptableResponses/_item", HFILL }},
1019 { "issuer", "ocsp.issuer",
1020 FT_UINT32, BASE_DEC, NULL, 0,
1021 "ServiceLocator/issuer", HFILL }},
1023 { "locator", "ocsp.locator",
1024 FT_UINT32, BASE_DEC, NULL, 0,
1025 "ServiceLocator/locator", HFILL }},
1027 { "crlUrl", "ocsp.crlUrl",
1028 FT_STRING, BASE_NONE, NULL, 0,
1029 "CrlID/crlUrl", HFILL }},
1031 { "crlNum", "ocsp.crlNum",
1032 FT_INT32, BASE_DEC, NULL, 0,
1033 "CrlID/crlNum", HFILL }},
1035 { "crlTime", "ocsp.crlTime",
1036 FT_STRING, BASE_NONE, NULL, 0,
1037 "CrlID/crlTime", HFILL }},
1039 /*--- End of included file: packet-ocsp-hfarr.c ---*/
1040 #line 121 "packet-ocsp-template.c"
1043 /* List of subtrees */
1044 static gint *ett[] = {
1047 /*--- Included file: packet-ocsp-ettarr.c ---*/
1048 #line 1 "packet-ocsp-ettarr.c"
1049 &ett_ocsp_OCSPRequest,
1050 &ett_ocsp_TBSRequest,
1051 &ett_ocsp_SEQUENCE_OF_Request,
1052 &ett_ocsp_Signature,
1053 &ett_ocsp_SEQUENCE_OF_Certificate,
1056 &ett_ocsp_OCSPResponse,
1057 &ett_ocsp_ResponseBytes,
1058 &ett_ocsp_BasicOCSPResponse,
1059 &ett_ocsp_ResponseData,
1060 &ett_ocsp_SEQUENCE_OF_SingleResponse,
1061 &ett_ocsp_ResponderID,
1062 &ett_ocsp_SingleResponse,
1063 &ett_ocsp_CertStatus,
1064 &ett_ocsp_RevokedInfo,
1065 &ett_ocsp_AcceptableResponses,
1066 &ett_ocsp_ServiceLocator,
1069 /*--- End of included file: packet-ocsp-ettarr.c ---*/
1070 #line 127 "packet-ocsp-template.c"
1073 /* Register protocol */
1074 proto_ocsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
1076 /* Register fields and subtrees */
1077 proto_register_field_array(proto_ocsp, hf, array_length(hf));
1078 proto_register_subtree_array(ett, array_length(ett));
1082 /*--- proto_reg_handoff_ocsp -------------------------------------------*/
1083 void proto_reg_handoff_ocsp(void) {
1084 dissector_handle_t ocsp_request_handle;
1085 dissector_handle_t ocsp_response_handle;
1087 ocsp_request_handle = new_create_dissector_handle(dissect_ocsp_request, proto_ocsp);
1088 ocsp_response_handle = new_create_dissector_handle(dissect_ocsp_response, proto_ocsp);
1090 dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle);
1091 dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle);
1094 /*--- Included file: packet-ocsp-dis-tab.c ---*/
1095 #line 1 "packet-ocsp-dis-tab.c"
1096 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.1", dissect_BasicOCSPResponse_PDU, proto_ocsp, "id-pkix-ocsp-basic");
1097 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.3", dissect_CrlID_PDU, proto_ocsp, "id-pkix-ocsp-crl");
1098 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.4", dissect_AcceptableResponses_PDU, proto_ocsp, "id-pkix-ocsp-response");
1099 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.6", dissect_ArchiveCutoff_PDU, proto_ocsp, "id-pkix-ocsp-archive-cutoff");
1100 register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.7", dissect_ServiceLocator_PDU, proto_ocsp, "id-pkix-ocsp-service-locator");
1103 /*--- End of included file: packet-ocsp-dis-tab.c ---*/
1104 #line 150 "packet-ocsp-template.c"