summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-kadm5.c
blob: 2a1e3bbabde16d81621738191ec6be04c01124fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/* packet-kadm5.c
 * Routines for kadm5 dissection
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

/*
 * The kadm5 RPC protocol is used to administer Kerberos principals
 * and policies.  It is not officially documented anywhere.  The
 * information for this dissector came from the MIT kadmin source.
 */

#include "config.h"

#include "packet-rpc.h"

void proto_register_kadm5(void);
void proto_reg_handoff_kadm5(void);

#define KADM5_PROGRAM			2112
#define KADM5PROC_NULL			 0
#define KADM5PROC_CREATE_PRINCIPAL	 1
#define KADM5PROC_DELETE_PRINCIPAL	 2
#define KADM5PROC_MODIFY_PRINCIPAL	 3
#define KADM5PROC_RENAME_PRINCIPAL	 4
#define KADM5PROC_GET_PRINCIPAL		 5
#define KADM5PROC_CHPASS_PRINCIPAL	 6
#define KADM5PROC_CHRAND_PRINCIPAL	 7
#define KADM5PROC_CREATE_POLICY		 8
#define KADM5PROC_DELETE_POLICY		 9
#define KADM5PROC_MODIFY_POLICY		10
#define KADM5PROC_GET_POLICY		11
#define KADM5PROC_GET_PRIVS		12
#define KADM5PROC_INIT			13
#define KADM5PROC_GET_PRINCS		14
#define KADM5PROC_GET_POLS		15
#define KADM5PROC_SETKEY_PRINCIPAL	16
#define KADM5PROC_SETV4KEY_PRINCIPAL	17
#define KADM5PROC_CREATE_PRINCIPAL3	18
#define KADM5PROC_CHPASS_PRINCIPAL3	19
#define KADM5PROC_CHRAND_PRINCIPAL3	20
#define KADM5PROC_SETKEY_PRINCIPAL3	21

static int proto_kadm5 = -1;
static int hf_kadm5_procedure_v2 = -1;
static gint ett_kadm5 = -1;

/* proc number, "proc name", dissect_request, dissect_reply */
static const vsff kadm5_v2_proc[] = {
	{ KADM5PROC_NULL,	 	"NULL",			dissect_rpc_void,	dissect_rpc_void },
	{ KADM5PROC_CREATE_PRINCIPAL,	"CREATE_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_DELETE_PRINCIPAL,	"DELETE_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_MODIFY_PRINCIPAL,	"MODIFY_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_RENAME_PRINCIPAL,	"RENAME_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_GET_PRINCIPAL,	"GET_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CHPASS_PRINCIPAL,	"CHPASS_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CHRAND_PRINCIPAL,	"CHRAND_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CREATE_POLICY,	"CREATE_POLICY",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_DELETE_POLICY,	"DELETE_POLICY",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_MODIFY_POLICY,	"MODIFY_POLICY",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_GET_POLICY,		"GET_POLICY",		dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_GET_PRIVS,		"GET_PRIVS",		dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_INIT,		"INIT",			dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_GET_PRINCS,		"GET_PRINCS",		dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_GET_POLS,		"GET_POLS",		dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_SETKEY_PRINCIPAL,	"SETKEY_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_SETV4KEY_PRINCIPAL,	"SETV4KEY_PRINCIPAL",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CREATE_PRINCIPAL3,	"CREATE_PRINCIPAL3",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CHPASS_PRINCIPAL3,	"CHPASS_PRINCIPAL3",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_CHRAND_PRINCIPAL3,	"CHRAND_PRINCIPAL3",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ KADM5PROC_SETKEY_PRINCIPAL3,	"SETKEY_PRINCIPAL3",	dissect_rpc_unknown,	dissect_rpc_unknown },
	{ 0,				 NULL,			NULL,	NULL }
};

static const value_string kadm5_v2_proc_vals[] = {
	{ KADM5PROC_NULL,	 	"NULL" },
	{ KADM5PROC_CREATE_PRINCIPAL,	"CREATE_PRINCIPAL" },
	{ KADM5PROC_DELETE_PRINCIPAL,	"DELETE_PRINCIPAL" },
	{ KADM5PROC_MODIFY_PRINCIPAL,	"MODIFY_PRINCIPAL" },
	{ KADM5PROC_RENAME_PRINCIPAL,	"RENAME_PRINCIPAL" },
	{ KADM5PROC_GET_PRINCIPAL,	"GET_PRINCIPAL" },
	{ KADM5PROC_CHPASS_PRINCIPAL,	"CHPASS_PRINCIPAL" },
	{ KADM5PROC_CHRAND_PRINCIPAL,	"CHRAND_PRINCIPAL" },
	{ KADM5PROC_CREATE_POLICY,	"CREATE_POLICY" },
	{ KADM5PROC_DELETE_POLICY,	"DELETE_POLICY" },
	{ KADM5PROC_MODIFY_POLICY,	"MODIFY_POLICY" },
	{ KADM5PROC_GET_POLICY,		"GET_POLICY" },
	{ KADM5PROC_GET_PRIVS,		"GET_PRIVS" },
	{ KADM5PROC_INIT,		"INIT" },
	{ KADM5PROC_GET_PRINCS,		"GET_PRINCS" },
	{ KADM5PROC_GET_POLS,		"GET_POLS" },
	{ KADM5PROC_SETKEY_PRINCIPAL,	"SETKEY_PRINCIPAL" },
	{ KADM5PROC_SETV4KEY_PRINCIPAL,	"SETV4KEY_PRINCIPAL" },
	{ KADM5PROC_CREATE_PRINCIPAL3,	"CREATE_PRINCIPAL3" },
	{ KADM5PROC_CHPASS_PRINCIPAL3,	"CHPASS_PRINCIPAL3" },
	{ KADM5PROC_CHRAND_PRINCIPAL3,	"CHRAND_PRINCIPAL3" },
	{ KADM5PROC_SETKEY_PRINCIPAL3,	"SETKEY_PRINCIPAL3" },
	{ 0,				 NULL }
};

static const rpc_prog_vers_info kadm5_vers_info[] = {
	{ 2, kadm5_v2_proc, &hf_kadm5_procedure_v2 },
};

void
proto_register_kadm5(void)
{
	static hf_register_info hf[] = {
		{ &hf_kadm5_procedure_v2, {
		    "V2 Procedure", "kadm5.procedure_v2", FT_UINT32, BASE_DEC,
		    VALS(kadm5_v2_proc_vals), 0, NULL, HFILL }},
	};

	static gint *ett[] = {
		&ett_kadm5,
	};

	proto_kadm5 = proto_register_protocol("Kerberos Administration",
	    "KADM5", "kadm5");
	proto_register_field_array(proto_kadm5, hf, array_length(hf));
	proto_register_subtree_array(ett, array_length(ett));
}

void
proto_reg_handoff_kadm5(void)
{
	/* Register the protocol as RPC */
	rpc_init_prog(proto_kadm5, KADM5_PROGRAM, ett_kadm5,
	    G_N_ELEMENTS(kadm5_vers_info), kadm5_vers_info);
}

/*
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: t
 * End:
 *
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
 * :indentSize=8:tabSize=8:noTabs=false:
 */