2 * $Id: krb_db.h,v 1.15 1996/12/17 20:34:32 assar Exp $
3 * $FreeBSD: src/crypto/kerberosIV/lib/kdb/krb_db.h,v 1.3 1999/09/19 21:56:06 markm Exp $
5 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
7 * For copying and distribution information, please see the file
10 * spm Project Athena 8/85
12 * This file defines data structures for the kerberos
13 * authentication/authorization database.
15 * They MUST correspond to those defined in *.rel
23 #define KERB_M_NAME "K" /* Kerberos */
24 #define KERB_M_INST "M" /* Master */
25 #define KERB_DEFAULT_NAME "default"
26 #define KERB_DEFAULT_INST ""
28 #define DB_DIR "/var/db/kerberos"
31 #define DBM_FILE DB_DIR "/principal"
34 /* this also defines the number of queue headers */
35 #define KERB_DB_HASH_MODULO 64
38 /* Arguments to kerb_dbl_lock() */
40 #define KERB_DBL_EXCLUSIVE 1
41 #define KERB_DBL_SHARED 0
43 /* arguments to kerb_db_set_lockmode() */
45 #define KERB_DBL_BLOCKING 0
46 #define KERB_DBL_NONBLOCKING 1
48 /* arguments to kdb_get_master_key */
50 #define KDB_GET_PROMPT 1
51 #define KDB_GET_TWICE 2
53 /* Principal defines the structure of a principal's name */
57 char instance[INST_SZ];
62 char exp_date_txt[DATE_SZ];
64 char mod_date_txt[DATE_SZ];
70 char mod_name[ANAME_SZ];
71 char mod_instance[INST_SZ];
72 char *old; /* cast to (Principal *); not in db,
89 /* Dba defines the structure of a database administrator */
93 char instance[INST_SZ];
96 char exp_date_txt[DATE_SZ];
98 * cast to (Dba *); not in db, ptr to
103 typedef int (*k_iter_proc_t)(void*, Principal*);
105 void copy_from_key __P((des_cblock in, u_int32_t *lo, u_int32_t *hi));
106 void copy_to_key __P((u_int32_t *lo, u_int32_t *hi, des_cblock out));
108 void kdb_encrypt_key __P((des_cblock *, des_cblock *, des_cblock *,
109 des_key_schedule, int));
110 int kdb_get_master_key __P((int prompt, des_cblock *master_key,
111 des_key_schedule master_key_sched));
112 int kdb_get_new_master_key __P((des_cblock *, des_key_schedule, int));
113 int kdb_kstash __P((des_cblock *, char *));
114 int kdb_new_get_master_key __P((des_cblock *, des_key_schedule));
115 int kdb_new_get_new_master_key __P((des_cblock *key, des_key_schedule schedule, int verify));
116 long kdb_verify_master_key __P((des_cblock *, des_key_schedule, FILE *));
117 long *kerb_db_begin_update __P((void));
118 int kerb_db_create __P((char *db_name));
119 int kerb_db_delete_principal (char *name, char *inst);
120 void kerb_db_end_update __P((long *db));
121 int kerb_db_get_dba __P((char *, char *, Dba *, unsigned, int *));
122 void kerb_db_get_stat __P((DB_stat *));
123 int kerb_db_iterate __P((k_iter_proc_t, void*));
124 int kerb_db_put_principal __P((Principal *, unsigned int));
125 void kerb_db_put_stat __P((DB_stat *));
126 int kerb_db_rename __P((char *, char *));
127 int kerb_db_set_lockmode __P((int));
128 int kerb_db_set_name __P((char *));
129 int kerb_db_update __P((long *db, Principal *principal, unsigned int max));
130 int kerb_delete_principal __P((char *name, char *inst));
131 void kerb_fini __P((void));
132 int kerb_get_dba __P((char *, char *, Dba *, unsigned int, int *));
133 time_t kerb_get_db_age __P((void));
134 int kerb_get_principal __P((char *, char *, Principal *, unsigned int, int *));
135 int kerb_init __P((void));
136 int kerb_put_principal __P((Principal *, unsigned int));
138 #endif /* KRB_DB_DEFS */