868728881e9f387b6bf97c201c913b00a5c4f0d8
[obnox/wireshark/wip.git] / epan / dissectors / packet-pkixtsp.c
1 /* Do not modify this file.                                                   */
2 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
3 /* packet-pkixtsp.c                                                           */
4 /* ../../tools/asn2wrs.py -b -p pkixtsp -c ./pkixtsp.cnf -s ./packet-pkixtsp-template -D . PKIXTSP.asn */
5
6 /* Input file: packet-pkixtsp-template.c */
7
8 #line 1 "packet-pkixtsp-template.c"
9 /* packet-pkixtsp.c
10  * Routines for RFC2634 Extended Security Services 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 <stdio.h>
42 #include <string.h>
43
44 #include <epan/asn1.h>
45 #include "packet-ber.h"
46 #include "packet-pkixtsp.h"
47 #include "packet-pkix1explicit.h"
48 #include "packet-pkix1implicit.h"
49 #include "packet-cms.h"
50
51 #define PNAME  "PKIX Time Stamp Protocol"
52 #define PSNAME "PKIXTSP"
53 #define PFNAME "pkixtsp"
54
55 /* Initialize the protocol and registered fields */
56 static int proto_pkixtsp = -1;
57
58 /*--- Included file: packet-pkixtsp-hf.c ---*/
59 #line 1 "packet-pkixtsp-hf.c"
60 static int hf_pkixtsp_TSTInfo_PDU = -1;           /* TSTInfo */
61 static int hf_pkixtsp_version = -1;               /* T_version */
62 static int hf_pkixtsp_messageImprint = -1;        /* MessageImprint */
63 static int hf_pkixtsp_reqPolicy = -1;             /* TSAPolicyId */
64 static int hf_pkixtsp_nonce = -1;                 /* INTEGER */
65 static int hf_pkixtsp_certReq = -1;               /* BOOLEAN */
66 static int hf_pkixtsp_extensions = -1;            /* Extensions */
67 static int hf_pkixtsp_hashAlgorithm = -1;         /* AlgorithmIdentifier */
68 static int hf_pkixtsp_hashedMessage = -1;         /* OCTET_STRING */
69 static int hf_pkixtsp_status = -1;                /* PKIStatusInfo */
70 static int hf_pkixtsp_timeStampToken = -1;        /* TimeStampToken */
71 static int hf_pkixtsp_pki_status = -1;            /* PKIStatus */
72 static int hf_pkixtsp_failInfo = -1;              /* PKIFailureInfo */
73 static int hf_pkixtsp_tst_version = -1;           /* Tst_version */
74 static int hf_pkixtsp_policy = -1;                /* TSAPolicyId */
75 static int hf_pkixtsp_serialNumber = -1;          /* INTEGER */
76 static int hf_pkixtsp_genTime = -1;               /* GeneralizedTime */
77 static int hf_pkixtsp_accuracy = -1;              /* Accuracy */
78 static int hf_pkixtsp_ordering = -1;              /* BOOLEAN */
79 static int hf_pkixtsp_tsa = -1;                   /* GeneralName */
80 static int hf_pkixtsp_seconds = -1;               /* INTEGER */
81 static int hf_pkixtsp_millis = -1;                /* INTEGER_1_999 */
82 static int hf_pkixtsp_micros = -1;                /* INTEGER_1_999 */
83 /* named bits */
84 static int hf_pkixtsp_PKIFailureInfo_badAlg = -1;
85 static int hf_pkixtsp_PKIFailureInfo_badRequest = -1;
86 static int hf_pkixtsp_PKIFailureInfo_badDataFormat = -1;
87 static int hf_pkixtsp_PKIFailureInfo_timeNotAvailable = -1;
88 static int hf_pkixtsp_PKIFailureInfo_unacceptedPolicy = -1;
89 static int hf_pkixtsp_PKIFailureInfo_unacceptedExtension = -1;
90 static int hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable = -1;
91 static int hf_pkixtsp_PKIFailureInfo_systemFailure = -1;
92
93 /*--- End of included file: packet-pkixtsp-hf.c ---*/
94 #line 50 "packet-pkixtsp-template.c"
95
96 /* Initialize the subtree pointers */
97 static gint ett_pkixtsp = -1;
98
99 /*--- Included file: packet-pkixtsp-ett.c ---*/
100 #line 1 "packet-pkixtsp-ett.c"
101 static gint ett_pkixtsp_TimeStampReq = -1;
102 static gint ett_pkixtsp_MessageImprint = -1;
103 static gint ett_pkixtsp_TimeStampResp = -1;
104 static gint ett_pkixtsp_PKIStatusInfo = -1;
105 static gint ett_pkixtsp_PKIFailureInfo = -1;
106 static gint ett_pkixtsp_TSTInfo = -1;
107 static gint ett_pkixtsp_Accuracy = -1;
108
109 /*--- End of included file: packet-pkixtsp-ett.c ---*/
110 #line 54 "packet-pkixtsp-template.c"
111
112
113
114 /*--- Included file: packet-pkixtsp-fn.c ---*/
115 #line 1 "packet-pkixtsp-fn.c"
116
117 static const value_string pkixtsp_T_version_vals[] = {
118   {   1, "v1" },
119   { 0, NULL }
120 };
121
122
123 static int
124 dissect_pkixtsp_T_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_) {
125   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
126                                                 NULL);
127
128   return offset;
129 }
130
131
132
133 static int
134 dissect_pkixtsp_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_) {
135   offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
136                                        NULL);
137
138   return offset;
139 }
140
141
142 static const ber_sequence_t MessageImprint_sequence[] = {
143   { &hf_pkixtsp_hashAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkix1explicit_AlgorithmIdentifier },
144   { &hf_pkixtsp_hashedMessage, BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_OCTET_STRING },
145   { NULL, 0, 0, 0, NULL }
146 };
147
148 static int
149 dissect_pkixtsp_MessageImprint(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
150   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
151                                    MessageImprint_sequence, hf_index, ett_pkixtsp_MessageImprint);
152
153   return offset;
154 }
155
156
157
158 static int
159 dissect_pkixtsp_TSAPolicyId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
160   offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
161
162   return offset;
163 }
164
165
166
167 static int
168 dissect_pkixtsp_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_) {
169   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
170                                                 NULL);
171
172   return offset;
173 }
174
175
176
177 static int
178 dissect_pkixtsp_BOOLEAN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
179   offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
180
181   return offset;
182 }
183
184
185 static const ber_sequence_t TimeStampReq_sequence[] = {
186   { &hf_pkixtsp_version     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_T_version },
187   { &hf_pkixtsp_messageImprint, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_MessageImprint },
188   { &hf_pkixtsp_reqPolicy   , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_TSAPolicyId },
189   { &hf_pkixtsp_nonce       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_INTEGER },
190   { &hf_pkixtsp_certReq     , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_BOOLEAN },
191   { &hf_pkixtsp_extensions  , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkix1explicit_Extensions },
192   { NULL, 0, 0, 0, NULL }
193 };
194
195 static int
196 dissect_pkixtsp_TimeStampReq(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
197   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
198                                    TimeStampReq_sequence, hf_index, ett_pkixtsp_TimeStampReq);
199
200   return offset;
201 }
202
203
204 static const value_string pkixtsp_PKIStatus_vals[] = {
205   {   0, "granted" },
206   {   1, "grantedWithMods" },
207   {   2, "rejection" },
208   {   3, "waiting" },
209   {   4, "revocationWarning" },
210   {   5, "revocationNotification" },
211   { 0, NULL }
212 };
213
214
215 static int
216 dissect_pkixtsp_PKIStatus(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
217   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
218                                                 NULL);
219
220   return offset;
221 }
222
223
224 static const asn_namedbit PKIFailureInfo_bits[] = {
225   {  0, &hf_pkixtsp_PKIFailureInfo_badAlg, -1, -1, "badAlg", NULL },
226   {  2, &hf_pkixtsp_PKIFailureInfo_badRequest, -1, -1, "badRequest", NULL },
227   {  5, &hf_pkixtsp_PKIFailureInfo_badDataFormat, -1, -1, "badDataFormat", NULL },
228   { 14, &hf_pkixtsp_PKIFailureInfo_timeNotAvailable, -1, -1, "timeNotAvailable", NULL },
229   { 15, &hf_pkixtsp_PKIFailureInfo_unacceptedPolicy, -1, -1, "unacceptedPolicy", NULL },
230   { 16, &hf_pkixtsp_PKIFailureInfo_unacceptedExtension, -1, -1, "unacceptedExtension", NULL },
231   { 17, &hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable, -1, -1, "addInfoNotAvailable", NULL },
232   { 25, &hf_pkixtsp_PKIFailureInfo_systemFailure, -1, -1, "systemFailure", NULL },
233   { 0, NULL, 0, 0, NULL, NULL }
234 };
235
236 static int
237 dissect_pkixtsp_PKIFailureInfo(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                                     PKIFailureInfo_bits, hf_index, ett_pkixtsp_PKIFailureInfo,
240                                     NULL);
241
242   return offset;
243 }
244
245
246 static const ber_sequence_t PKIStatusInfo_sequence[] = {
247   { &hf_pkixtsp_pki_status  , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_PKIStatus },
248   { &hf_pkixtsp_failInfo    , BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_PKIFailureInfo },
249   { NULL, 0, 0, 0, NULL }
250 };
251
252 static int
253 dissect_pkixtsp_PKIStatusInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
254   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
255                                    PKIStatusInfo_sequence, hf_index, ett_pkixtsp_PKIStatusInfo);
256
257   return offset;
258 }
259
260
261
262 static int
263 dissect_pkixtsp_TimeStampToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
264   offset = dissect_cms_ContentInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
265
266   return offset;
267 }
268
269
270 static const ber_sequence_t TimeStampResp_sequence[] = {
271   { &hf_pkixtsp_status      , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_PKIStatusInfo },
272   { &hf_pkixtsp_timeStampToken, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_TimeStampToken },
273   { NULL, 0, 0, 0, NULL }
274 };
275
276 static int
277 dissect_pkixtsp_TimeStampResp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
278   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
279                                    TimeStampResp_sequence, hf_index, ett_pkixtsp_TimeStampResp);
280
281   return offset;
282 }
283
284
285 static const value_string pkixtsp_Tst_version_vals[] = {
286   {   1, "v1" },
287   { 0, NULL }
288 };
289
290
291 static int
292 dissect_pkixtsp_Tst_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_) {
293   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
294                                                 NULL);
295
296   return offset;
297 }
298
299
300
301 static int
302 dissect_pkixtsp_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_) {
303   offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
304
305   return offset;
306 }
307
308
309
310 static int
311 dissect_pkixtsp_INTEGER_1_999(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
312   offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
313                                                 NULL);
314
315   return offset;
316 }
317
318
319 static const ber_sequence_t Accuracy_sequence[] = {
320   { &hf_pkixtsp_seconds     , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_INTEGER },
321   { &hf_pkixtsp_millis      , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixtsp_INTEGER_1_999 },
322   { &hf_pkixtsp_micros      , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkixtsp_INTEGER_1_999 },
323   { NULL, 0, 0, 0, NULL }
324 };
325
326 static int
327 dissect_pkixtsp_Accuracy(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
328   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
329                                    Accuracy_sequence, hf_index, ett_pkixtsp_Accuracy);
330
331   return offset;
332 }
333
334
335 static const ber_sequence_t TSTInfo_sequence[] = {
336   { &hf_pkixtsp_tst_version , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_Tst_version },
337   { &hf_pkixtsp_policy      , BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_TSAPolicyId },
338   { &hf_pkixtsp_messageImprint, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_MessageImprint },
339   { &hf_pkixtsp_serialNumber, BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_INTEGER },
340   { &hf_pkixtsp_genTime     , BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_pkixtsp_GeneralizedTime },
341   { &hf_pkixtsp_accuracy    , BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_Accuracy },
342   { &hf_pkixtsp_ordering    , BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_BOOLEAN },
343   { &hf_pkixtsp_nonce       , BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_pkixtsp_INTEGER },
344   { &hf_pkixtsp_tsa         , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkix1implicit_GeneralName },
345   { &hf_pkixtsp_extensions  , BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_pkix1explicit_Extensions },
346   { NULL, 0, 0, 0, NULL }
347 };
348
349 static int
350 dissect_pkixtsp_TSTInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
351   offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
352                                    TSTInfo_sequence, hf_index, ett_pkixtsp_TSTInfo);
353
354   return offset;
355 }
356
357 /*--- PDUs ---*/
358
359 static void dissect_TSTInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
360   asn1_ctx_t asn1_ctx;
361   asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
362   dissect_pkixtsp_TSTInfo(FALSE, tvb, 0, &asn1_ctx, tree, hf_pkixtsp_TSTInfo_PDU);
363 }
364
365
366 /*--- End of included file: packet-pkixtsp-fn.c ---*/
367 #line 57 "packet-pkixtsp-template.c"
368
369
370 static int
371 dissect_timestamp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
372 {
373         proto_item *item=NULL;
374         proto_tree *tree=NULL;
375         asn1_ctx_t asn1_ctx;
376         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
377
378         col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
379
380         if (check_col(pinfo->cinfo, COL_INFO)) {
381                 col_set_str(pinfo->cinfo, COL_INFO, "Reply");
382         }
383
384
385         if(parent_tree){
386                 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
387                 tree = proto_item_add_subtree(item, ett_pkixtsp);
388         }
389
390         return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, &asn1_ctx, tree, -1);
391 }
392
393 static int
394 dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
395 {
396         proto_item *item=NULL;
397         proto_tree *tree=NULL;
398         asn1_ctx_t asn1_ctx;
399         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
400
401         col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
402
403         if (check_col(pinfo->cinfo, COL_INFO)) {
404                 col_set_str(pinfo->cinfo, COL_INFO, "Query");
405         }
406
407
408         if(parent_tree){
409                 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
410                 tree = proto_item_add_subtree(item, ett_pkixtsp);
411         }
412
413         return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, &asn1_ctx, tree, -1);
414 }
415
416
417 /*--- proto_register_pkixtsp ----------------------------------------------*/
418 void proto_register_pkixtsp(void) {
419
420   /* List of fields */
421   static hf_register_info hf[] = {
422
423 /*--- Included file: packet-pkixtsp-hfarr.c ---*/
424 #line 1 "packet-pkixtsp-hfarr.c"
425     { &hf_pkixtsp_TSTInfo_PDU,
426       { "TSTInfo", "pkixtsp.TSTInfo",
427         FT_NONE, BASE_NONE, NULL, 0,
428         "pkixtsp.TSTInfo", HFILL }},
429     { &hf_pkixtsp_version,
430       { "version", "pkixtsp.version",
431         FT_INT32, BASE_DEC, VALS(pkixtsp_T_version_vals), 0,
432         "pkixtsp.T_version", HFILL }},
433     { &hf_pkixtsp_messageImprint,
434       { "messageImprint", "pkixtsp.messageImprint",
435         FT_NONE, BASE_NONE, NULL, 0,
436         "pkixtsp.MessageImprint", HFILL }},
437     { &hf_pkixtsp_reqPolicy,
438       { "reqPolicy", "pkixtsp.reqPolicy",
439         FT_OID, BASE_NONE, NULL, 0,
440         "pkixtsp.TSAPolicyId", HFILL }},
441     { &hf_pkixtsp_nonce,
442       { "nonce", "pkixtsp.nonce",
443         FT_INT32, BASE_DEC, NULL, 0,
444         "pkixtsp.INTEGER", HFILL }},
445     { &hf_pkixtsp_certReq,
446       { "certReq", "pkixtsp.certReq",
447         FT_BOOLEAN, BASE_NONE, NULL, 0,
448         "pkixtsp.BOOLEAN", HFILL }},
449     { &hf_pkixtsp_extensions,
450       { "extensions", "pkixtsp.extensions",
451         FT_UINT32, BASE_DEC, NULL, 0,
452         "pkix1explicit.Extensions", HFILL }},
453     { &hf_pkixtsp_hashAlgorithm,
454       { "hashAlgorithm", "pkixtsp.hashAlgorithm",
455         FT_NONE, BASE_NONE, NULL, 0,
456         "pkix1explicit.AlgorithmIdentifier", HFILL }},
457     { &hf_pkixtsp_hashedMessage,
458       { "hashedMessage", "pkixtsp.hashedMessage",
459         FT_BYTES, BASE_NONE, NULL, 0,
460         "pkixtsp.OCTET_STRING", HFILL }},
461     { &hf_pkixtsp_status,
462       { "status", "pkixtsp.status",
463         FT_NONE, BASE_NONE, NULL, 0,
464         "pkixtsp.PKIStatusInfo", HFILL }},
465     { &hf_pkixtsp_timeStampToken,
466       { "timeStampToken", "pkixtsp.timeStampToken",
467         FT_NONE, BASE_NONE, NULL, 0,
468         "pkixtsp.TimeStampToken", HFILL }},
469     { &hf_pkixtsp_pki_status,
470       { "status", "pkixtsp.status",
471         FT_INT32, BASE_DEC, VALS(pkixtsp_PKIStatus_vals), 0,
472         "pkixtsp.PKIStatus", HFILL }},
473     { &hf_pkixtsp_failInfo,
474       { "failInfo", "pkixtsp.failInfo",
475         FT_BYTES, BASE_NONE, NULL, 0,
476         "pkixtsp.PKIFailureInfo", HFILL }},
477     { &hf_pkixtsp_tst_version,
478       { "version", "pkixtsp.version",
479         FT_INT32, BASE_DEC, VALS(pkixtsp_Tst_version_vals), 0,
480         "pkixtsp.Tst_version", HFILL }},
481     { &hf_pkixtsp_policy,
482       { "policy", "pkixtsp.policy",
483         FT_OID, BASE_NONE, NULL, 0,
484         "pkixtsp.TSAPolicyId", HFILL }},
485     { &hf_pkixtsp_serialNumber,
486       { "serialNumber", "pkixtsp.serialNumber",
487         FT_INT32, BASE_DEC, NULL, 0,
488         "pkixtsp.INTEGER", HFILL }},
489     { &hf_pkixtsp_genTime,
490       { "genTime", "pkixtsp.genTime",
491         FT_STRING, BASE_NONE, NULL, 0,
492         "pkixtsp.GeneralizedTime", HFILL }},
493     { &hf_pkixtsp_accuracy,
494       { "accuracy", "pkixtsp.accuracy",
495         FT_NONE, BASE_NONE, NULL, 0,
496         "pkixtsp.Accuracy", HFILL }},
497     { &hf_pkixtsp_ordering,
498       { "ordering", "pkixtsp.ordering",
499         FT_BOOLEAN, BASE_NONE, NULL, 0,
500         "pkixtsp.BOOLEAN", HFILL }},
501     { &hf_pkixtsp_tsa,
502       { "tsa", "pkixtsp.tsa",
503         FT_UINT32, BASE_DEC, NULL, 0,
504         "pkix1implicit.GeneralName", HFILL }},
505     { &hf_pkixtsp_seconds,
506       { "seconds", "pkixtsp.seconds",
507         FT_INT32, BASE_DEC, NULL, 0,
508         "pkixtsp.INTEGER", HFILL }},
509     { &hf_pkixtsp_millis,
510       { "millis", "pkixtsp.millis",
511         FT_UINT32, BASE_DEC, NULL, 0,
512         "pkixtsp.INTEGER_1_999", HFILL }},
513     { &hf_pkixtsp_micros,
514       { "micros", "pkixtsp.micros",
515         FT_UINT32, BASE_DEC, NULL, 0,
516         "pkixtsp.INTEGER_1_999", HFILL }},
517     { &hf_pkixtsp_PKIFailureInfo_badAlg,
518       { "badAlg", "pkixtsp.badAlg",
519         FT_BOOLEAN, 8, NULL, 0x80,
520         NULL, HFILL }},
521     { &hf_pkixtsp_PKIFailureInfo_badRequest,
522       { "badRequest", "pkixtsp.badRequest",
523         FT_BOOLEAN, 8, NULL, 0x20,
524         NULL, HFILL }},
525     { &hf_pkixtsp_PKIFailureInfo_badDataFormat,
526       { "badDataFormat", "pkixtsp.badDataFormat",
527         FT_BOOLEAN, 8, NULL, 0x04,
528         NULL, HFILL }},
529     { &hf_pkixtsp_PKIFailureInfo_timeNotAvailable,
530       { "timeNotAvailable", "pkixtsp.timeNotAvailable",
531         FT_BOOLEAN, 8, NULL, 0x02,
532         NULL, HFILL }},
533     { &hf_pkixtsp_PKIFailureInfo_unacceptedPolicy,
534       { "unacceptedPolicy", "pkixtsp.unacceptedPolicy",
535         FT_BOOLEAN, 8, NULL, 0x01,
536         NULL, HFILL }},
537     { &hf_pkixtsp_PKIFailureInfo_unacceptedExtension,
538       { "unacceptedExtension", "pkixtsp.unacceptedExtension",
539         FT_BOOLEAN, 8, NULL, 0x80,
540         NULL, HFILL }},
541     { &hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable,
542       { "addInfoNotAvailable", "pkixtsp.addInfoNotAvailable",
543         FT_BOOLEAN, 8, NULL, 0x40,
544         NULL, HFILL }},
545     { &hf_pkixtsp_PKIFailureInfo_systemFailure,
546       { "systemFailure", "pkixtsp.systemFailure",
547         FT_BOOLEAN, 8, NULL, 0x40,
548         NULL, HFILL }},
549
550 /*--- End of included file: packet-pkixtsp-hfarr.c ---*/
551 #line 118 "packet-pkixtsp-template.c"
552   };
553
554   /* List of subtrees */
555   static gint *ett[] = {
556         &ett_pkixtsp,
557
558 /*--- Included file: packet-pkixtsp-ettarr.c ---*/
559 #line 1 "packet-pkixtsp-ettarr.c"
560     &ett_pkixtsp_TimeStampReq,
561     &ett_pkixtsp_MessageImprint,
562     &ett_pkixtsp_TimeStampResp,
563     &ett_pkixtsp_PKIStatusInfo,
564     &ett_pkixtsp_PKIFailureInfo,
565     &ett_pkixtsp_TSTInfo,
566     &ett_pkixtsp_Accuracy,
567
568 /*--- End of included file: packet-pkixtsp-ettarr.c ---*/
569 #line 124 "packet-pkixtsp-template.c"
570   };
571
572   /* Register protocol */
573   proto_pkixtsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
574
575   /* Register fields and subtrees */
576   proto_register_field_array(proto_pkixtsp, hf, array_length(hf));
577   proto_register_subtree_array(ett, array_length(ett));
578
579 }
580
581
582 /*--- proto_reg_handoff_pkixtsp -------------------------------------------*/
583 void proto_reg_handoff_pkixtsp(void) {
584         dissector_handle_t timestamp_reply_handle;
585         dissector_handle_t timestamp_query_handle;
586
587         timestamp_reply_handle = new_create_dissector_handle(dissect_timestamp_reply, proto_pkixtsp);
588         dissector_add_string("media_type", "application/timestamp-reply", timestamp_reply_handle);
589
590         timestamp_query_handle = new_create_dissector_handle(dissect_timestamp_query, proto_pkixtsp);
591         dissector_add_string("media_type", "application/timestamp-query", timestamp_query_handle);
592
593
594 /*--- Included file: packet-pkixtsp-dis-tab.c ---*/
595 #line 1 "packet-pkixtsp-dis-tab.c"
596   register_ber_oid_dissector("1.2.840.113549.1.9.16.1.4", dissect_TSTInfo_PDU, proto_pkixtsp, "id-ct-TSTInfo");
597
598
599 /*--- End of included file: packet-pkixtsp-dis-tab.c ---*/
600 #line 148 "packet-pkixtsp-template.c"
601 }
602