1/* This is a generated file */
2#ifndef __hdb_protos_h__
3#define __hdb_protos_h__
4#ifndef DOXY
5
6#include <stdarg.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12krb5_error_code
13entry2mit_string_int (
14 krb5_context /*context*/,
15 krb5_storage */*sp*/,
16 hdb_entry */*ent*/);
17
18/**
19 * This function adds an HDB entry's current keyset to the entry's key
20 * history. The current keyset is left alone; the caller is responsible
21 * for freeing it.
22 *
23 * @param context Context
24 * @param entry HDB entry
25 */
26
27krb5_error_code
28hdb_add_current_keys_to_history (
29 krb5_context /*context*/,
30 hdb_entry */*entry*/);
31
32/**
33 * This function adds a key to an HDB entry's key history.
34 *
35 * @param context Context
36 * @param entry HDB entry
37 * @param kvno Key version number of the key to add to the history
38 * @param key The Key to add
39 */
40
41krb5_error_code
42hdb_add_history_key (
43 krb5_context /*context*/,
44 hdb_entry */*entry*/,
45 krb5_kvno /*kvno*/,
46 Key */*key*/);
47
48krb5_error_code
49hdb_add_master_key (
50 krb5_context /*context*/,
51 krb5_keyblock */*key*/,
52 hdb_master_key */*inout*/);
53
54/**
55 * This function changes an hdb_entry's kvno, swapping the current key
56 * set with a historical keyset. If no historical keys are found then
57 * an error is returned (the caller can still set entry->kvno directly).
58 *
59 * @param context krb5_context
60 * @param new_kvno New kvno for the entry
61 * @param entry hdb_entry to modify
62 */
63
64krb5_error_code
65hdb_change_kvno (
66 krb5_context /*context*/,
67 krb5_kvno /*new_kvno*/,
68 hdb_entry */*entry*/);
69
70krb5_error_code
71hdb_check_db_format (
72 krb5_context /*context*/,
73 HDB */*db*/);
74
75krb5_error_code
76hdb_clear_extension (
77 krb5_context /*context*/,
78 hdb_entry */*entry*/,
79 int /*type*/);
80
81krb5_error_code
82hdb_clear_master_key (
83 krb5_context /*context*/,
84 HDB */*db*/);
85
86/**
87 * Create a handle for a Kerberos database
88 *
89 * Create a handle for a Kerberos database backend specified by a
90 * filename. Doesn't create a file if its doesn't exists, you have to
91 * use O_CREAT to tell the backend to create the file.
92 */
93
94krb5_error_code
95hdb_create (
96 krb5_context /*context*/,
97 HDB **/*db*/,
98 const char */*filename*/);
99
100krb5_error_code
101hdb_db1_create (
102 krb5_context /*context*/,
103 HDB **/*db*/,
104 const char */*filename*/);
105
106krb5_error_code
107hdb_db3_create (
108 krb5_context /*context*/,
109 HDB **/*db*/,
110 const char */*filename*/);
111
112/**
113 * Return the directory where the hdb database resides.
114 *
115 * @param context Kerberos 5 context.
116 *
117 * @return string pointing to directory.
118 */
119
120const char *
121hdb_db_dir (krb5_context /*context*/);
122
123const char *
124hdb_dbinfo_get_acl_file (
125 krb5_context /*context*/,
126 struct hdb_dbinfo */*dbp*/);
127
128const krb5_config_binding *
129hdb_dbinfo_get_binding (
130 krb5_context /*context*/,
131 struct hdb_dbinfo */*dbp*/);
132
133const char *
134hdb_dbinfo_get_dbname (
135 krb5_context /*context*/,
136 struct hdb_dbinfo */*dbp*/);
137
138const char *
139hdb_dbinfo_get_label (
140 krb5_context /*context*/,
141 struct hdb_dbinfo */*dbp*/);
142
143const char *
144hdb_dbinfo_get_log_file (
145 krb5_context /*context*/,
146 struct hdb_dbinfo */*dbp*/);
147
148const char *
149hdb_dbinfo_get_mkey_file (
150 krb5_context /*context*/,
151 struct hdb_dbinfo */*dbp*/);
152
153struct hdb_dbinfo *
154hdb_dbinfo_get_next (
155 struct hdb_dbinfo */*dbp*/,
156 struct hdb_dbinfo */*dbprevp*/);
157
158const char *
159hdb_dbinfo_get_realm (
160 krb5_context /*context*/,
161 struct hdb_dbinfo */*dbp*/);
162
163/**
164 * Return the default hdb database resides.
165 *
166 * @param context Kerberos 5 context.
167 *
168 * @return string pointing to directory.
169 */
170
171const char *
172hdb_default_db (krb5_context /*context*/);
173
174krb5_error_code
175hdb_enctype2key (
176 krb5_context /*context*/,
177 hdb_entry */*e*/,
178 const Keys */*keyset*/,
179 krb5_enctype /*enctype*/,
180 Key **/*key*/);
181
182krb5_error_code
183hdb_entry2string (
184 krb5_context /*context*/,
185 hdb_entry */*ent*/,
186 char **/*str*/);
187
188int
189hdb_entry2value (
190 krb5_context /*context*/,
191 const hdb_entry */*ent*/,
192 krb5_data */*value*/);
193
194int
195hdb_entry_alias2value (
196 krb5_context /*context*/,
197 const hdb_entry_alias */*alias*/,
198 krb5_data */*value*/);
199
200krb5_error_code
201hdb_entry_check_mandatory (
202 krb5_context /*context*/,
203 const hdb_entry */*ent*/);
204
205krb5_error_code
206hdb_entry_clear_kvno_diff_clnt (
207 krb5_context /*context*/,
208 hdb_entry */*entry*/);
209
210krb5_error_code
211hdb_entry_clear_kvno_diff_svc (
212 krb5_context /*context*/,
213 hdb_entry */*entry*/);
214
215int
216hdb_entry_clear_password (
217 krb5_context /*context*/,
218 hdb_entry */*entry*/);
219
220krb5_error_code
221hdb_entry_get_ConstrainedDelegACL (
222 const hdb_entry */*entry*/,
223 const HDB_Ext_Constrained_delegation_acl **/*a*/);
224
225krb5_error_code
226hdb_entry_get_aliases (
227 const hdb_entry */*entry*/,
228 const HDB_Ext_Aliases **/*a*/);
229
230unsigned int
231hdb_entry_get_kvno_diff_clnt (const hdb_entry */*entry*/);
232
233unsigned int
234hdb_entry_get_kvno_diff_svc (const hdb_entry */*entry*/);
235
236int
237hdb_entry_get_password (
238 krb5_context /*context*/,
239 HDB */*db*/,
240 const hdb_entry */*entry*/,
241 char **/*p*/);
242
243krb5_error_code
244hdb_entry_get_pkinit_acl (
245 const hdb_entry */*entry*/,
246 const HDB_Ext_PKINIT_acl **/*a*/);
247
248krb5_error_code
249hdb_entry_get_pkinit_cert (
250 const hdb_entry */*entry*/,
251 const HDB_Ext_PKINIT_cert **/*a*/);
252
253krb5_error_code
254hdb_entry_get_pkinit_hash (
255 const hdb_entry */*entry*/,
256 const HDB_Ext_PKINIT_hash **/*a*/);
257
258krb5_error_code
259hdb_entry_get_pw_change_time (
260 const hdb_entry */*entry*/,
261 time_t */*t*/);
262
263krb5_error_code
264hdb_entry_set_kvno_diff_clnt (
265 krb5_context /*context*/,
266 hdb_entry */*entry*/,
267 unsigned int /*diff*/);
268
269krb5_error_code
270hdb_entry_set_kvno_diff_svc (
271 krb5_context /*context*/,
272 hdb_entry */*entry*/,
273 unsigned int /*diff*/);
274
275int
276hdb_entry_set_password (
277 krb5_context /*context*/,
278 HDB */*db*/,
279 hdb_entry */*entry*/,
280 const char */*p*/);
281
282krb5_error_code
283hdb_entry_set_pw_change_time (
284 krb5_context /*context*/,
285 hdb_entry */*entry*/,
286 time_t /*t*/);
287
288HDB_extension *
289hdb_find_extension (
290 const hdb_entry */*entry*/,
291 int /*type*/);
292
293krb5_error_code
294hdb_foreach (
295 krb5_context /*context*/,
296 HDB */*db*/,
297 unsigned /*flags*/,
298 hdb_foreach_func_t /*func*/,
299 void */*data*/);
300
301void
302hdb_free_dbinfo (
303 krb5_context /*context*/,
304 struct hdb_dbinfo **/*dbp*/);
305
306void
307hdb_free_entry (
308 krb5_context /*context*/,
309 hdb_entry_ex */*ent*/);
310
311void
312hdb_free_key (Key */*key*/);
313
314void
315hdb_free_keys (
316 krb5_context /*context*/,
317 int /*len*/,
318 Key */*keys*/);
319
320void
321hdb_free_master_key (
322 krb5_context /*context*/,
323 hdb_master_key /*mkey*/);
324
325krb5_error_code
326hdb_generate_key_set (
327 krb5_context /*context*/,
328 krb5_principal /*principal*/,
329 krb5_key_salt_tuple */*ks_tuple*/,
330 int /*n_ks_tuple*/,
331 Key **/*ret_key_set*/,
332 size_t */*nkeyset*/,
333 int /*no_salt*/);
334
335krb5_error_code
336hdb_generate_key_set_password (
337 krb5_context /*context*/,
338 krb5_principal /*principal*/,
339 const char */*password*/,
340 krb5_key_salt_tuple */*ks_tuple*/,
341 int /*n_ks_tuple*/,
342 Key **/*keys*/,
343 size_t */*num_keys*/);
344
345int
346hdb_get_dbinfo (
347 krb5_context /*context*/,
348 struct hdb_dbinfo **/*dbp*/);
349
350krb5_error_code
351hdb_init_db (
352 krb5_context /*context*/,
353 HDB */*db*/);
354
355int
356hdb_key2principal (
357 krb5_context /*context*/,
358 krb5_data */*key*/,
359 krb5_principal /*p*/);
360
361krb5_error_code
362hdb_keytab_create (
363 krb5_context /*context*/,
364 HDB ** /*db*/,
365 const char */*arg*/);
366
367const Keys *
368hdb_kvno2keys (
369 krb5_context /*context*/,
370 const hdb_entry */*e*/,
371 krb5_kvno /*kvno*/);
372
373krb5_error_code
374hdb_ldap_create (
375 krb5_context /*context*/,
376 HDB ** /*db*/,
377 const char */*arg*/);
378
379krb5_error_code
380hdb_ldapi_create (
381 krb5_context /*context*/,
382 HDB ** /*db*/,
383 const char */*arg*/);
384
385krb5_error_code
386hdb_list_builtin (
387 krb5_context /*context*/,
388 char **/*list*/);
389
390krb5_error_code
391hdb_lock (
392 int /*fd*/,
393 int /*operation*/);
394
395krb5_error_code
396hdb_mdb_create (
397 krb5_context /*context*/,
398 HDB **/*db*/,
399 const char */*filename*/);
400
401krb5_error_code
402hdb_mitdb_create (
403 krb5_context /*context*/,
404 HDB **/*db*/,
405 const char */*filename*/);
406
407krb5_error_code
408hdb_ndbm_create (
409 krb5_context /*context*/,
410 HDB **/*db*/,
411 const char */*filename*/);
412
413krb5_error_code
414hdb_next_enctype2key (
415 krb5_context /*context*/,
416 const hdb_entry */*e*/,
417 const Keys */*keyset*/,
418 krb5_enctype /*enctype*/,
419 Key **/*key*/);
420
421int
422hdb_principal2key (
423 krb5_context /*context*/,
424 krb5_const_principal /*p*/,
425 krb5_data */*key*/);
426
427krb5_error_code
428hdb_print_entry (
429 krb5_context /*context*/,
430 HDB */*db*/,
431 hdb_entry_ex */*entry*/,
432 void */*data*/);
433
434krb5_error_code
435hdb_process_master_key (
436 krb5_context /*context*/,
437 int /*kvno*/,
438 krb5_keyblock */*key*/,
439 krb5_enctype /*etype*/,
440 hdb_master_key */*mkey*/);
441
442/**
443 * This function prunes an HDB entry's keys that are too old to have been used
444 * to mint still valid tickets (based on the entry's maximum ticket lifetime).
445 *
446 * @param context Context
447 * @param entry HDB entry
448 */
449
450krb5_error_code
451hdb_prune_keys (
452 krb5_context /*context*/,
453 hdb_entry */*entry*/);
454
455krb5_error_code
456hdb_read_master_key (
457 krb5_context /*context*/,
458 const char */*filename*/,
459 hdb_master_key */*mkey*/);
460
461krb5_error_code
462hdb_replace_extension (
463 krb5_context /*context*/,
464 hdb_entry */*entry*/,
465 const HDB_extension */*ext*/);
466
467krb5_error_code
468hdb_seal_key (
469 krb5_context /*context*/,
470 HDB */*db*/,
471 Key */*k*/);
472
473krb5_error_code
474hdb_seal_key_mkey (
475 krb5_context /*context*/,
476 Key */*k*/,
477 hdb_master_key /*mkey*/);
478
479krb5_error_code
480hdb_seal_keys (
481 krb5_context /*context*/,
482 HDB */*db*/,
483 hdb_entry */*ent*/);
484
485krb5_error_code
486hdb_seal_keys_mkey (
487 krb5_context /*context*/,
488 hdb_entry */*ent*/,
489 hdb_master_key /*mkey*/);
490
491krb5_error_code
492hdb_set_last_modified_by (
493 krb5_context /*context*/,
494 hdb_entry */*entry*/,
495 krb5_principal /*modby*/,
496 time_t /*modtime*/);
497
498krb5_error_code
499hdb_set_master_key (
500 krb5_context /*context*/,
501 HDB */*db*/,
502 krb5_keyblock */*key*/);
503
504krb5_error_code
505hdb_set_master_keyfile (
506 krb5_context /*context*/,
507 HDB */*db*/,
508 const char */*keyfile*/);
509
510/**
511 * Create SQLITE object, and creates the on disk database if its doesn't exists.
512 *
513 * @param context A Kerberos 5 context.
514 * @param db a returned database handle.
515 * @param filename filename
516 *
517 * @return 0 on success, an error code if not
518 */
519
520krb5_error_code
521hdb_sqlite_create (
522 krb5_context /*context*/,
523 HDB **/*db*/,
524 const char */*filename*/);
525
526krb5_error_code
527hdb_unlock (int /*fd*/);
528
529krb5_error_code
530hdb_unseal_key (
531 krb5_context /*context*/,
532 HDB */*db*/,
533 Key */*k*/);
534
535krb5_error_code
536hdb_unseal_key_mkey (
537 krb5_context /*context*/,
538 Key */*k*/,
539 hdb_master_key /*mkey*/);
540
541krb5_error_code
542hdb_unseal_keys (
543 krb5_context /*context*/,
544 HDB */*db*/,
545 hdb_entry */*ent*/);
546
547krb5_error_code
548hdb_unseal_keys_kvno (
549 krb5_context /*context*/,
550 HDB */*db*/,
551 krb5_kvno /*kvno*/,
552 unsigned /*flags*/,
553 hdb_entry */*ent*/);
554
555krb5_error_code
556hdb_unseal_keys_mkey (
557 krb5_context /*context*/,
558 hdb_entry */*ent*/,
559 hdb_master_key /*mkey*/);
560
561int
562hdb_value2entry (
563 krb5_context /*context*/,
564 krb5_data */*value*/,
565 hdb_entry */*ent*/);
566
567int
568hdb_value2entry_alias (
569 krb5_context /*context*/,
570 krb5_data */*value*/,
571 hdb_entry_alias */*ent*/);
572
573krb5_error_code
574hdb_write_master_key (
575 krb5_context /*context*/,
576 const char */*filename*/,
577 hdb_master_key /*mkey*/);
578
579#ifdef __cplusplus
580}
581#endif
582
583#endif /* DOXY */
584#endif /* __hdb_protos_h__ */
585