1 /* packet-dcerpc-krb5rpc.c
3 * Routines for dcerpc DCE/KRB5 interface
4 * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>
5 * This information is based off the released idl files from opengroup.
6 * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz security/idl/krb5rpc.idl
8 * $Id: packet-dcerpc-krb5rpc.c,v 1.4 2003/01/11 07:40:09 guy Exp $
10 * Ethereal - Network traffic analyzer
11 * By Gerald Combs <gerald@ethereal.com>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
41 #include <epan/packet.h>
42 #include "packet-dcerpc.h"
43 #include "packet-kerberos.h"
44 #include "packet-dcerpc-dce122.h"
46 static int proto_krb5rpc = -1;
48 static gint ett_krb5rpc = -1;
51 static e_uuid_t uuid_krb5rpc =
52 { 0x8f73de50, 0x768c, 0x11ca, {0xbf, 0xfc, 0x08, 0x00, 0x1e, 0x03, 0x94,
55 static guint16 ver_krb5rpc = 1;
56 static int hf_krb5rpc_sendto_kdc_rqst_keysize = -1;
57 static int hf_krb5rpc_sendto_kdc_rqst_spare1 = -1;
58 static int hf_krb5rpc_sendto_kdc_resp_len = -1;
59 static int hf_krb5rpc_sendto_kdc_resp_max = -1;
60 static int hf_krb5rpc_sendto_kdc_resp_spare1 = -1;
61 static int hf_krb5rpc_sendto_kdc_resp_keysize = -1;
62 static int hf_krb5rpc_sendto_kdc_resp_st = -1;
63 static int hf_krb5rpc_krb5 = -1;
64 static gint ett_krb5rpc_krb5 = -1;
67 krb5rpc_dissect_sendto_kdc_rqst (tvbuff_t * tvb, int offset,
68 packet_info * pinfo, proto_tree * tree,
71 guint32 keysize, spare1, remain;
79 * [in] unsigned32 len,
82 * [in] unsigned32 out_buf_len,
86 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
87 hf_krb5rpc_sendto_kdc_rqst_keysize, &keysize);
89 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
90 hf_krb5rpc_sendto_kdc_rqst_spare1, &spare1);
91 item = proto_tree_add_item (tree, hf_krb5rpc_krb5, tvb, offset, -1, TRUE);
92 subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
94 remain = tvb_length_remaining(tvb, offset);
95 krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
96 offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE);
104 krb5rpc_dissect_sendto_kdc_resp (tvbuff_t * tvb, int offset,
105 packet_info * pinfo, proto_tree * tree,
108 guint32 resp_len, maxsize, spare1, keysize, remain;
116 * [out] unsigned32 *resp_len,
117 * [out, length_is(*resp_len), size_is(out_buf_len)]
119 * [out] error_status_t *st unsigned long
124 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
125 hf_krb5rpc_sendto_kdc_resp_len, &resp_len);
127 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
128 hf_krb5rpc_sendto_kdc_resp_max, &maxsize);
130 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
131 hf_krb5rpc_sendto_kdc_resp_spare1, &spare1);
133 dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
134 hf_krb5rpc_sendto_kdc_resp_keysize, &keysize);
137 item = proto_tree_add_item (tree, hf_krb5rpc_krb5, tvb, offset, -1, TRUE);
138 subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
139 remain = tvb_length_remaining(tvb, offset);
140 krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
142 offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE);
143 offset += 16; /* no idea what this is, probably just extended encrypted text. */
149 static dcerpc_sub_dissector krb5rpc_dissectors[] = {
150 {0, "rsec_krb5rpc_sendto_kdc", krb5rpc_dissect_sendto_kdc_rqst,
151 krb5rpc_dissect_sendto_kdc_resp},
152 {0, NULL, NULL, NULL},
157 proto_register_krb5rpc (void)
159 static hf_register_info hf[] = {
160 {&hf_krb5rpc_sendto_kdc_rqst_keysize,
161 {"hf_krb5rpc_sendto_kdc_rqst_keysize",
162 "hf_krb5rpc_sendto_kdc_rqst_keysize", FT_UINT32, BASE_DEC, NULL, 0x0,
164 {&hf_krb5rpc_sendto_kdc_rqst_spare1,
165 {"hf_krb5rpc_sendto_kdc_rqst_spare1",
166 "hf_krb5rpc_sendto_kdc_rqst_spare1", FT_UINT32, BASE_DEC, NULL, 0x0, "",
168 {&hf_krb5rpc_sendto_kdc_resp_len,
169 {"hf_krb5rpc_sendto_kdc_resp_len", "hf_krb5rpc_sendto_kdc_resp_len",
170 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
171 {&hf_krb5rpc_sendto_kdc_resp_max,
172 {"hf_krb5rpc_sendto_kdc_resp_max", "hf_krb5rpc_sendto_kdc_resp_max",
173 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
174 {&hf_krb5rpc_sendto_kdc_resp_spare1,
175 {"hf_krb5rpc_sendto_kdc_resp_spare1",
176 "hf_krb5rpc_sendto_kdc_resp_spare1", FT_UINT32, BASE_DEC, NULL, 0x0, "",
178 {&hf_krb5rpc_sendto_kdc_resp_keysize,
179 {"hf_krb5rpc_sendto_kdc_resp_keysize",
180 "hf_krb5rpc_sendto_kdc_resp_keysize", FT_UINT32, BASE_DEC, NULL, 0x0,
182 {&hf_krb5rpc_sendto_kdc_resp_st,
183 {"hf_krb5rpc_sendto_kdc_resp_st", "hf_krb5rpc_sendto_kdc_resp_st",
184 FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL}},
186 {"hf_krb5rpc_krb5", "hf_krb5rpc_krb5", FT_BYTES, BASE_HEX, NULL, 0x0,
187 "krb5_blob", HFILL}},
191 static gint *ett[] = {
196 proto_register_protocol ("DCE/RPC Kerberos V", "KRB5RPC", "krb5rpc");
197 proto_register_field_array (proto_krb5rpc, hf, array_length (hf));
198 proto_register_subtree_array (ett, array_length (ett));
202 proto_reg_handoff_krb5rpc (void)
204 /* Register the protocol as dcerpc */
205 dcerpc_init_uuid (proto_krb5rpc, ett_krb5rpc, &uuid_krb5rpc, ver_krb5rpc,
206 krb5rpc_dissectors, -1);