5889d5535e192e0687ecd2a9c4a4713fe07d3ebc
[obnox/wireshark/wip.git] / epan / dissectors / packet-ocsp.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* packet-ocsp.c                                                              */
4 /* ../../tools/asn2wrs.py -b -p ocsp -c ./ocsp.cnf -s ./packet-ocsp-template -D . OCSP.asn */
5
6 /* Input file: packet-ocsp-template.c */
7
8 #line 1 "packet-ocsp-template.c"
9 /* packet-ocsp.c
10  * Routines for Online Certificate Status Protocol (RFC2560) packet dissection
11  *  Ronnie Sahlberg 2004
12  *
13  * $Id$
14  *
15  * Wireshark - Network traffic analyzer
16  * By Gerald Combs <gerald@wireshark.org>
17  * Copyright 1998 Gerald Combs
18  *
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.
23  *
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.
28  *
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.
32  */
33
34 #ifdef HAVE_CONFIG_H
35 # include "config.h"
36 #endif
37
38 #include <glib.h>
39 #include <epan/packet.h>
40
41 #include <string.h>
42 #include <asn1.h>
43
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"
50
51 #define PNAME  "Online Certificate Status Protocol"
52 #define PSNAME "OCSP"
53 #define PFNAME "ocsp"
54
55 /* Initialize the protocol and registered fields */
56 static int proto_ocsp = -1;
57 static int hf_ocsp_responseType_id = -1;
58
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_NULL_PDU = -1;                 /* NULL */
67 static int hf_ocsp_tbsRequest = -1;               /* TBSRequest */
68 static int hf_ocsp_optionalSignature = -1;        /* Signature */
69 static int hf_ocsp_version = -1;                  /* Version */
70 static int hf_ocsp_requestorName = -1;            /* GeneralName */
71 static int hf_ocsp_requestList = -1;              /* SEQUENCE_OF_Request */
72 static int hf_ocsp_requestList_item = -1;         /* Request */
73 static int hf_ocsp_requestExtensions = -1;        /* Extensions */
74 static int hf_ocsp_signatureAlgorithm = -1;       /* AlgorithmIdentifier */
75 static int hf_ocsp_signature = -1;                /* BIT_STRING */
76 static int hf_ocsp_certs = -1;                    /* SEQUENCE_OF_Certificate */
77 static int hf_ocsp_certs_item = -1;               /* Certificate */
78 static int hf_ocsp_reqCert = -1;                  /* CertID */
79 static int hf_ocsp_singleRequestExtensions = -1;  /* Extensions */
80 static int hf_ocsp_hashAlgorithm = -1;            /* AlgorithmIdentifier */
81 static int hf_ocsp_issuerNameHash = -1;           /* OCTET_STRING */
82 static int hf_ocsp_issuerKeyHash = -1;            /* OCTET_STRING */
83 static int hf_ocsp_serialNumber = -1;             /* CertificateSerialNumber */
84 static int hf_ocsp_responseStatus = -1;           /* OCSPResponseStatus */
85 static int hf_ocsp_responseBytes = -1;            /* ResponseBytes */
86 static int hf_ocsp_responseType = -1;             /* T_responseType */
87 static int hf_ocsp_response = -1;                 /* T_response */
88 static int hf_ocsp_tbsResponseData = -1;          /* ResponseData */
89 static int hf_ocsp_responderID = -1;              /* ResponderID */
90 static int hf_ocsp_producedAt = -1;               /* GeneralizedTime */
91 static int hf_ocsp_responses = -1;                /* SEQUENCE_OF_SingleResponse */
92 static int hf_ocsp_responses_item = -1;           /* SingleResponse */
93 static int hf_ocsp_responseExtensions = -1;       /* Extensions */
94 static int hf_ocsp_byName = -1;                   /* Name */
95 static int hf_ocsp_byKey = -1;                    /* KeyHash */
96 static int hf_ocsp_certID = -1;                   /* CertID */
97 static int hf_ocsp_certStatus = -1;               /* CertStatus */
98 static int hf_ocsp_thisUpdate = -1;               /* GeneralizedTime */
99 static int hf_ocsp_nextUpdate = -1;               /* GeneralizedTime */
100 static int hf_ocsp_singleExtensions = -1;         /* Extensions */
101 static int hf_ocsp_good = -1;                     /* NULL */
102 static int hf_ocsp_revoked = -1;                  /* RevokedInfo */
103 static int hf_ocsp_unknown = -1;                  /* UnknownInfo */
104 static int hf_ocsp_revocationTime = -1;           /* GeneralizedTime */
105 static int hf_ocsp_revocationReason = -1;         /* CRLReason */
106 static int hf_ocsp_AcceptableResponses_item = -1;  /* OBJECT_IDENTIFIER */
107 static int hf_ocsp_issuer = -1;                   /* Name */
108 static int hf_ocsp_locator = -1;                  /* AuthorityInfoAccessSyntax */
109 static int hf_ocsp_crlUrl = -1;                   /* IA5String */
110 static int hf_ocsp_crlNum = -1;                   /* INTEGER */
111 static int hf_ocsp_crlTime = -1;                  /* GeneralizedTime */
112
113 /*--- End of included file: packet-ocsp-hf.c ---*/
114 #line 51 "packet-ocsp-template.c"
115
116 /* Initialize the subtree pointers */
117 static gint ett_ocsp = -1;
118
119 /*--- Included file: packet-ocsp-ett.c ---*/
120 #line 1 "packet-ocsp-ett.c"
121 static gint ett_ocsp_OCSPRequest = -1;
122 static gint ett_ocsp_TBSRequest = -1;
123 static gint ett_ocsp_SEQUENCE_OF_Request = -1;
124 static gint ett_ocsp_Signature = -1;
125 static gint ett_ocsp_SEQUENCE_OF_Certificate = -1;
126 static gint ett_ocsp_Request = -1;
127 static gint ett_ocsp_CertID = -1;
128 static gint ett_ocsp_OCSPResponse = -1;
129 static gint ett_ocsp_ResponseBytes = -1;
130 static gint ett_ocsp_BasicOCSPResponse = -1;
131 static gint ett_ocsp_ResponseData = -1;
132 static gint ett_ocsp_SEQUENCE_OF_SingleResponse = -1;
133 static gint ett_ocsp_ResponderID = -1;
134 static gint ett_ocsp_SingleResponse = -1;
135 static gint ett_ocsp_CertStatus = -1;
136 static gint ett_ocsp_RevokedInfo = -1;
137 static gint ett_ocsp_AcceptableResponses = -1;
138 static gint ett_ocsp_ServiceLocator = -1;
139 static gint ett_ocsp_CrlID = -1;
140
141 /*--- End of included file: packet-ocsp-ett.c ---*/
142 #line 55 "packet-ocsp-template.c"
143
144 static const char *responseType_id;
145
146
147
148 /*--- Included file: packet-ocsp-fn.c ---*/
149 #line 1 "packet-ocsp-fn.c"
150
151 static const value_string ocsp_Version_vals[] = {
152   {   0, "v1" },
153   { 0, NULL }
154 };
155
156
157 static int
158 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_) {
159   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
160                                                 NULL);
161
162   return offset;
163 }
164
165
166
167 static int
168 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_) {
169   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
170                                        NULL);
171
172   return offset;
173 }
174
175
176 static const ber_sequence_t CertID_sequence[] = {
177   { &hf_ocsp_hashAlgorithm  , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
178   { &hf_ocsp_issuerNameHash , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCTET_STRING },
179   { &hf_ocsp_issuerKeyHash  , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCTET_STRING },
180   { &hf_ocsp_serialNumber   , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_CertificateSerialNumber },
181   { NULL, 0, 0, 0, NULL }
182 };
183
184 static int
185 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_) {
186   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
187                                    CertID_sequence, hf_index, ett_ocsp_CertID);
188
189   return offset;
190 }
191
192
193 static const ber_sequence_t Request_sequence[] = {
194   { &hf_ocsp_reqCert        , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_CertID },
195   { &hf_ocsp_singleRequestExtensions, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
196   { NULL, 0, 0, 0, NULL }
197 };
198
199 static int
200 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_) {
201   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
202                                    Request_sequence, hf_index, ett_ocsp_Request);
203
204   return offset;
205 }
206
207
208 static const ber_sequence_t SEQUENCE_OF_Request_sequence_of[1] = {
209   { &hf_ocsp_requestList_item, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_Request },
210 };
211
212 static int
213 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_) {
214   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
215                                       SEQUENCE_OF_Request_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Request);
216
217   return offset;
218 }
219
220
221 static const ber_sequence_t TBSRequest_sequence[] = {
222   { &hf_ocsp_version        , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Version },
223   { &hf_ocsp_requestorName  , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_GeneralName },
224   { &hf_ocsp_requestList    , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SEQUENCE_OF_Request },
225   { &hf_ocsp_requestExtensions, BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
226   { NULL, 0, 0, 0, NULL }
227 };
228
229 static int
230 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_) {
231   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
232                                    TBSRequest_sequence, hf_index, ett_ocsp_TBSRequest);
233
234   return offset;
235 }
236
237
238
239 static int
240 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_) {
241   offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
242                                     NULL, hf_index, -1,
243                                     NULL);
244
245   return offset;
246 }
247
248
249 static const ber_sequence_t SEQUENCE_OF_Certificate_sequence_of[1] = {
250   { &hf_ocsp_certs_item     , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_Certificate },
251 };
252
253 static int
254 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_) {
255   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
256                                       SEQUENCE_OF_Certificate_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_Certificate);
257
258   return offset;
259 }
260
261
262 static const ber_sequence_t Signature_sequence[] = {
263   { &hf_ocsp_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
264   { &hf_ocsp_signature      , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_BIT_STRING },
265   { &hf_ocsp_certs          , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_SEQUENCE_OF_Certificate },
266   { NULL, 0, 0, 0, NULL }
267 };
268
269 static int
270 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_) {
271   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
272                                    Signature_sequence, hf_index, ett_ocsp_Signature);
273
274   return offset;
275 }
276
277
278 static const ber_sequence_t OCSPRequest_sequence[] = {
279   { &hf_ocsp_tbsRequest     , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_TBSRequest },
280   { &hf_ocsp_optionalSignature, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Signature },
281   { NULL, 0, 0, 0, NULL }
282 };
283
284 static int
285 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_) {
286   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
287                                    OCSPRequest_sequence, hf_index, ett_ocsp_OCSPRequest);
288
289   return offset;
290 }
291
292
293 static const value_string ocsp_OCSPResponseStatus_vals[] = {
294   {   0, "successful" },
295   {   1, "malformedRequest" },
296   {   2, "internalError" },
297   {   3, "tryLater" },
298   {   5, "sigRequired" },
299   {   6, "unauthorized" },
300   { 0, NULL }
301 };
302
303
304 static int
305 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_) {
306   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
307                                   NULL);
308
309   return offset;
310 }
311
312
313
314 static int
315 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_) {
316   offset = dissect_ber_object_identifier_str(implicit_tag, actx, tree, tvb, offset, hf_ocsp_responseType_id, &responseType_id);
317
318   return offset;
319 }
320
321
322
323 static int
324 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_) {
325 #line 37 "ocsp.cnf"
326   gint8 class;
327   gboolean pc, ind;
328   gint32 tag;
329   guint32 len;
330   /* skip past the T and L  */
331   offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &class, &pc, &tag);
332   offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, &ind);
333   offset=call_ber_oid_callback(responseType_id, tvb, offset, actx->pinfo, tree);
334
335
336
337   return offset;
338 }
339
340
341 static const ber_sequence_t ResponseBytes_sequence[] = {
342   { &hf_ocsp_responseType   , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ocsp_T_responseType },
343   { &hf_ocsp_response       , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_T_response },
344   { NULL, 0, 0, 0, NULL }
345 };
346
347 static int
348 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_) {
349   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
350                                    ResponseBytes_sequence, hf_index, ett_ocsp_ResponseBytes);
351
352   return offset;
353 }
354
355
356 static const ber_sequence_t OCSPResponse_sequence[] = {
357   { &hf_ocsp_responseStatus , BER_CLASS_UNI, BER_UNI_TAG_ENUMERATED, BER_FLAGS_NOOWNTAG, dissect_ocsp_OCSPResponseStatus },
358   { &hf_ocsp_responseBytes  , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_ResponseBytes },
359   { NULL, 0, 0, 0, NULL }
360 };
361
362 static int
363 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_) {
364   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
365                                    OCSPResponse_sequence, hf_index, ett_ocsp_OCSPResponse);
366
367   return offset;
368 }
369
370
371
372 static int
373 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_) {
374   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
375                                        NULL);
376
377   return offset;
378 }
379
380
381 static const value_string ocsp_ResponderID_vals[] = {
382   {   1, "byName" },
383   {   2, "byKey" },
384   { 0, NULL }
385 };
386
387 static const ber_choice_t ResponderID_choice[] = {
388   {   1, &hf_ocsp_byName         , BER_CLASS_CON, 1, 0, dissect_pkix1explicit_Name },
389   {   2, &hf_ocsp_byKey          , BER_CLASS_CON, 2, 0, dissect_ocsp_KeyHash },
390   { 0, NULL, 0, 0, 0, NULL }
391 };
392
393 static int
394 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_) {
395   offset = dissect_ber_choice(actx, tree, tvb, offset,
396                                  ResponderID_choice, hf_index, ett_ocsp_ResponderID,
397                                  NULL);
398
399   return offset;
400 }
401
402
403
404 static int
405 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_) {
406   offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
407
408   return offset;
409 }
410
411
412
413 static int
414 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_) {
415   offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
416
417   return offset;
418 }
419
420
421 static const ber_sequence_t RevokedInfo_sequence[] = {
422   { &hf_ocsp_revocationTime , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
423   { &hf_ocsp_revocationReason, BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_x509ce_CRLReason },
424   { NULL, 0, 0, 0, NULL }
425 };
426
427 static int
428 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_) {
429   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
430                                    RevokedInfo_sequence, hf_index, ett_ocsp_RevokedInfo);
431
432   return offset;
433 }
434
435
436
437 static int
438 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_) {
439   offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
440
441   return offset;
442 }
443
444
445 static const value_string ocsp_CertStatus_vals[] = {
446   {   0, "good" },
447   {   1, "revoked" },
448   {   2, "unknown" },
449   { 0, NULL }
450 };
451
452 static const ber_choice_t CertStatus_choice[] = {
453   {   0, &hf_ocsp_good           , BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_ocsp_NULL },
454   {   1, &hf_ocsp_revoked        , BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_ocsp_RevokedInfo },
455   {   2, &hf_ocsp_unknown        , BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_ocsp_UnknownInfo },
456   { 0, NULL, 0, 0, 0, NULL }
457 };
458
459 static int
460 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_) {
461   offset = dissect_ber_choice(actx, tree, tvb, offset,
462                                  CertStatus_choice, hf_index, ett_ocsp_CertStatus,
463                                  NULL);
464
465   return offset;
466 }
467
468
469 static const ber_sequence_t SingleResponse_sequence[] = {
470   { &hf_ocsp_certID         , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_CertID },
471   { &hf_ocsp_certStatus     , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ocsp_CertStatus },
472   { &hf_ocsp_thisUpdate     , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
473   { &hf_ocsp_nextUpdate     , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_GeneralizedTime },
474   { &hf_ocsp_singleExtensions, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
475   { NULL, 0, 0, 0, NULL }
476 };
477
478 static int
479 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_) {
480   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
481                                    SingleResponse_sequence, hf_index, ett_ocsp_SingleResponse);
482
483   return offset;
484 }
485
486
487 static const ber_sequence_t SEQUENCE_OF_SingleResponse_sequence_of[1] = {
488   { &hf_ocsp_responses_item , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SingleResponse },
489 };
490
491 static int
492 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_) {
493   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
494                                       SEQUENCE_OF_SingleResponse_sequence_of, hf_index, ett_ocsp_SEQUENCE_OF_SingleResponse);
495
496   return offset;
497 }
498
499
500 static const ber_sequence_t ResponseData_sequence[] = {
501   { &hf_ocsp_version        , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_Version },
502   { &hf_ocsp_responderID    , BER_CLASS_ANY/*choice*/, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_ocsp_ResponderID },
503   { &hf_ocsp_producedAt     , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_ocsp_GeneralizedTime },
504   { &hf_ocsp_responses      , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_SEQUENCE_OF_SingleResponse },
505   { &hf_ocsp_responseExtensions, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_pkix1explicit_Extensions },
506   { NULL, 0, 0, 0, NULL }
507 };
508
509 static int
510 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_) {
511   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
512                                    ResponseData_sequence, hf_index, ett_ocsp_ResponseData);
513
514   return offset;
515 }
516
517
518 static const ber_sequence_t BasicOCSPResponse_sequence[] = {
519   { &hf_ocsp_tbsResponseData, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_ocsp_ResponseData },
520   { &hf_ocsp_signatureAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_x509af_AlgorithmIdentifier },
521   { &hf_ocsp_signature      , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_ocsp_BIT_STRING },
522   { &hf_ocsp_certs          , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_SEQUENCE_OF_Certificate },
523   { NULL, 0, 0, 0, NULL }
524 };
525
526 static int
527 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_) {
528   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
529                                    BasicOCSPResponse_sequence, hf_index, ett_ocsp_BasicOCSPResponse);
530
531   return offset;
532 }
533
534
535
536 static int
537 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_) {
538   offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
539
540   return offset;
541 }
542
543
544
545 static int
546 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_) {
547   offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
548
549   return offset;
550 }
551
552
553 static const ber_sequence_t AcceptableResponses_sequence_of[1] = {
554   { &hf_ocsp_AcceptableResponses_item, BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_ocsp_OBJECT_IDENTIFIER },
555 };
556
557 static int
558 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_) {
559   offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset,
560                                       AcceptableResponses_sequence_of, hf_index, ett_ocsp_AcceptableResponses);
561
562   return offset;
563 }
564
565
566 static const ber_sequence_t ServiceLocator_sequence[] = {
567   { &hf_ocsp_issuer         , BER_CLASS_ANY, -1, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_Name },
568   { &hf_ocsp_locator        , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1implicit_AuthorityInfoAccessSyntax },
569   { NULL, 0, 0, 0, NULL }
570 };
571
572 static int
573 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_) {
574   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
575                                    ServiceLocator_sequence, hf_index, ett_ocsp_ServiceLocator);
576
577   return offset;
578 }
579
580
581
582 static int
583 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_) {
584   offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_IA5String,
585                                             actx, tree, tvb, offset, hf_index,
586                                             NULL);
587
588   return offset;
589 }
590
591
592
593 static int
594 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_) {
595   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
596                                                 NULL);
597
598   return offset;
599 }
600
601
602 static const ber_sequence_t CrlID_sequence[] = {
603   { &hf_ocsp_crlUrl         , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_ocsp_IA5String },
604   { &hf_ocsp_crlNum         , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_ocsp_INTEGER },
605   { &hf_ocsp_crlTime        , BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_ocsp_GeneralizedTime },
606   { NULL, 0, 0, 0, NULL }
607 };
608
609 static int
610 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_) {
611   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
612                                    CrlID_sequence, hf_index, ett_ocsp_CrlID);
613
614   return offset;
615 }
616
617 /*--- PDUs ---*/
618
619 static void dissect_BasicOCSPResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
620   asn1_ctx_t asn1_ctx;
621   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
622   dissect_ocsp_BasicOCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_BasicOCSPResponse_PDU);
623 }
624 static void dissect_ArchiveCutoff_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
625   asn1_ctx_t asn1_ctx;
626   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
627   dissect_ocsp_ArchiveCutoff(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_ArchiveCutoff_PDU);
628 }
629 static void dissect_AcceptableResponses_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
630   asn1_ctx_t asn1_ctx;
631   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
632   dissect_ocsp_AcceptableResponses(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_AcceptableResponses_PDU);
633 }
634 static void dissect_ServiceLocator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
635   asn1_ctx_t asn1_ctx;
636   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
637   dissect_ocsp_ServiceLocator(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_ServiceLocator_PDU);
638 }
639 static void dissect_CrlID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
640   asn1_ctx_t asn1_ctx;
641   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
642   dissect_ocsp_CrlID(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_CrlID_PDU);
643 }
644 static void dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
645   asn1_ctx_t asn1_ctx;
646   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
647   dissect_ocsp_NULL(FALSE, tvb, 0, &asn1_ctx, tree, hf_ocsp_NULL_PDU);
648 }
649
650
651 /*--- End of included file: packet-ocsp-fn.c ---*/
652 #line 60 "packet-ocsp-template.c"
653
654
655 static int
656 dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
657 {
658         proto_item *item=NULL;
659         proto_tree *tree=NULL;
660         asn1_ctx_t asn1_ctx;
661         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
662
663         col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
664
665         col_set_str(pinfo->cinfo, COL_INFO, "Request");
666
667
668         if(parent_tree){
669                 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, FALSE);
670                 tree = proto_item_add_subtree(item, ett_ocsp);
671         }
672
673         return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, &asn1_ctx, tree, -1);
674 }
675
676
677 static int
678 dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
679 {
680         proto_item *item=NULL;
681         proto_tree *tree=NULL;
682         asn1_ctx_t asn1_ctx;
683         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
684
685         col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
686
687         col_set_str(pinfo->cinfo, COL_INFO, "Response");
688
689
690         if(parent_tree){
691                 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, FALSE);
692                 tree = proto_item_add_subtree(item, ett_ocsp);
693         }
694
695         return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, -1);
696 }
697
698 /*--- proto_register_ocsp ----------------------------------------------*/
699 void proto_register_ocsp(void) {
700
701   /* List of fields */
702   static hf_register_info hf[] = {
703     { &hf_ocsp_responseType_id,
704       { "ResponseType Id", "x509af.responseType.id",
705         FT_STRING, BASE_NONE, NULL, 0,
706         NULL, HFILL }},
707
708 /*--- Included file: packet-ocsp-hfarr.c ---*/
709 #line 1 "packet-ocsp-hfarr.c"
710     { &hf_ocsp_BasicOCSPResponse_PDU,
711       { "BasicOCSPResponse", "ocsp.BasicOCSPResponse",
712         FT_NONE, BASE_NONE, NULL, 0,
713         "ocsp.BasicOCSPResponse", HFILL }},
714     { &hf_ocsp_ArchiveCutoff_PDU,
715       { "ArchiveCutoff", "ocsp.ArchiveCutoff",
716         FT_STRING, BASE_NONE, NULL, 0,
717         "ocsp.ArchiveCutoff", HFILL }},
718     { &hf_ocsp_AcceptableResponses_PDU,
719       { "AcceptableResponses", "ocsp.AcceptableResponses",
720         FT_UINT32, BASE_DEC, NULL, 0,
721         "ocsp.AcceptableResponses", HFILL }},
722     { &hf_ocsp_ServiceLocator_PDU,
723       { "ServiceLocator", "ocsp.ServiceLocator",
724         FT_NONE, BASE_NONE, NULL, 0,
725         "ocsp.ServiceLocator", HFILL }},
726     { &hf_ocsp_CrlID_PDU,
727       { "CrlID", "ocsp.CrlID",
728         FT_NONE, BASE_NONE, NULL, 0,
729         "ocsp.CrlID", HFILL }},
730     { &hf_ocsp_NULL_PDU,
731       { "NULL", "ocsp.NULL",
732         FT_NONE, BASE_NONE, NULL, 0,
733         "ocsp.NULL", HFILL }},
734     { &hf_ocsp_tbsRequest,
735       { "tbsRequest", "ocsp.tbsRequest",
736         FT_NONE, BASE_NONE, NULL, 0,
737         "ocsp.TBSRequest", HFILL }},
738     { &hf_ocsp_optionalSignature,
739       { "optionalSignature", "ocsp.optionalSignature",
740         FT_NONE, BASE_NONE, NULL, 0,
741         "ocsp.Signature", HFILL }},
742     { &hf_ocsp_version,
743       { "version", "ocsp.version",
744         FT_INT32, BASE_DEC, VALS(pkix1explicit_Version_vals), 0,
745         "ocsp.Version", HFILL }},
746     { &hf_ocsp_requestorName,
747       { "requestorName", "ocsp.requestorName",
748         FT_UINT32, BASE_DEC, VALS(x509ce_GeneralName_vals), 0,
749         "pkix1explicit.GeneralName", HFILL }},
750     { &hf_ocsp_requestList,
751       { "requestList", "ocsp.requestList",
752         FT_UINT32, BASE_DEC, NULL, 0,
753         "ocsp.SEQUENCE_OF_Request", HFILL }},
754     { &hf_ocsp_requestList_item,
755       { "Request", "ocsp.Request",
756         FT_NONE, BASE_NONE, NULL, 0,
757         "ocsp.Request", HFILL }},
758     { &hf_ocsp_requestExtensions,
759       { "requestExtensions", "ocsp.requestExtensions",
760         FT_UINT32, BASE_DEC, NULL, 0,
761         "pkix1explicit.Extensions", HFILL }},
762     { &hf_ocsp_signatureAlgorithm,
763       { "signatureAlgorithm", "ocsp.signatureAlgorithm",
764         FT_NONE, BASE_NONE, NULL, 0,
765         "x509af.AlgorithmIdentifier", HFILL }},
766     { &hf_ocsp_signature,
767       { "signature", "ocsp.signature",
768         FT_BYTES, BASE_NONE, NULL, 0,
769         "ocsp.BIT_STRING", HFILL }},
770     { &hf_ocsp_certs,
771       { "certs", "ocsp.certs",
772         FT_UINT32, BASE_DEC, NULL, 0,
773         "ocsp.SEQUENCE_OF_Certificate", HFILL }},
774     { &hf_ocsp_certs_item,
775       { "Certificate", "ocsp.Certificate",
776         FT_NONE, BASE_NONE, NULL, 0,
777         "x509af.Certificate", HFILL }},
778     { &hf_ocsp_reqCert,
779       { "reqCert", "ocsp.reqCert",
780         FT_NONE, BASE_NONE, NULL, 0,
781         "ocsp.CertID", HFILL }},
782     { &hf_ocsp_singleRequestExtensions,
783       { "singleRequestExtensions", "ocsp.singleRequestExtensions",
784         FT_UINT32, BASE_DEC, NULL, 0,
785         "pkix1explicit.Extensions", HFILL }},
786     { &hf_ocsp_hashAlgorithm,
787       { "hashAlgorithm", "ocsp.hashAlgorithm",
788         FT_NONE, BASE_NONE, NULL, 0,
789         "x509af.AlgorithmIdentifier", HFILL }},
790     { &hf_ocsp_issuerNameHash,
791       { "issuerNameHash", "ocsp.issuerNameHash",
792         FT_BYTES, BASE_NONE, NULL, 0,
793         "ocsp.OCTET_STRING", HFILL }},
794     { &hf_ocsp_issuerKeyHash,
795       { "issuerKeyHash", "ocsp.issuerKeyHash",
796         FT_BYTES, BASE_NONE, NULL, 0,
797         "ocsp.OCTET_STRING", HFILL }},
798     { &hf_ocsp_serialNumber,
799       { "serialNumber", "ocsp.serialNumber",
800         FT_INT32, BASE_DEC, NULL, 0,
801         "pkix1explicit.CertificateSerialNumber", HFILL }},
802     { &hf_ocsp_responseStatus,
803       { "responseStatus", "ocsp.responseStatus",
804         FT_UINT32, BASE_DEC, VALS(ocsp_OCSPResponseStatus_vals), 0,
805         "ocsp.OCSPResponseStatus", HFILL }},
806     { &hf_ocsp_responseBytes,
807       { "responseBytes", "ocsp.responseBytes",
808         FT_NONE, BASE_NONE, NULL, 0,
809         "ocsp.ResponseBytes", HFILL }},
810     { &hf_ocsp_responseType,
811       { "responseType", "ocsp.responseType",
812         FT_OID, BASE_NONE, NULL, 0,
813         "ocsp.T_responseType", HFILL }},
814     { &hf_ocsp_response,
815       { "response", "ocsp.response",
816         FT_BYTES, BASE_NONE, NULL, 0,
817         "ocsp.T_response", HFILL }},
818     { &hf_ocsp_tbsResponseData,
819       { "tbsResponseData", "ocsp.tbsResponseData",
820         FT_NONE, BASE_NONE, NULL, 0,
821         "ocsp.ResponseData", HFILL }},
822     { &hf_ocsp_responderID,
823       { "responderID", "ocsp.responderID",
824         FT_UINT32, BASE_DEC, VALS(ocsp_ResponderID_vals), 0,
825         "ocsp.ResponderID", HFILL }},
826     { &hf_ocsp_producedAt,
827       { "producedAt", "ocsp.producedAt",
828         FT_STRING, BASE_NONE, NULL, 0,
829         "ocsp.GeneralizedTime", HFILL }},
830     { &hf_ocsp_responses,
831       { "responses", "ocsp.responses",
832         FT_UINT32, BASE_DEC, NULL, 0,
833         "ocsp.SEQUENCE_OF_SingleResponse", HFILL }},
834     { &hf_ocsp_responses_item,
835       { "SingleResponse", "ocsp.SingleResponse",
836         FT_NONE, BASE_NONE, NULL, 0,
837         "ocsp.SingleResponse", HFILL }},
838     { &hf_ocsp_responseExtensions,
839       { "responseExtensions", "ocsp.responseExtensions",
840         FT_UINT32, BASE_DEC, NULL, 0,
841         "pkix1explicit.Extensions", HFILL }},
842     { &hf_ocsp_byName,
843       { "byName", "ocsp.byName",
844         FT_UINT32, BASE_DEC, NULL, 0,
845         "pkix1explicit.Name", HFILL }},
846     { &hf_ocsp_byKey,
847       { "byKey", "ocsp.byKey",
848         FT_BYTES, BASE_NONE, NULL, 0,
849         "ocsp.KeyHash", HFILL }},
850     { &hf_ocsp_certID,
851       { "certID", "ocsp.certID",
852         FT_NONE, BASE_NONE, NULL, 0,
853         "ocsp.CertID", HFILL }},
854     { &hf_ocsp_certStatus,
855       { "certStatus", "ocsp.certStatus",
856         FT_UINT32, BASE_DEC, VALS(ocsp_CertStatus_vals), 0,
857         "ocsp.CertStatus", HFILL }},
858     { &hf_ocsp_thisUpdate,
859       { "thisUpdate", "ocsp.thisUpdate",
860         FT_STRING, BASE_NONE, NULL, 0,
861         "ocsp.GeneralizedTime", HFILL }},
862     { &hf_ocsp_nextUpdate,
863       { "nextUpdate", "ocsp.nextUpdate",
864         FT_STRING, BASE_NONE, NULL, 0,
865         "ocsp.GeneralizedTime", HFILL }},
866     { &hf_ocsp_singleExtensions,
867       { "singleExtensions", "ocsp.singleExtensions",
868         FT_UINT32, BASE_DEC, NULL, 0,
869         "pkix1explicit.Extensions", HFILL }},
870     { &hf_ocsp_good,
871       { "good", "ocsp.good",
872         FT_NONE, BASE_NONE, NULL, 0,
873         "ocsp.NULL", HFILL }},
874     { &hf_ocsp_revoked,
875       { "revoked", "ocsp.revoked",
876         FT_NONE, BASE_NONE, NULL, 0,
877         "ocsp.RevokedInfo", HFILL }},
878     { &hf_ocsp_unknown,
879       { "unknown", "ocsp.unknown",
880         FT_NONE, BASE_NONE, NULL, 0,
881         "ocsp.UnknownInfo", HFILL }},
882     { &hf_ocsp_revocationTime,
883       { "revocationTime", "ocsp.revocationTime",
884         FT_STRING, BASE_NONE, NULL, 0,
885         "ocsp.GeneralizedTime", HFILL }},
886     { &hf_ocsp_revocationReason,
887       { "revocationReason", "ocsp.revocationReason",
888         FT_UINT32, BASE_DEC, VALS(x509ce_CRLReason_vals), 0,
889         "x509ce.CRLReason", HFILL }},
890     { &hf_ocsp_AcceptableResponses_item,
891       { "AcceptableResponses item", "ocsp.AcceptableResponses_item",
892         FT_OID, BASE_NONE, NULL, 0,
893         "ocsp.OBJECT_IDENTIFIER", HFILL }},
894     { &hf_ocsp_issuer,
895       { "issuer", "ocsp.issuer",
896         FT_UINT32, BASE_DEC, NULL, 0,
897         "pkix1explicit.Name", HFILL }},
898     { &hf_ocsp_locator,
899       { "locator", "ocsp.locator",
900         FT_UINT32, BASE_DEC, NULL, 0,
901         "pkix1implicit.AuthorityInfoAccessSyntax", HFILL }},
902     { &hf_ocsp_crlUrl,
903       { "crlUrl", "ocsp.crlUrl",
904         FT_STRING, BASE_NONE, NULL, 0,
905         "ocsp.IA5String", HFILL }},
906     { &hf_ocsp_crlNum,
907       { "crlNum", "ocsp.crlNum",
908         FT_INT32, BASE_DEC, NULL, 0,
909         "ocsp.INTEGER", HFILL }},
910     { &hf_ocsp_crlTime,
911       { "crlTime", "ocsp.crlTime",
912         FT_STRING, BASE_NONE, NULL, 0,
913         "ocsp.GeneralizedTime", HFILL }},
914
915 /*--- End of included file: packet-ocsp-hfarr.c ---*/
916 #line 115 "packet-ocsp-template.c"
917   };
918
919   /* List of subtrees */
920   static gint *ett[] = {
921     &ett_ocsp,
922
923 /*--- Included file: packet-ocsp-ettarr.c ---*/
924 #line 1 "packet-ocsp-ettarr.c"
925     &ett_ocsp_OCSPRequest,
926     &ett_ocsp_TBSRequest,
927     &ett_ocsp_SEQUENCE_OF_Request,
928     &ett_ocsp_Signature,
929     &ett_ocsp_SEQUENCE_OF_Certificate,
930     &ett_ocsp_Request,
931     &ett_ocsp_CertID,
932     &ett_ocsp_OCSPResponse,
933     &ett_ocsp_ResponseBytes,
934     &ett_ocsp_BasicOCSPResponse,
935     &ett_ocsp_ResponseData,
936     &ett_ocsp_SEQUENCE_OF_SingleResponse,
937     &ett_ocsp_ResponderID,
938     &ett_ocsp_SingleResponse,
939     &ett_ocsp_CertStatus,
940     &ett_ocsp_RevokedInfo,
941     &ett_ocsp_AcceptableResponses,
942     &ett_ocsp_ServiceLocator,
943     &ett_ocsp_CrlID,
944
945 /*--- End of included file: packet-ocsp-ettarr.c ---*/
946 #line 121 "packet-ocsp-template.c"
947   };
948
949   /* Register protocol */
950   proto_ocsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
951
952   /* Register fields and subtrees */
953   proto_register_field_array(proto_ocsp, hf, array_length(hf));
954   proto_register_subtree_array(ett, array_length(ett));
955
956 }
957
958 /*--- proto_reg_handoff_ocsp -------------------------------------------*/
959 void proto_reg_handoff_ocsp(void) {
960         dissector_handle_t ocsp_request_handle;
961         dissector_handle_t ocsp_response_handle;
962
963         ocsp_request_handle = new_create_dissector_handle(dissect_ocsp_request, proto_ocsp);
964         ocsp_response_handle = new_create_dissector_handle(dissect_ocsp_response, proto_ocsp);
965
966         dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle);
967         dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle);
968
969
970 /*--- Included file: packet-ocsp-dis-tab.c ---*/
971 #line 1 "packet-ocsp-dis-tab.c"
972   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.1", dissect_BasicOCSPResponse_PDU, proto_ocsp, "id-pkix-ocsp-basic");
973   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.3", dissect_CrlID_PDU, proto_ocsp, "id-pkix-ocsp-crl");
974   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.4", dissect_AcceptableResponses_PDU, proto_ocsp, "id-pkix-ocsp-response");
975   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.5", dissect_NULL_PDU, proto_ocsp, "id-pkix-ocsp-nocheck");
976   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.6", dissect_ArchiveCutoff_PDU, proto_ocsp, "id-pkix-ocsp-archive-cutoff");
977   register_ber_oid_dissector("1.3.6.1.5.5.7.48.1.7", dissect_ServiceLocator_PDU, proto_ocsp, "id-pkix-ocsp-service-locator");
978
979
980 /*--- End of included file: packet-ocsp-dis-tab.c ---*/
981 #line 144 "packet-ocsp-template.c"
982 }
983