Postfix FT_NONE fields with "_element" string to reduce number of incompatible filter...
[metze/wireshark/wip.git] / epan / dissectors / packet-ocsp.c
1 /* Do not modify this file. Changes will be overwritten.                      */
2 /* Generated 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 . -O ../../epan/dissectors OCSP.asn */
5
6 /* Input file: packet-ocsp-template.c */
7
8 #line 1 "../../asn1/ocsp/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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32  */
33
34 #include "config.h"
35
36 #include <glib.h>
37 #include <epan/packet.h>
38
39 #include <asn1.h>
40
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"
47
48 #define PNAME  "Online Certificate Status Protocol"
49 #define PSNAME "OCSP"
50 #define PFNAME "ocsp"
51
52 /* Initialize the protocol and registered fields */
53 int proto_ocsp = -1;
54 static int hf_ocsp_responseType_id = -1;
55
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 */
109
110 /*--- End of included file: packet-ocsp-hf.c ---*/
111 #line 48 "../../asn1/ocsp/packet-ocsp-template.c"
112
113 /* Initialize the subtree pointers */
114 static gint ett_ocsp = -1;
115
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;
137
138 /*--- End of included file: packet-ocsp-ett.c ---*/
139 #line 52 "../../asn1/ocsp/packet-ocsp-template.c"
140
141 static const char *responseType_id;
142
143
144
145 /*--- Included file: packet-ocsp-fn.c ---*/
146 #line 1 "../../asn1/ocsp/packet-ocsp-fn.c"
147
148 static const value_string ocsp_Version_vals[] = {
149   {   0, "v1" },
150   { 0, NULL }
151 };
152
153
154 static int
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,
157                                                 NULL);
158
159   return offset;
160 }
161
162
163
164 static int
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,
167                                        NULL);
168
169   return offset;
170 }
171
172
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 }
179 };
180
181 static int
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);
185
186   return offset;
187 }
188
189
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 }
194 };
195
196 static int
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);
200
201   return offset;
202 }
203
204
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 },
207 };
208
209 static int
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);
213
214   return offset;
215 }
216
217
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 }
224 };
225
226 static int
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);
230
231   return offset;
232 }
233
234
235
236 static int
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,
239                                     NULL, hf_index, -1,
240                                     NULL);
241
242   return offset;
243 }
244
245
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 },
248 };
249
250 static int
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);
254
255   return offset;
256 }
257
258
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 }
264 };
265
266 static int
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);
270
271   return offset;
272 }
273
274
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 }
279 };
280
281 static int
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);
285
286   return offset;
287 }
288
289
290 static const value_string ocsp_OCSPResponseStatus_vals[] = {
291   {   0, "successful" },
292   {   1, "malformedRequest" },
293   {   2, "internalError" },
294   {   3, "tryLater" },
295   {   5, "sigRequired" },
296   {   6, "unauthorized" },
297   { 0, NULL }
298 };
299
300
301 static int
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,
304                                   NULL);
305
306   return offset;
307 }
308
309
310
311 static int
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);
314
315   return offset;
316 }
317
318
319
320 static int
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"
323   gint8 appclass;
324   gboolean pc, ind;
325   gint32 tag;
326   guint32 len;
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);
331
332
333
334   return offset;
335 }
336
337
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 }
342 };
343
344 static int
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);
348
349   return offset;
350 }
351
352
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 }
357 };
358
359 int
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);
363
364   return offset;
365 }
366
367
368
369 static int
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,
372                                        NULL);
373
374   return offset;
375 }
376
377
378 static const value_string ocsp_ResponderID_vals[] = {
379   {   1, "byName" },
380   {   2, "byKey" },
381   { 0, NULL }
382 };
383
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 }
388 };
389
390 static int
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,
394                                  NULL);
395
396   return offset;
397 }
398
399
400
401 static int
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);
404
405   return offset;
406 }
407
408
409
410 static int
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);
413
414   return offset;
415 }
416
417
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 }
422 };
423
424 static int
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);
428
429   return offset;
430 }
431
432
433
434 static int
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);
437
438   return offset;
439 }
440
441
442 static const value_string ocsp_CertStatus_vals[] = {
443   {   0, "good" },
444   {   1, "revoked" },
445   {   2, "unknown" },
446   { 0, NULL }
447 };
448
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 }
454 };
455
456 static int
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,
460                                  NULL);
461
462   return offset;
463 }
464
465
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 }
473 };
474
475 static int
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);
479
480   return offset;
481 }
482
483
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 },
486 };
487
488 static int
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);
492
493   return offset;
494 }
495
496
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 }
504 };
505
506 static int
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);
510
511   return offset;
512 }
513
514
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 }
521 };
522
523 static int
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);
527
528   return offset;
529 }
530
531
532
533 static int
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);
536
537   return offset;
538 }
539
540
541
542 static int
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);
545
546   return offset;
547 }
548
549
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 },
552 };
553
554 static int
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);
558
559   return offset;
560 }
561
562
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 }
567 };
568
569 static int
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);
573
574   return offset;
575 }
576
577
578
579 static int
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,
583                                             NULL);
584
585   return offset;
586 }
587
588
589
590 static int
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,
593                                                 NULL);
594
595   return offset;
596 }
597
598
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 }
604 };
605
606 static int
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);
610
611   return offset;
612 }
613
614 /*--- PDUs ---*/
615
616 static void dissect_BasicOCSPResponse_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
617   asn1_ctx_t asn1_ctx;
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);
620 }
621 static void dissect_ArchiveCutoff_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
622   asn1_ctx_t asn1_ctx;
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);
625 }
626 static void dissect_AcceptableResponses_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
627   asn1_ctx_t asn1_ctx;
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);
630 }
631 static void dissect_ServiceLocator_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
632   asn1_ctx_t asn1_ctx;
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);
635 }
636 static void dissect_CrlID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
637   asn1_ctx_t asn1_ctx;
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);
640 }
641 static void dissect_NULL_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
642   asn1_ctx_t asn1_ctx;
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);
645 }
646
647
648 /*--- End of included file: packet-ocsp-fn.c ---*/
649 #line 57 "../../asn1/ocsp/packet-ocsp-template.c"
650
651
652 static int
653 dissect_ocsp_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
654 {
655         proto_item *item=NULL;
656         proto_tree *tree=NULL;
657         asn1_ctx_t asn1_ctx;
658         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
659
660         col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
661
662         col_set_str(pinfo->cinfo, COL_INFO, "Request");
663
664
665         if(parent_tree){
666                 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
667                 tree = proto_item_add_subtree(item, ett_ocsp);
668         }
669
670         return dissect_ocsp_OCSPRequest(FALSE, tvb, 0, &asn1_ctx, tree, -1);
671 }
672
673
674 static int
675 dissect_ocsp_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
676 {
677         proto_item *item=NULL;
678         proto_tree *tree=NULL;
679         asn1_ctx_t asn1_ctx;
680         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
681
682         col_set_str(pinfo->cinfo, COL_PROTOCOL, "OCSP");
683
684         col_set_str(pinfo->cinfo, COL_INFO, "Response");
685
686
687         if(parent_tree){
688                 item=proto_tree_add_item(parent_tree, proto_ocsp, tvb, 0, -1, ENC_NA);
689                 tree = proto_item_add_subtree(item, ett_ocsp);
690         }
691
692         return dissect_ocsp_OCSPResponse(FALSE, tvb, 0, &asn1_ctx, tree, -1);
693 }
694
695 /*--- proto_register_ocsp ----------------------------------------------*/
696 void proto_register_ocsp(void) {
697
698   /* List of fields */
699   static hf_register_info hf[] = {
700     { &hf_ocsp_responseType_id,
701       { "ResponseType Id", "x509af.responseType.id",
702         FT_STRING, BASE_NONE, NULL, 0,
703         NULL, HFILL }},
704
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,
710         NULL, HFILL }},
711     { &hf_ocsp_ArchiveCutoff_PDU,
712       { "ArchiveCutoff", "ocsp.ArchiveCutoff",
713         FT_STRING, BASE_NONE, NULL, 0,
714         NULL, HFILL }},
715     { &hf_ocsp_AcceptableResponses_PDU,
716       { "AcceptableResponses", "ocsp.AcceptableResponses",
717         FT_UINT32, BASE_DEC, NULL, 0,
718         NULL, HFILL }},
719     { &hf_ocsp_ServiceLocator_PDU,
720       { "ServiceLocator", "ocsp.ServiceLocator_element",
721         FT_NONE, BASE_NONE, NULL, 0,
722         NULL, HFILL }},
723     { &hf_ocsp_CrlID_PDU,
724       { "CrlID", "ocsp.CrlID_element",
725         FT_NONE, BASE_NONE, NULL, 0,
726         NULL, HFILL }},
727     { &hf_ocsp_NULL_PDU,
728       { "NULL", "ocsp.NULL_element",
729         FT_NONE, BASE_NONE, NULL, 0,
730         NULL, HFILL }},
731     { &hf_ocsp_tbsRequest,
732       { "tbsRequest", "ocsp.tbsRequest_element",
733         FT_NONE, BASE_NONE, NULL, 0,
734         NULL, HFILL }},
735     { &hf_ocsp_optionalSignature,
736       { "optionalSignature", "ocsp.optionalSignature_element",
737         FT_NONE, BASE_NONE, NULL, 0,
738         "Signature", HFILL }},
739     { &hf_ocsp_version,
740       { "version", "ocsp.version",
741         FT_INT32, BASE_DEC, VALS(pkix1explicit_Version_vals), 0,
742         NULL, HFILL }},
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,
754         NULL, HFILL }},
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 }},
767     { &hf_ocsp_certs,
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,
774         NULL, HFILL }},
775     { &hf_ocsp_reqCert,
776       { "reqCert", "ocsp.reqCert_element",
777         FT_NONE, BASE_NONE, NULL, 0,
778         "CertID", HFILL }},
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,
806         NULL, HFILL }},
807     { &hf_ocsp_responseType,
808       { "responseType", "ocsp.responseType",
809         FT_OID, BASE_NONE, NULL, 0,
810         NULL, HFILL }},
811     { &hf_ocsp_response,
812       { "response", "ocsp.response",
813         FT_BYTES, BASE_NONE, NULL, 0,
814         NULL, HFILL }},
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,
822         NULL, HFILL }},
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,
834         NULL, HFILL }},
835     { &hf_ocsp_responseExtensions,
836       { "responseExtensions", "ocsp.responseExtensions",
837         FT_UINT32, BASE_DEC, NULL, 0,
838         "Extensions", HFILL }},
839     { &hf_ocsp_byName,
840       { "byName", "ocsp.byName",
841         FT_UINT32, BASE_DEC, NULL, 0,
842         "Name", HFILL }},
843     { &hf_ocsp_byKey,
844       { "byKey", "ocsp.byKey",
845         FT_BYTES, BASE_NONE, NULL, 0,
846         "KeyHash", HFILL }},
847     { &hf_ocsp_certID,
848       { "certID", "ocsp.certID_element",
849         FT_NONE, BASE_NONE, NULL, 0,
850         NULL, HFILL }},
851     { &hf_ocsp_certStatus,
852       { "certStatus", "ocsp.certStatus",
853         FT_UINT32, BASE_DEC, VALS(ocsp_CertStatus_vals), 0,
854         NULL, HFILL }},
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 }},
867     { &hf_ocsp_good,
868       { "good", "ocsp.good_element",
869         FT_NONE, BASE_NONE, NULL, 0,
870         NULL, HFILL }},
871     { &hf_ocsp_revoked,
872       { "revoked", "ocsp.revoked_element",
873         FT_NONE, BASE_NONE, NULL, 0,
874         "RevokedInfo", HFILL }},
875     { &hf_ocsp_unknown,
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 }},
891     { &hf_ocsp_issuer,
892       { "issuer", "ocsp.issuer",
893         FT_UINT32, BASE_DEC, NULL, 0,
894         "Name", HFILL }},
895     { &hf_ocsp_locator,
896       { "locator", "ocsp.locator",
897         FT_UINT32, BASE_DEC, NULL, 0,
898         "AuthorityInfoAccessSyntax", HFILL }},
899     { &hf_ocsp_crlUrl,
900       { "crlUrl", "ocsp.crlUrl",
901         FT_STRING, BASE_NONE, NULL, 0,
902         "IA5String", HFILL }},
903     { &hf_ocsp_crlNum,
904       { "crlNum", "ocsp.crlNum",
905         FT_INT32, BASE_DEC, NULL, 0,
906         "INTEGER", HFILL }},
907     { &hf_ocsp_crlTime,
908       { "crlTime", "ocsp.crlTime",
909         FT_STRING, BASE_NONE, NULL, 0,
910         "GeneralizedTime", HFILL }},
911
912 /*--- End of included file: packet-ocsp-hfarr.c ---*/
913 #line 112 "../../asn1/ocsp/packet-ocsp-template.c"
914   };
915
916   /* List of subtrees */
917   static gint *ett[] = {
918     &ett_ocsp,
919
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,
925     &ett_ocsp_Signature,
926     &ett_ocsp_SEQUENCE_OF_Certificate,
927     &ett_ocsp_Request,
928     &ett_ocsp_CertID,
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,
940     &ett_ocsp_CrlID,
941
942 /*--- End of included file: packet-ocsp-ettarr.c ---*/
943 #line 118 "../../asn1/ocsp/packet-ocsp-template.c"
944   };
945
946   /* Register protocol */
947   proto_ocsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
948
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));
952
953 }
954
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;
959
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);
962
963         dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle);
964         dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle);
965
966
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");
975
976
977 /*--- End of included file: packet-ocsp-dis-tab.c ---*/
978 #line 141 "../../asn1/ocsp/packet-ocsp-template.c"
979 }
980