xref: /freebsd/crypto/heimdal/lib/kadm5/kadm5-protos.h (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
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-protos.h,v 1.2 2000/07/22 05:52:01 assar Exp $ */
35 
36 #ifndef __kadm5_protos_h__
37 #define __kadm5_protos_h__
38 
39 kadm5_ret_t
40 kadm5_c_chpass_principal __P((
41 	void *server_handle,
42 	krb5_principal princ,
43 	char *password));
44 
45 kadm5_ret_t
46 kadm5_c_chpass_principal_with_key __P((
47 	void *server_handle,
48 	krb5_principal princ,
49 	int n_key_data,
50 	krb5_key_data *key_data));
51 
52 kadm5_ret_t
53 kadm5_c_create_principal __P((
54 	void *server_handle,
55 	kadm5_principal_ent_t princ,
56 	u_int32_t mask,
57 	char *password));
58 
59 kadm5_ret_t
60 kadm5_c_delete_principal __P((
61 	void *server_handle,
62 	krb5_principal princ));
63 
64 kadm5_ret_t
65 kadm5_c_destroy __P((void *server_handle));
66 
67 kadm5_ret_t
68 kadm5_c_flush __P((void *server_handle));
69 
70 kadm5_ret_t
71 kadm5_c_get_principal __P((
72 	void *server_handle,
73 	krb5_principal princ,
74 	kadm5_principal_ent_t out,
75 	u_int32_t mask));
76 
77 kadm5_ret_t
78 kadm5_c_get_principals __P((
79 	void *server_handle,
80 	const char *exp,
81 	char ***princs,
82 	int *count));
83 
84 kadm5_ret_t
85 kadm5_c_get_privs __P((
86 	void *server_handle,
87 	u_int32_t *privs));
88 
89 kadm5_ret_t
90 kadm5_c_init_with_creds __P((
91 	const char *client_name,
92 	krb5_ccache ccache,
93 	const char *service_name,
94 	kadm5_config_params *realm_params,
95 	unsigned long struct_version,
96 	unsigned long api_version,
97 	void **server_handle));
98 
99 kadm5_ret_t
100 kadm5_c_init_with_creds_ctx __P((
101 	krb5_context context,
102 	const char *client_name,
103 	krb5_ccache ccache,
104 	const char *service_name,
105 	kadm5_config_params *realm_params,
106 	unsigned long struct_version,
107 	unsigned long api_version,
108 	void **server_handle));
109 
110 kadm5_ret_t
111 kadm5_c_init_with_password __P((
112 	const char *client_name,
113 	const char *password,
114 	const char *service_name,
115 	kadm5_config_params *realm_params,
116 	unsigned long struct_version,
117 	unsigned long api_version,
118 	void **server_handle));
119 
120 kadm5_ret_t
121 kadm5_c_init_with_password_ctx __P((
122 	krb5_context context,
123 	const char *client_name,
124 	const char *password,
125 	const char *service_name,
126 	kadm5_config_params *realm_params,
127 	unsigned long struct_version,
128 	unsigned long api_version,
129 	void **server_handle));
130 
131 kadm5_ret_t
132 kadm5_c_init_with_skey __P((
133 	const char *client_name,
134 	const char *keytab,
135 	const char *service_name,
136 	kadm5_config_params *realm_params,
137 	unsigned long struct_version,
138 	unsigned long api_version,
139 	void **server_handle));
140 
141 kadm5_ret_t
142 kadm5_c_init_with_skey_ctx __P((
143 	krb5_context context,
144 	const char *client_name,
145 	const char *keytab,
146 	const char *service_name,
147 	kadm5_config_params *realm_params,
148 	unsigned long struct_version,
149 	unsigned long api_version,
150 	void **server_handle));
151 
152 kadm5_ret_t
153 kadm5_c_modify_principal __P((
154 	void *server_handle,
155 	kadm5_principal_ent_t princ,
156 	u_int32_t mask));
157 
158 kadm5_ret_t
159 kadm5_c_randkey_principal __P((
160 	void *server_handle,
161 	krb5_principal princ,
162 	krb5_keyblock **new_keys,
163 	int *n_keys));
164 
165 kadm5_ret_t
166 kadm5_c_rename_principal __P((
167 	void *server_handle,
168 	krb5_principal source,
169 	krb5_principal target));
170 
171 kadm5_ret_t
172 kadm5_chpass_principal __P((
173 	void *server_handle,
174 	krb5_principal princ,
175 	char *password));
176 
177 kadm5_ret_t
178 kadm5_chpass_principal_with_key __P((
179 	void *server_handle,
180 	krb5_principal princ,
181 	int n_key_data,
182 	krb5_key_data *key_data));
183 
184 kadm5_ret_t
185 kadm5_create_principal __P((
186 	void *server_handle,
187 	kadm5_principal_ent_t princ,
188 	u_int32_t mask,
189 	char *password));
190 
191 kadm5_ret_t
192 kadm5_delete_principal __P((
193 	void *server_handle,
194 	krb5_principal princ));
195 
196 kadm5_ret_t
197 kadm5_destroy __P((void *server_handle));
198 
199 kadm5_ret_t
200 kadm5_flush __P((void *server_handle));
201 
202 void
203 kadm5_free_key_data __P((
204 	void *server_handle,
205 	int16_t *n_key_data,
206 	krb5_key_data *key_data));
207 
208 void
209 kadm5_free_name_list __P((
210 	void *server_handle,
211 	char **names,
212 	int *count));
213 
214 void
215 kadm5_free_principal_ent __P((
216 	void *server_handle,
217 	kadm5_principal_ent_t princ));
218 
219 kadm5_ret_t
220 kadm5_get_principal __P((
221 	void *server_handle,
222 	krb5_principal princ,
223 	kadm5_principal_ent_t out,
224 	u_int32_t mask));
225 
226 kadm5_ret_t
227 kadm5_get_principals __P((
228 	void *server_handle,
229 	const char *exp,
230 	char ***princs,
231 	int *count));
232 
233 kadm5_ret_t
234 kadm5_get_privs __P((
235 	void *server_handle,
236 	u_int32_t *privs));
237 
238 kadm5_ret_t
239 kadm5_init_with_creds __P((
240 	const char *client_name,
241 	krb5_ccache ccache,
242 	const char *service_name,
243 	kadm5_config_params *realm_params,
244 	unsigned long struct_version,
245 	unsigned long api_version,
246 	void **server_handle));
247 
248 kadm5_ret_t
249 kadm5_init_with_creds_ctx __P((
250 	krb5_context context,
251 	const char *client_name,
252 	krb5_ccache ccache,
253 	const char *service_name,
254 	kadm5_config_params *realm_params,
255 	unsigned long struct_version,
256 	unsigned long api_version,
257 	void **server_handle));
258 
259 kadm5_ret_t
260 kadm5_init_with_password __P((
261 	const char *client_name,
262 	const char *password,
263 	const char *service_name,
264 	kadm5_config_params *realm_params,
265 	unsigned long struct_version,
266 	unsigned long api_version,
267 	void **server_handle));
268 
269 kadm5_ret_t
270 kadm5_init_with_password_ctx __P((
271 	krb5_context context,
272 	const char *client_name,
273 	const char *password,
274 	const char *service_name,
275 	kadm5_config_params *realm_params,
276 	unsigned long struct_version,
277 	unsigned long api_version,
278 	void **server_handle));
279 
280 kadm5_ret_t
281 kadm5_init_with_skey __P((
282 	const char *client_name,
283 	const char *keytab,
284 	const char *service_name,
285 	kadm5_config_params *realm_params,
286 	unsigned long struct_version,
287 	unsigned long api_version,
288 	void **server_handle));
289 
290 kadm5_ret_t
291 kadm5_init_with_skey_ctx __P((
292 	krb5_context context,
293 	const char *client_name,
294 	const char *keytab,
295 	const char *service_name,
296 	kadm5_config_params *realm_params,
297 	unsigned long struct_version,
298 	unsigned long api_version,
299 	void **server_handle));
300 
301 kadm5_ret_t
302 kadm5_modify_principal __P((
303 	void *server_handle,
304 	kadm5_principal_ent_t princ,
305 	u_int32_t mask));
306 
307 kadm5_ret_t
308 kadm5_randkey_principal __P((
309 	void *server_handle,
310 	krb5_principal princ,
311 	krb5_keyblock **new_keys,
312 	int *n_keys));
313 
314 kadm5_ret_t
315 kadm5_rename_principal __P((
316 	void *server_handle,
317 	krb5_principal source,
318 	krb5_principal target));
319 
320 kadm5_ret_t
321 kadm5_ret_key_data __P((
322 	krb5_storage *sp,
323 	krb5_key_data *key));
324 
325 kadm5_ret_t
326 kadm5_ret_principal_ent __P((
327 	krb5_storage *sp,
328 	kadm5_principal_ent_t princ));
329 
330 kadm5_ret_t
331 kadm5_ret_principal_ent_mask __P((
332 	krb5_storage *sp,
333 	kadm5_principal_ent_t princ,
334 	u_int32_t *mask));
335 
336 kadm5_ret_t
337 kadm5_ret_tl_data __P((
338 	krb5_storage *sp,
339 	krb5_tl_data *tl));
340 
341 kadm5_ret_t
342 kadm5_s_chpass_principal __P((
343 	void *server_handle,
344 	krb5_principal princ,
345 	char *password));
346 
347 kadm5_ret_t
348 kadm5_s_chpass_principal_cond __P((
349 	void *server_handle,
350 	krb5_principal princ,
351 	char *password));
352 
353 kadm5_ret_t
354 kadm5_s_chpass_principal_with_key __P((
355 	void *server_handle,
356 	krb5_principal princ,
357 	int n_key_data,
358 	krb5_key_data *key_data));
359 
360 kadm5_ret_t
361 kadm5_s_create_principal __P((
362 	void *server_handle,
363 	kadm5_principal_ent_t princ,
364 	u_int32_t mask,
365 	char *password));
366 
367 kadm5_ret_t
368 kadm5_s_create_principal_with_key __P((
369 	void *server_handle,
370 	kadm5_principal_ent_t princ,
371 	u_int32_t mask));
372 
373 kadm5_ret_t
374 kadm5_s_delete_principal __P((
375 	void *server_handle,
376 	krb5_principal princ));
377 
378 kadm5_ret_t
379 kadm5_s_destroy __P((void *server_handle));
380 
381 kadm5_ret_t
382 kadm5_s_flush __P((void *server_handle));
383 
384 kadm5_ret_t
385 kadm5_s_get_principal __P((
386 	void *server_handle,
387 	krb5_principal princ,
388 	kadm5_principal_ent_t out,
389 	u_int32_t mask));
390 
391 kadm5_ret_t
392 kadm5_s_get_principals __P((
393 	void *server_handle,
394 	const char *exp,
395 	char ***princs,
396 	int *count));
397 
398 kadm5_ret_t
399 kadm5_s_get_privs __P((
400 	void *server_handle,
401 	u_int32_t *privs));
402 
403 kadm5_ret_t
404 kadm5_s_init_with_creds __P((
405 	const char *client_name,
406 	krb5_ccache ccache,
407 	const char *service_name,
408 	kadm5_config_params *realm_params,
409 	unsigned long struct_version,
410 	unsigned long api_version,
411 	void **server_handle));
412 
413 kadm5_ret_t
414 kadm5_s_init_with_creds_ctx __P((
415 	krb5_context context,
416 	const char *client_name,
417 	krb5_ccache ccache,
418 	const char *service_name,
419 	kadm5_config_params *realm_params,
420 	unsigned long struct_version,
421 	unsigned long api_version,
422 	void **server_handle));
423 
424 kadm5_ret_t
425 kadm5_s_init_with_password __P((
426 	const char *client_name,
427 	const char *password,
428 	const char *service_name,
429 	kadm5_config_params *realm_params,
430 	unsigned long struct_version,
431 	unsigned long api_version,
432 	void **server_handle));
433 
434 kadm5_ret_t
435 kadm5_s_init_with_password_ctx __P((
436 	krb5_context context,
437 	const char *client_name,
438 	const char *password,
439 	const char *service_name,
440 	kadm5_config_params *realm_params,
441 	unsigned long struct_version,
442 	unsigned long api_version,
443 	void **server_handle));
444 
445 kadm5_ret_t
446 kadm5_s_init_with_skey __P((
447 	const char *client_name,
448 	const char *keytab,
449 	const char *service_name,
450 	kadm5_config_params *realm_params,
451 	unsigned long struct_version,
452 	unsigned long api_version,
453 	void **server_handle));
454 
455 kadm5_ret_t
456 kadm5_s_init_with_skey_ctx __P((
457 	krb5_context context,
458 	const char *client_name,
459 	const char *keytab,
460 	const char *service_name,
461 	kadm5_config_params *realm_params,
462 	unsigned long struct_version,
463 	unsigned long api_version,
464 	void **server_handle));
465 
466 kadm5_ret_t
467 kadm5_s_modify_principal __P((
468 	void *server_handle,
469 	kadm5_principal_ent_t princ,
470 	u_int32_t mask));
471 
472 kadm5_ret_t
473 kadm5_s_randkey_principal __P((
474 	void *server_handle,
475 	krb5_principal princ,
476 	krb5_keyblock **new_keys,
477 	int *n_keys));
478 
479 kadm5_ret_t
480 kadm5_s_rename_principal __P((
481 	void *server_handle,
482 	krb5_principal source,
483 	krb5_principal target));
484 
485 kadm5_ret_t
486 kadm5_store_key_data __P((
487 	krb5_storage *sp,
488 	krb5_key_data *key));
489 
490 kadm5_ret_t
491 kadm5_store_principal_ent __P((
492 	krb5_storage *sp,
493 	kadm5_principal_ent_t princ));
494 
495 kadm5_ret_t
496 kadm5_store_principal_ent_mask __P((
497 	krb5_storage *sp,
498 	kadm5_principal_ent_t princ,
499 	u_int32_t mask));
500 
501 kadm5_ret_t
502 kadm5_store_tl_data __P((
503 	krb5_storage *sp,
504 	krb5_tl_data *tl));
505 
506 void
507 kadm5_setup_passwd_quality_check(krb5_context context,
508 				 const char *check_library,
509 				 const char *check_function);
510 
511 const char *
512 kadm5_check_password_quality (krb5_context context,
513 			      krb5_principal principal,
514 			      krb5_data *pwd_data);
515 
516 #endif /* __kadm5_protos_h__ */
517