2 * Routines for PKINIT packet dissection
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include <epan/packet.h>
15 #include <epan/asn1.h>
17 #include "packet-ber.h"
18 #include "packet-pkinit.h"
19 #include "packet-cms.h"
20 #include "packet-pkix1explicit.h"
21 #include "packet-kerberos.h"
23 #define PNAME "PKINIT"
24 #define PSNAME "PKInit"
25 #define PFNAME "pkinit"
27 void proto_register_pkinit(void);
28 void proto_reg_handoff_pkinit(void);
30 /* Initialize the protocol and registered fields */
31 static int proto_pkinit = -1;
32 #include "packet-pkinit-hf.c"
34 /* Initialize the subtree pointers */
35 #include "packet-pkinit-ett.c"
37 static int dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
38 static int dissect_KerberosV5Spec2_Realm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
39 static int dissect_KerberosV5Spec2_PrincipalName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
40 static int dissect_pkinit_PKAuthenticator_Win2k(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
42 #include "packet-pkinit-fn.c"
45 dissect_pkinit_PA_PK_AS_REQ(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
46 offset = dissect_pkinit_PaPkAsReq(FALSE, tvb, offset, actx, tree, -1);
51 dissect_pkinit_PA_PK_AS_REP(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_) {
52 offset = dissect_pkinit_PaPkAsRep(FALSE, tvb, offset, actx, tree, -1);
57 dissect_KerberosV5Spec2_KerberosTime(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
58 offset = dissect_krb5_ctime(tree, tvb, offset, actx);
63 dissect_KerberosV5Spec2_Realm(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
64 offset = dissect_krb5_realm(tree, tvb, offset, actx);
69 dissect_KerberosV5Spec2_PrincipalName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_) {
70 offset = dissect_krb5_cname(tree, tvb, offset, actx);
75 /*--- proto_register_pkinit ----------------------------------------------*/
76 void proto_register_pkinit(void) {
79 static hf_register_info hf[] = {
80 #include "packet-pkinit-hfarr.c"
83 /* List of subtrees */
84 static gint *ett[] = {
85 #include "packet-pkinit-ettarr.c"
88 /* Register protocol */
89 proto_pkinit = proto_register_protocol(PNAME, PSNAME, PFNAME);
91 /* Register fields and subtrees */
92 proto_register_field_array(proto_pkinit, hf, array_length(hf));
93 proto_register_subtree_array(ett, array_length(ett));
98 /*--- proto_reg_handoff_pkinit -------------------------------------------*/
99 void proto_reg_handoff_pkinit(void) {
100 #include "packet-pkinit-dis-tab.c"