Re-generate asn1 dissectors after hf_register_info cleanup.
[metze/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         if (check_col(pinfo->cinfo, COL_PROTOCOL)) 
379                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
380
381         if (check_col(pinfo->cinfo, COL_INFO)) {
382                 col_clear(pinfo->cinfo, COL_INFO);
383                 
384                 col_set_str(pinfo->cinfo, COL_INFO, "Reply");
385         }
386
387
388         if(parent_tree){
389                 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
390                 tree = proto_item_add_subtree(item, ett_pkixtsp);
391         }
392
393         return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, &asn1_ctx, tree, -1);
394 }
395
396 static int
397 dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
398 {
399         proto_item *item=NULL;
400         proto_tree *tree=NULL;
401         asn1_ctx_t asn1_ctx;
402         asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
403
404         if (check_col(pinfo->cinfo, COL_PROTOCOL)) 
405                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
406
407         if (check_col(pinfo->cinfo, COL_INFO)) {
408                 col_clear(pinfo->cinfo, COL_INFO);
409                 
410                 col_set_str(pinfo->cinfo, COL_INFO, "Query");
411         }
412
413
414         if(parent_tree){
415                 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
416                 tree = proto_item_add_subtree(item, ett_pkixtsp);
417         }
418
419         return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, &asn1_ctx, tree, -1);
420 }
421
422
423 /*--- proto_register_pkixtsp ----------------------------------------------*/
424 void proto_register_pkixtsp(void) {
425
426   /* List of fields */
427   static hf_register_info hf[] = {
428
429 /*--- Included file: packet-pkixtsp-hfarr.c ---*/
430 #line 1 "packet-pkixtsp-hfarr.c"
431     { &hf_pkixtsp_TSTInfo_PDU,
432       { "TSTInfo", "pkixtsp.TSTInfo",
433         FT_NONE, BASE_NONE, NULL, 0,
434         "pkixtsp.TSTInfo", HFILL }},
435     { &hf_pkixtsp_version,
436       { "version", "pkixtsp.version",
437         FT_INT32, BASE_DEC, VALS(pkixtsp_T_version_vals), 0,
438         "pkixtsp.T_version", HFILL }},
439     { &hf_pkixtsp_messageImprint,
440       { "messageImprint", "pkixtsp.messageImprint",
441         FT_NONE, BASE_NONE, NULL, 0,
442         "pkixtsp.MessageImprint", HFILL }},
443     { &hf_pkixtsp_reqPolicy,
444       { "reqPolicy", "pkixtsp.reqPolicy",
445         FT_OID, BASE_NONE, NULL, 0,
446         "pkixtsp.TSAPolicyId", HFILL }},
447     { &hf_pkixtsp_nonce,
448       { "nonce", "pkixtsp.nonce",
449         FT_INT32, BASE_DEC, NULL, 0,
450         "pkixtsp.INTEGER", HFILL }},
451     { &hf_pkixtsp_certReq,
452       { "certReq", "pkixtsp.certReq",
453         FT_BOOLEAN, BASE_NONE, NULL, 0,
454         "pkixtsp.BOOLEAN", HFILL }},
455     { &hf_pkixtsp_extensions,
456       { "extensions", "pkixtsp.extensions",
457         FT_UINT32, BASE_DEC, NULL, 0,
458         "pkix1explicit.Extensions", HFILL }},
459     { &hf_pkixtsp_hashAlgorithm,
460       { "hashAlgorithm", "pkixtsp.hashAlgorithm",
461         FT_NONE, BASE_NONE, NULL, 0,
462         "pkix1explicit.AlgorithmIdentifier", HFILL }},
463     { &hf_pkixtsp_hashedMessage,
464       { "hashedMessage", "pkixtsp.hashedMessage",
465         FT_BYTES, BASE_NONE, NULL, 0,
466         "pkixtsp.OCTET_STRING", HFILL }},
467     { &hf_pkixtsp_status,
468       { "status", "pkixtsp.status",
469         FT_NONE, BASE_NONE, NULL, 0,
470         "pkixtsp.PKIStatusInfo", HFILL }},
471     { &hf_pkixtsp_timeStampToken,
472       { "timeStampToken", "pkixtsp.timeStampToken",
473         FT_NONE, BASE_NONE, NULL, 0,
474         "pkixtsp.TimeStampToken", HFILL }},
475     { &hf_pkixtsp_pki_status,
476       { "status", "pkixtsp.status",
477         FT_INT32, BASE_DEC, VALS(pkixtsp_PKIStatus_vals), 0,
478         "pkixtsp.PKIStatus", HFILL }},
479     { &hf_pkixtsp_failInfo,
480       { "failInfo", "pkixtsp.failInfo",
481         FT_BYTES, BASE_NONE, NULL, 0,
482         "pkixtsp.PKIFailureInfo", HFILL }},
483     { &hf_pkixtsp_tst_version,
484       { "version", "pkixtsp.version",
485         FT_INT32, BASE_DEC, VALS(pkixtsp_Tst_version_vals), 0,
486         "pkixtsp.Tst_version", HFILL }},
487     { &hf_pkixtsp_policy,
488       { "policy", "pkixtsp.policy",
489         FT_OID, BASE_NONE, NULL, 0,
490         "pkixtsp.TSAPolicyId", HFILL }},
491     { &hf_pkixtsp_serialNumber,
492       { "serialNumber", "pkixtsp.serialNumber",
493         FT_INT32, BASE_DEC, NULL, 0,
494         "pkixtsp.INTEGER", HFILL }},
495     { &hf_pkixtsp_genTime,
496       { "genTime", "pkixtsp.genTime",
497         FT_STRING, BASE_NONE, NULL, 0,
498         "pkixtsp.GeneralizedTime", HFILL }},
499     { &hf_pkixtsp_accuracy,
500       { "accuracy", "pkixtsp.accuracy",
501         FT_NONE, BASE_NONE, NULL, 0,
502         "pkixtsp.Accuracy", HFILL }},
503     { &hf_pkixtsp_ordering,
504       { "ordering", "pkixtsp.ordering",
505         FT_BOOLEAN, BASE_NONE, NULL, 0,
506         "pkixtsp.BOOLEAN", HFILL }},
507     { &hf_pkixtsp_tsa,
508       { "tsa", "pkixtsp.tsa",
509         FT_UINT32, BASE_DEC, NULL, 0,
510         "pkix1implicit.GeneralName", HFILL }},
511     { &hf_pkixtsp_seconds,
512       { "seconds", "pkixtsp.seconds",
513         FT_INT32, BASE_DEC, NULL, 0,
514         "pkixtsp.INTEGER", HFILL }},
515     { &hf_pkixtsp_millis,
516       { "millis", "pkixtsp.millis",
517         FT_UINT32, BASE_DEC, NULL, 0,
518         "pkixtsp.INTEGER_1_999", HFILL }},
519     { &hf_pkixtsp_micros,
520       { "micros", "pkixtsp.micros",
521         FT_UINT32, BASE_DEC, NULL, 0,
522         "pkixtsp.INTEGER_1_999", HFILL }},
523     { &hf_pkixtsp_PKIFailureInfo_badAlg,
524       { "badAlg", "pkixtsp.badAlg",
525         FT_BOOLEAN, 8, NULL, 0x80,
526         NULL, HFILL }},
527     { &hf_pkixtsp_PKIFailureInfo_badRequest,
528       { "badRequest", "pkixtsp.badRequest",
529         FT_BOOLEAN, 8, NULL, 0x20,
530         NULL, HFILL }},
531     { &hf_pkixtsp_PKIFailureInfo_badDataFormat,
532       { "badDataFormat", "pkixtsp.badDataFormat",
533         FT_BOOLEAN, 8, NULL, 0x04,
534         NULL, HFILL }},
535     { &hf_pkixtsp_PKIFailureInfo_timeNotAvailable,
536       { "timeNotAvailable", "pkixtsp.timeNotAvailable",
537         FT_BOOLEAN, 8, NULL, 0x02,
538         NULL, HFILL }},
539     { &hf_pkixtsp_PKIFailureInfo_unacceptedPolicy,
540       { "unacceptedPolicy", "pkixtsp.unacceptedPolicy",
541         FT_BOOLEAN, 8, NULL, 0x01,
542         NULL, HFILL }},
543     { &hf_pkixtsp_PKIFailureInfo_unacceptedExtension,
544       { "unacceptedExtension", "pkixtsp.unacceptedExtension",
545         FT_BOOLEAN, 8, NULL, 0x80,
546         NULL, HFILL }},
547     { &hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable,
548       { "addInfoNotAvailable", "pkixtsp.addInfoNotAvailable",
549         FT_BOOLEAN, 8, NULL, 0x40,
550         NULL, HFILL }},
551     { &hf_pkixtsp_PKIFailureInfo_systemFailure,
552       { "systemFailure", "pkixtsp.systemFailure",
553         FT_BOOLEAN, 8, NULL, 0x40,
554         NULL, HFILL }},
555
556 /*--- End of included file: packet-pkixtsp-hfarr.c ---*/
557 #line 118 "packet-pkixtsp-template.c"
558   };
559
560   /* List of subtrees */
561   static gint *ett[] = {
562         &ett_pkixtsp,
563
564 /*--- Included file: packet-pkixtsp-ettarr.c ---*/
565 #line 1 "packet-pkixtsp-ettarr.c"
566     &ett_pkixtsp_TimeStampReq,
567     &ett_pkixtsp_MessageImprint,
568     &ett_pkixtsp_TimeStampResp,
569     &ett_pkixtsp_PKIStatusInfo,
570     &ett_pkixtsp_PKIFailureInfo,
571     &ett_pkixtsp_TSTInfo,
572     &ett_pkixtsp_Accuracy,
573
574 /*--- End of included file: packet-pkixtsp-ettarr.c ---*/
575 #line 124 "packet-pkixtsp-template.c"
576   };
577
578   /* Register protocol */
579   proto_pkixtsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
580
581   /* Register fields and subtrees */
582   proto_register_field_array(proto_pkixtsp, hf, array_length(hf));
583   proto_register_subtree_array(ett, array_length(ett));
584
585 }
586
587
588 /*--- proto_reg_handoff_pkixtsp -------------------------------------------*/
589 void proto_reg_handoff_pkixtsp(void) {
590         dissector_handle_t timestamp_reply_handle;
591         dissector_handle_t timestamp_query_handle;
592
593         timestamp_reply_handle = new_create_dissector_handle(dissect_timestamp_reply, proto_pkixtsp);
594         dissector_add_string("media_type", "application/timestamp-reply", timestamp_reply_handle);
595
596         timestamp_query_handle = new_create_dissector_handle(dissect_timestamp_query, proto_pkixtsp);
597         dissector_add_string("media_type", "application/timestamp-query", timestamp_query_handle);
598
599
600 /*--- Included file: packet-pkixtsp-dis-tab.c ---*/
601 #line 1 "packet-pkixtsp-dis-tab.c"
602   register_ber_oid_dissector("1.2.840.113549.1.9.16.1.4", dissect_TSTInfo_PDU, proto_pkixtsp, "id-ct-TSTInfo");
603
604
605 /*--- End of included file: packet-pkixtsp-dis-tab.c ---*/
606 #line 148 "packet-pkixtsp-template.c"
607 }
608