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 -e -p pkixtsp -c pkixtsp.cnf -s packet-pkixtsp-template PKIXTSP.asn */
6 /* Input file: packet-pkixtsp-template.c */
8 #line 1 "packet-pkixtsp-template.c"
10 * Routines for RFC2634 Extended Security Services packet dissection
11 * Ronnie Sahlberg 2004
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39 #include <epan/packet.h>
44 #include <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"
51 #define PNAME "PKIX Time Stamp Protocol"
52 #define PSNAME "PKIXTSP"
53 #define PFNAME "pkixtsp"
55 /* Initialize the protocol and registered fields */
56 static int proto_pkixtsp = -1;
58 /*--- Included file: packet-pkixtsp-hf.c ---*/
59 #line 1 "packet-pkixtsp-hf.c"
60 static int hf_pkixtsp_version = -1; /* T_version */
61 static int hf_pkixtsp_messageImprint = -1; /* MessageImprint */
62 static int hf_pkixtsp_reqPolicy = -1; /* TSAPolicyId */
63 static int hf_pkixtsp_nonce = -1; /* INTEGER */
64 static int hf_pkixtsp_certReq = -1; /* BOOLEAN */
65 static int hf_pkixtsp_extensions = -1; /* Extensions */
66 static int hf_pkixtsp_hashAlgorithm = -1; /* AlgorithmIdentifier */
67 static int hf_pkixtsp_hashedMessage = -1; /* OCTET_STRING */
68 static int hf_pkixtsp_status = -1; /* PKIStatusInfo */
69 static int hf_pkixtsp_timeStampToken = -1; /* TimeStampToken */
70 static int hf_pkixtsp_pki_status = -1; /* PKIStatus */
71 static int hf_pkixtsp_failInfo = -1; /* PKIFailureInfo */
72 static int hf_pkixtsp_tst_version = -1; /* tst_version */
73 static int hf_pkixtsp_policy = -1; /* TSAPolicyId */
74 static int hf_pkixtsp_serialNumber = -1; /* INTEGER */
75 static int hf_pkixtsp_genTime = -1; /* GeneralizedTime */
76 static int hf_pkixtsp_accuracy = -1; /* Accuracy */
77 static int hf_pkixtsp_ordering = -1; /* BOOLEAN */
78 static int hf_pkixtsp_tsa = -1; /* GeneralName */
79 static int hf_pkixtsp_seconds = -1; /* INTEGER */
80 static int hf_pkixtsp_millis = -1; /* INTEGER_1_999 */
81 static int hf_pkixtsp_micros = -1; /* INTEGER_1_999 */
83 static int hf_pkixtsp_PKIFailureInfo_badAlg = -1;
84 static int hf_pkixtsp_PKIFailureInfo_badRequest = -1;
85 static int hf_pkixtsp_PKIFailureInfo_badDataFormat = -1;
86 static int hf_pkixtsp_PKIFailureInfo_timeNotAvailable = -1;
87 static int hf_pkixtsp_PKIFailureInfo_unacceptedPolicy = -1;
88 static int hf_pkixtsp_PKIFailureInfo_unacceptedExtension = -1;
89 static int hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable = -1;
90 static int hf_pkixtsp_PKIFailureInfo_systemFailure = -1;
92 /*--- End of included file: packet-pkixtsp-hf.c ---*/
93 #line 50 "packet-pkixtsp-template.c"
95 /* Initialize the subtree pointers */
96 static gint ett_pkixtsp = -1;
98 /*--- Included file: packet-pkixtsp-ett.c ---*/
99 #line 1 "packet-pkixtsp-ett.c"
100 static gint ett_pkixtsp_TimeStampReq = -1;
101 static gint ett_pkixtsp_MessageImprint = -1;
102 static gint ett_pkixtsp_TimeStampResp = -1;
103 static gint ett_pkixtsp_PKIStatusInfo = -1;
104 static gint ett_pkixtsp_PKIFailureInfo = -1;
105 static gint ett_pkixtsp_TSTInfo = -1;
106 static gint ett_pkixtsp_Accuracy = -1;
108 /*--- End of included file: packet-pkixtsp-ett.c ---*/
109 #line 54 "packet-pkixtsp-template.c"
113 /*--- Included file: packet-pkixtsp-fn.c ---*/
114 #line 1 "packet-pkixtsp-fn.c"
115 /*--- Fields for imported types ---*/
117 static int dissect_extensions_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
118 return dissect_pkix1explicit_Extensions(TRUE, tvb, offset, actx, tree, hf_pkixtsp_extensions);
120 static int dissect_hashAlgorithm(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
121 return dissect_pkix1explicit_AlgorithmIdentifier(FALSE, tvb, offset, actx, tree, hf_pkixtsp_hashAlgorithm);
123 static int dissect_tsa_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
124 return dissect_pkix1implicit_GeneralName(TRUE, tvb, offset, actx, tree, hf_pkixtsp_tsa);
128 static const value_string pkixtsp_T_version_vals[] = {
135 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_) {
136 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
141 static int dissect_version(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
142 return dissect_pkixtsp_T_version(FALSE, tvb, offset, actx, tree, hf_pkixtsp_version);
148 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_) {
149 offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
154 static int dissect_hashedMessage(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
155 return dissect_pkixtsp_OCTET_STRING(FALSE, tvb, offset, actx, tree, hf_pkixtsp_hashedMessage);
159 static const ber_old_sequence_t MessageImprint_sequence[] = {
160 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_hashAlgorithm },
161 { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_hashedMessage },
166 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_) {
167 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
168 MessageImprint_sequence, hf_index, ett_pkixtsp_MessageImprint);
172 static int dissect_messageImprint(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
173 return dissect_pkixtsp_MessageImprint(FALSE, tvb, offset, actx, tree, hf_pkixtsp_messageImprint);
179 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_) {
180 offset = dissect_ber_object_identifier(implicit_tag, actx, tree, tvb, offset, hf_index, NULL);
184 static int dissect_reqPolicy(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
185 return dissect_pkixtsp_TSAPolicyId(FALSE, tvb, offset, actx, tree, hf_pkixtsp_reqPolicy);
187 static int dissect_policy(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
188 return dissect_pkixtsp_TSAPolicyId(FALSE, tvb, offset, actx, tree, hf_pkixtsp_policy);
194 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_) {
195 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
200 static int dissect_nonce(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
201 return dissect_pkixtsp_INTEGER(FALSE, tvb, offset, actx, tree, hf_pkixtsp_nonce);
203 static int dissect_serialNumber(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
204 return dissect_pkixtsp_INTEGER(FALSE, tvb, offset, actx, tree, hf_pkixtsp_serialNumber);
206 static int dissect_seconds(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
207 return dissect_pkixtsp_INTEGER(FALSE, tvb, offset, actx, tree, hf_pkixtsp_seconds);
213 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_) {
214 offset = dissect_ber_boolean(implicit_tag, actx, tree, tvb, offset, hf_index);
218 static int dissect_certReq(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
219 return dissect_pkixtsp_BOOLEAN(FALSE, tvb, offset, actx, tree, hf_pkixtsp_certReq);
221 static int dissect_ordering(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
222 return dissect_pkixtsp_BOOLEAN(FALSE, tvb, offset, actx, tree, hf_pkixtsp_ordering);
226 static const ber_old_sequence_t TimeStampReq_sequence[] = {
227 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version },
228 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_messageImprint },
229 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_reqPolicy },
230 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_nonce },
231 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_certReq },
232 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_extensions_impl },
237 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_) {
238 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
239 TimeStampReq_sequence, hf_index, ett_pkixtsp_TimeStampReq);
245 static const value_string pkixtsp_PKIStatus_vals[] = {
247 { 1, "grantedWithMods" },
250 { 4, "revocationWarning" },
251 { 5, "revocationNotification" },
257 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_) {
258 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
263 static int dissect_pki_status(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
264 return dissect_pkixtsp_PKIStatus(FALSE, tvb, offset, actx, tree, hf_pkixtsp_pki_status);
268 static const asn_namedbit PKIFailureInfo_bits[] = {
269 { 0, &hf_pkixtsp_PKIFailureInfo_badAlg, -1, -1, "badAlg", NULL },
270 { 2, &hf_pkixtsp_PKIFailureInfo_badRequest, -1, -1, "badRequest", NULL },
271 { 5, &hf_pkixtsp_PKIFailureInfo_badDataFormat, -1, -1, "badDataFormat", NULL },
272 { 14, &hf_pkixtsp_PKIFailureInfo_timeNotAvailable, -1, -1, "timeNotAvailable", NULL },
273 { 15, &hf_pkixtsp_PKIFailureInfo_unacceptedPolicy, -1, -1, "unacceptedPolicy", NULL },
274 { 16, &hf_pkixtsp_PKIFailureInfo_unacceptedExtension, -1, -1, "unacceptedExtension", NULL },
275 { 17, &hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable, -1, -1, "addInfoNotAvailable", NULL },
276 { 25, &hf_pkixtsp_PKIFailureInfo_systemFailure, -1, -1, "systemFailure", NULL },
277 { 0, NULL, 0, 0, NULL, NULL }
281 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_) {
282 offset = dissect_ber_bitstring(implicit_tag, actx, tree, tvb, offset,
283 PKIFailureInfo_bits, hf_index, ett_pkixtsp_PKIFailureInfo,
288 static int dissect_failInfo(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
289 return dissect_pkixtsp_PKIFailureInfo(FALSE, tvb, offset, actx, tree, hf_pkixtsp_failInfo);
293 static const ber_old_sequence_t PKIStatusInfo_sequence[] = {
294 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_pki_status },
295 { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_failInfo },
300 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_) {
301 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
302 PKIStatusInfo_sequence, hf_index, ett_pkixtsp_PKIStatusInfo);
306 static int dissect_status(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
307 return dissect_pkixtsp_PKIStatusInfo(FALSE, tvb, offset, actx, tree, hf_pkixtsp_status);
313 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_) {
314 offset = dissect_cms_ContentInfo(implicit_tag, tvb, offset, actx, tree, hf_index);
318 static int dissect_timeStampToken(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
319 return dissect_pkixtsp_TimeStampToken(FALSE, tvb, offset, actx, tree, hf_pkixtsp_timeStampToken);
323 static const ber_old_sequence_t TimeStampResp_sequence[] = {
324 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_status },
325 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_timeStampToken },
330 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_) {
331 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
332 TimeStampResp_sequence, hf_index, ett_pkixtsp_TimeStampResp);
338 static const value_string pkixtsp_tst_version_vals[] = {
345 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_) {
346 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
351 static int dissect_tst_version(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
352 return dissect_pkixtsp_tst_version(FALSE, tvb, offset, actx, tree, hf_pkixtsp_tst_version);
358 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_) {
359 offset = dissect_ber_GeneralizedTime(implicit_tag, actx, tree, tvb, offset, hf_index);
363 static int dissect_genTime(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
364 return dissect_pkixtsp_GeneralizedTime(FALSE, tvb, offset, actx, tree, hf_pkixtsp_genTime);
370 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_) {
371 offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
376 static int dissect_millis_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
377 return dissect_pkixtsp_INTEGER_1_999(TRUE, tvb, offset, actx, tree, hf_pkixtsp_millis);
379 static int dissect_micros_impl(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
380 return dissect_pkixtsp_INTEGER_1_999(TRUE, tvb, offset, actx, tree, hf_pkixtsp_micros);
384 static const ber_old_sequence_t Accuracy_sequence[] = {
385 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_seconds },
386 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_millis_impl },
387 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_micros_impl },
392 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_) {
393 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
394 Accuracy_sequence, hf_index, ett_pkixtsp_Accuracy);
398 static int dissect_accuracy(proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_) {
399 return dissect_pkixtsp_Accuracy(FALSE, tvb, offset, actx, tree, hf_pkixtsp_accuracy);
403 static const ber_old_sequence_t TSTInfo_sequence[] = {
404 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_tst_version },
405 { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_policy },
406 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_messageImprint },
407 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber },
408 { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_genTime },
409 { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_accuracy },
410 { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_ordering },
411 { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_nonce },
412 { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_tsa_impl },
413 { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_extensions_impl },
418 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_) {
419 offset = dissect_ber_old_sequence(implicit_tag, actx, tree, tvb, offset,
420 TSTInfo_sequence, hf_index, ett_pkixtsp_TSTInfo);
426 /*--- End of included file: packet-pkixtsp-fn.c ---*/
427 #line 57 "packet-pkixtsp-template.c"
431 dissect_timestamp_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
433 proto_item *item=NULL;
434 proto_tree *tree=NULL;
436 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
438 if (check_col(pinfo->cinfo, COL_PROTOCOL))
439 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
441 if (check_col(pinfo->cinfo, COL_INFO)) {
442 col_clear(pinfo->cinfo, COL_INFO);
444 col_add_fstr(pinfo->cinfo, COL_INFO, "Reply");
449 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
450 tree = proto_item_add_subtree(item, ett_pkixtsp);
453 return dissect_pkixtsp_TimeStampResp(FALSE, tvb, 0, &asn1_ctx, tree, -1);
457 dissect_timestamp_query(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
459 proto_item *item=NULL;
460 proto_tree *tree=NULL;
462 asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
464 if (check_col(pinfo->cinfo, COL_PROTOCOL))
465 col_set_str(pinfo->cinfo, COL_PROTOCOL, "PKIXTSP");
467 if (check_col(pinfo->cinfo, COL_INFO)) {
468 col_clear(pinfo->cinfo, COL_INFO);
470 col_add_fstr(pinfo->cinfo, COL_INFO, "Query");
475 item=proto_tree_add_item(parent_tree, proto_pkixtsp, tvb, 0, -1, FALSE);
476 tree = proto_item_add_subtree(item, ett_pkixtsp);
479 return dissect_pkixtsp_TimeStampReq(FALSE, tvb, 0, &asn1_ctx, tree, -1);
483 /*--- proto_register_pkixtsp ----------------------------------------------*/
484 void proto_register_pkixtsp(void) {
487 static hf_register_info hf[] = {
489 /*--- Included file: packet-pkixtsp-hfarr.c ---*/
490 #line 1 "packet-pkixtsp-hfarr.c"
491 { &hf_pkixtsp_version,
492 { "version", "pkixtsp.version",
493 FT_INT32, BASE_DEC, VALS(pkixtsp_T_version_vals), 0,
494 "pkixtsp.T_version", HFILL }},
495 { &hf_pkixtsp_messageImprint,
496 { "messageImprint", "pkixtsp.messageImprint",
497 FT_NONE, BASE_NONE, NULL, 0,
498 "pkixtsp.MessageImprint", HFILL }},
499 { &hf_pkixtsp_reqPolicy,
500 { "reqPolicy", "pkixtsp.reqPolicy",
501 FT_OID, BASE_NONE, NULL, 0,
502 "pkixtsp.TSAPolicyId", HFILL }},
504 { "nonce", "pkixtsp.nonce",
505 FT_INT32, BASE_DEC, NULL, 0,
506 "pkixtsp.INTEGER", HFILL }},
507 { &hf_pkixtsp_certReq,
508 { "certReq", "pkixtsp.certReq",
509 FT_BOOLEAN, 8, NULL, 0,
510 "pkixtsp.BOOLEAN", HFILL }},
511 { &hf_pkixtsp_extensions,
512 { "extensions", "pkixtsp.extensions",
513 FT_UINT32, BASE_DEC, NULL, 0,
514 "pkix1explicit.Extensions", HFILL }},
515 { &hf_pkixtsp_hashAlgorithm,
516 { "hashAlgorithm", "pkixtsp.hashAlgorithm",
517 FT_NONE, BASE_NONE, NULL, 0,
518 "pkix1explicit.AlgorithmIdentifier", HFILL }},
519 { &hf_pkixtsp_hashedMessage,
520 { "hashedMessage", "pkixtsp.hashedMessage",
521 FT_BYTES, BASE_HEX, NULL, 0,
522 "pkixtsp.OCTET_STRING", HFILL }},
523 { &hf_pkixtsp_status,
524 { "status", "pkixtsp.status",
525 FT_NONE, BASE_NONE, NULL, 0,
526 "pkixtsp.PKIStatusInfo", HFILL }},
527 { &hf_pkixtsp_timeStampToken,
528 { "timeStampToken", "pkixtsp.timeStampToken",
529 FT_NONE, BASE_NONE, NULL, 0,
530 "pkixtsp.TimeStampToken", HFILL }},
531 { &hf_pkixtsp_pki_status,
532 { "status", "pkixtsp.status",
533 FT_INT32, BASE_DEC, VALS(pkixtsp_PKIStatus_vals), 0,
534 "pkixtsp.PKIStatus", HFILL }},
535 { &hf_pkixtsp_failInfo,
536 { "failInfo", "pkixtsp.failInfo",
537 FT_BYTES, BASE_HEX, NULL, 0,
538 "pkixtsp.PKIFailureInfo", HFILL }},
539 { &hf_pkixtsp_tst_version,
540 { "version", "pkixtsp.version",
541 FT_INT32, BASE_DEC, VALS(pkixtsp_tst_version_vals), 0,
542 "pkixtsp.tst_version", HFILL }},
543 { &hf_pkixtsp_policy,
544 { "policy", "pkixtsp.policy",
545 FT_OID, BASE_NONE, NULL, 0,
546 "pkixtsp.TSAPolicyId", HFILL }},
547 { &hf_pkixtsp_serialNumber,
548 { "serialNumber", "pkixtsp.serialNumber",
549 FT_INT32, BASE_DEC, NULL, 0,
550 "pkixtsp.INTEGER", HFILL }},
551 { &hf_pkixtsp_genTime,
552 { "genTime", "pkixtsp.genTime",
553 FT_STRING, BASE_NONE, NULL, 0,
554 "pkixtsp.GeneralizedTime", HFILL }},
555 { &hf_pkixtsp_accuracy,
556 { "accuracy", "pkixtsp.accuracy",
557 FT_NONE, BASE_NONE, NULL, 0,
558 "pkixtsp.Accuracy", HFILL }},
559 { &hf_pkixtsp_ordering,
560 { "ordering", "pkixtsp.ordering",
561 FT_BOOLEAN, 8, NULL, 0,
562 "pkixtsp.BOOLEAN", HFILL }},
564 { "tsa", "pkixtsp.tsa",
565 FT_UINT32, BASE_DEC, NULL, 0,
566 "pkix1implicit.GeneralName", HFILL }},
567 { &hf_pkixtsp_seconds,
568 { "seconds", "pkixtsp.seconds",
569 FT_INT32, BASE_DEC, NULL, 0,
570 "pkixtsp.INTEGER", HFILL }},
571 { &hf_pkixtsp_millis,
572 { "millis", "pkixtsp.millis",
573 FT_UINT32, BASE_DEC, NULL, 0,
574 "pkixtsp.INTEGER_1_999", HFILL }},
575 { &hf_pkixtsp_micros,
576 { "micros", "pkixtsp.micros",
577 FT_UINT32, BASE_DEC, NULL, 0,
578 "pkixtsp.INTEGER_1_999", HFILL }},
579 { &hf_pkixtsp_PKIFailureInfo_badAlg,
580 { "badAlg", "pkixtsp.badAlg",
581 FT_BOOLEAN, 8, NULL, 0x80,
583 { &hf_pkixtsp_PKIFailureInfo_badRequest,
584 { "badRequest", "pkixtsp.badRequest",
585 FT_BOOLEAN, 8, NULL, 0x20,
587 { &hf_pkixtsp_PKIFailureInfo_badDataFormat,
588 { "badDataFormat", "pkixtsp.badDataFormat",
589 FT_BOOLEAN, 8, NULL, 0x04,
591 { &hf_pkixtsp_PKIFailureInfo_timeNotAvailable,
592 { "timeNotAvailable", "pkixtsp.timeNotAvailable",
593 FT_BOOLEAN, 8, NULL, 0x02,
595 { &hf_pkixtsp_PKIFailureInfo_unacceptedPolicy,
596 { "unacceptedPolicy", "pkixtsp.unacceptedPolicy",
597 FT_BOOLEAN, 8, NULL, 0x01,
599 { &hf_pkixtsp_PKIFailureInfo_unacceptedExtension,
600 { "unacceptedExtension", "pkixtsp.unacceptedExtension",
601 FT_BOOLEAN, 8, NULL, 0x80,
603 { &hf_pkixtsp_PKIFailureInfo_addInfoNotAvailable,
604 { "addInfoNotAvailable", "pkixtsp.addInfoNotAvailable",
605 FT_BOOLEAN, 8, NULL, 0x40,
607 { &hf_pkixtsp_PKIFailureInfo_systemFailure,
608 { "systemFailure", "pkixtsp.systemFailure",
609 FT_BOOLEAN, 8, NULL, 0x40,
612 /*--- End of included file: packet-pkixtsp-hfarr.c ---*/
613 #line 118 "packet-pkixtsp-template.c"
616 /* List of subtrees */
617 static gint *ett[] = {
620 /*--- Included file: packet-pkixtsp-ettarr.c ---*/
621 #line 1 "packet-pkixtsp-ettarr.c"
622 &ett_pkixtsp_TimeStampReq,
623 &ett_pkixtsp_MessageImprint,
624 &ett_pkixtsp_TimeStampResp,
625 &ett_pkixtsp_PKIStatusInfo,
626 &ett_pkixtsp_PKIFailureInfo,
627 &ett_pkixtsp_TSTInfo,
628 &ett_pkixtsp_Accuracy,
630 /*--- End of included file: packet-pkixtsp-ettarr.c ---*/
631 #line 124 "packet-pkixtsp-template.c"
634 /* Register protocol */
635 proto_pkixtsp = proto_register_protocol(PNAME, PSNAME, PFNAME);
637 /* Register fields and subtrees */
638 proto_register_field_array(proto_pkixtsp, hf, array_length(hf));
639 proto_register_subtree_array(ett, array_length(ett));
644 /*--- proto_reg_handoff_pkixtsp -------------------------------------------*/
645 void proto_reg_handoff_pkixtsp(void) {
646 dissector_handle_t timestamp_reply_handle;
647 dissector_handle_t timestamp_query_handle;
649 timestamp_reply_handle = new_create_dissector_handle(dissect_timestamp_reply, proto_pkixtsp);
650 dissector_add_string("media_type", "application/timestamp-reply", timestamp_reply_handle);
652 timestamp_query_handle = new_create_dissector_handle(dissect_timestamp_query, proto_pkixtsp);
653 dissector_add_string("media_type", "application/timestamp-query", timestamp_query_handle);
655 /*#include "packet-pkixtsp-dis-tab.c"*/