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