xref: /freebsd/crypto/heimdal/lib/kadm5/kadm5-private.h (revision 1b6c76a2fe091c74f08427e6c870851025a9cf67)
1 /*
2  * Copyright (c) 2000 Kungliga Tekniska H�gskolan
3  * (Royal Institute of Technology, Stockholm, Sweden).
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the Institute nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 
34 /* $Id: kadm5-private.h,v 1.3 2000/07/24 04:31:17 assar Exp $ */
35 
36 #ifndef __kadm5_privatex_h__
37 #define __kadm5_privatex_h__
38 
39 kadm5_ret_t _kadm5_privs_to_string (u_int32_t, char*, size_t);
40 
41 kadm5_ret_t _kadm5_string_to_privs (const char*, u_int32_t*);
42 
43 HDB *_kadm5_s_get_db (void *);
44 
45 kadm5_ret_t
46 _kadm5_acl_check_permission __P((
47 	kadm5_server_context *context,
48 	unsigned op,
49 	krb5_const_principal princ));
50 
51 kadm5_ret_t
52 _kadm5_acl_init __P((kadm5_server_context *context));
53 
54 kadm5_ret_t
55 _kadm5_c_init_context __P((
56 	kadm5_client_context **ctx,
57 	kadm5_config_params *params,
58 	krb5_context context));
59 
60 kadm5_ret_t
61 _kadm5_client_recv __P((
62 	kadm5_client_context *context,
63 	krb5_data *reply));
64 
65 kadm5_ret_t
66 _kadm5_client_send __P((
67 	kadm5_client_context *context,
68 	krb5_storage *sp));
69 
70 kadm5_ret_t
71 _kadm5_connect __P((void*));
72 
73 kadm5_ret_t
74 _kadm5_error_code __P((kadm5_ret_t code));
75 
76 kadm5_ret_t
77 _kadm5_s_init_context __P((
78 	kadm5_server_context **ctx,
79 	kadm5_config_params *params,
80 	krb5_context context));
81 
82 kadm5_ret_t
83 _kadm5_set_keys __P((
84 	kadm5_server_context *context,
85 	hdb_entry *ent,
86 	const char *password));
87 
88 kadm5_ret_t
89 _kadm5_set_keys2 __P((
90 	kadm5_server_context *context,
91 	hdb_entry *ent,
92 	int16_t n_key_data,
93 	krb5_key_data *key_data));
94 
95 kadm5_ret_t
96 _kadm5_set_keys3 __P((
97 	kadm5_server_context *context,
98 	hdb_entry *ent,
99 	int n_keys,
100 	krb5_keyblock *keyblocks));
101 
102 kadm5_ret_t
103 _kadm5_set_keys_randomly __P((kadm5_server_context *context,
104 			      hdb_entry *ent,
105 			      krb5_keyblock **new_keys,
106 			      int *n_keys));
107 
108 kadm5_ret_t
109 _kadm5_set_modifier __P((
110 	kadm5_server_context *context,
111 	hdb_entry *ent));
112 
113 kadm5_ret_t
114 _kadm5_bump_pw_expire __P((kadm5_server_context *context,
115 			   hdb_entry *ent));
116 
117 kadm5_ret_t
118 _kadm5_setup_entry __P((
119 	kadm5_server_context *context,
120 	hdb_entry *ent,
121 	u_int32_t mask,
122 	kadm5_principal_ent_t princ,
123 	u_int32_t princ_mask,
124 	kadm5_principal_ent_t def,
125 	u_int32_t def_mask));
126 
127 kadm5_ret_t
128 kadm5_log_get_version_fd (int fd, u_int32_t *ver);
129 
130 kadm5_ret_t
131 kadm5_log_get_version (kadm5_server_context *context, u_int32_t *ver);
132 
133 kadm5_ret_t
134 kadm5_log_set_version (kadm5_server_context *context, u_int32_t vno);
135 
136 kadm5_ret_t
137 kadm5_log_init (kadm5_server_context *context);
138 
139 kadm5_ret_t
140 kadm5_log_reinit (kadm5_server_context *context);
141 
142 kadm5_ret_t
143 kadm5_log_create (kadm5_server_context *context,
144 		  hdb_entry *ent);
145 
146 kadm5_ret_t
147 kadm5_log_delete (kadm5_server_context *context,
148 		  krb5_principal princ);
149 
150 kadm5_ret_t
151 kadm5_log_rename (kadm5_server_context *context,
152 		  krb5_principal source,
153 		  hdb_entry *ent);
154 
155 kadm5_ret_t
156 kadm5_log_modify (kadm5_server_context *context,
157 		  hdb_entry *ent,
158 		  u_int32_t mask);
159 
160 kadm5_ret_t
161 kadm5_log_nop (kadm5_server_context *context);
162 
163 kadm5_ret_t
164 kadm5_log_end (kadm5_server_context *context);
165 
166 kadm5_ret_t
167 kadm5_log_foreach (kadm5_server_context *context,
168 		   void (*func)(kadm5_server_context *server_context,
169 				u_int32_t ver,
170 				time_t timestamp,
171 				enum kadm_ops op,
172 				u_int32_t len,
173 				krb5_storage *sp));
174 
175 kadm5_ret_t
176 kadm5_log_replay_create (kadm5_server_context *context,
177 			 u_int32_t ver,
178 			 u_int32_t len,
179 			 krb5_storage *sp);
180 
181 kadm5_ret_t
182 kadm5_log_replay_delete (kadm5_server_context *context,
183 			 u_int32_t ver,
184 			 u_int32_t len,
185 			 krb5_storage *sp);
186 
187 kadm5_ret_t
188 kadm5_log_replay_rename (kadm5_server_context *context,
189 			 u_int32_t ver,
190 			 u_int32_t len,
191 			 krb5_storage *sp);
192 
193 kadm5_ret_t
194 kadm5_log_replay_modify (kadm5_server_context *context,
195 			 u_int32_t ver,
196 			 u_int32_t len,
197 			 krb5_storage *sp);
198 
199 kadm5_ret_t
200 kadm5_log_replay_nop (kadm5_server_context *context,
201 		      u_int32_t ver,
202 		      u_int32_t len,
203 		      krb5_storage *sp);
204 
205 kadm5_ret_t
206 kadm5_log_replay (kadm5_server_context *context,
207 		  enum kadm_ops op,
208 		  u_int32_t ver,
209 		  u_int32_t len,
210 		  krb5_storage *sp);
211 
212 krb5_storage *
213 kadm5_log_goto_end (int fd);
214 
215 kadm5_ret_t
216 kadm5_log_previous (krb5_storage *sp,
217 		    u_int32_t *ver,
218 		    time_t *timestamp,
219 		    enum kadm_ops *op,
220 		    u_int32_t *len);
221 
222 kadm5_ret_t
223 kadm5_log_truncate (kadm5_server_context *server_context);
224 
225 kadm5_ret_t
226 _kadm5_marshal_params __P((krb5_context context,
227 			   kadm5_config_params *params,
228 			   krb5_data *out));
229 
230 kadm5_ret_t
231 _kadm5_unmarshal_params __P((krb5_context context,
232 			     krb5_data *in,
233 			     kadm5_config_params *params));
234 
235 void
236 _kadm5_free_keys (kadm5_server_context *context,
237 		  int len, Key *keys);
238 
239 void
240 _kadm5_init_keys (Key *keys, int len);
241 
242 int
243 _kadm5_cmp_keys(Key *keys1, int len1, Key *keys2, int len2);
244 
245 #endif /* __kadm5_privatex_h__ */
246