xref: /freebsd/crypto/krb5/src/kadmin/dbutil/kdb5_util.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* kadmin/dbutil/kdb5_util.h */
3 /*
4  * Copyright 1992, 2008, 2009 by the Massachusetts Institute of Technology.
5  * All Rights Reserved.
6  *
7  * Export of this software from the United States of America may
8  *   require a specific license from the United States Government.
9  *   It is the responsibility of any person or organization contemplating
10  *   export to obtain such a license before exporting.
11  *
12  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13  * distribute this software and its documentation for any purpose and
14  * without fee is hereby granted, provided that the above copyright
15  * notice appear in all copies and that both that copyright notice and
16  * this permission notice appear in supporting documentation, and that
17  * the name of M.I.T. not be used in advertising or publicity pertaining
18  * to distribution of the software without specific, written prior
19  * permission.  Furthermore if you modify this software you must label
20  * your software as modified software and not distribute it in such a
21  * fashion that it might be confused with the original M.I.T. software.
22  * M.I.T. makes no representations about the suitability of
23  * this software for any purpose.  It is provided "as is" without express
24  * or implied warranty.
25  */
26 
27 #include <kdb_log.h>
28 
29 #define REALM_SEP       '@'
30 #define REALM_SEP_STR   "@"
31 
32 extern char *progname;
33 #ifndef V4_DECLARES_STATIC
34 extern krb5_keyblock master_keyblock;
35 extern krb5_principal master_princ;
36 #endif
37 extern krb5_boolean dbactive;
38 extern int exit_status;
39 extern krb5_context util_context;
40 extern kadm5_config_params global_params;
41 extern int valid_master_key;
42 extern krb5_db_entry master_db;
43 extern char **db5util_db_args;
44 extern int    db5util_db_args_size;
45 extern krb5_kvno new_mkvno;
46 extern krb5_keyblock new_master_keyblock;
47 extern int add_db_arg(char *arg);
48 
49 extern void usage(void);
50 
51 extern void add_key
52 (char const *, char const *,
53  krb5_const_principal, const krb5_keyblock *,
54  krb5_kvno, krb5_keysalt *);
55 extern int set_dbname_help
56 (char *, char *);
57 
58 extern char *kdb5_util_Init (int, char **);
59 
60 extern int quit (void);
61 
62 extern int check_for_match
63 (char *, int, krb5_db_entry *, int, int);
64 
65 extern void parse_token
66 (char *, int *, int *, char *);
67 
68 extern int create_db_entry (krb5_principal, krb5_db_entry *);
69 
70 extern int kadm5_create_magic_princs (kadm5_config_params *params,
71                                       krb5_context context);
72 
73 extern int process_ov_principal (krb5_context kcontext, const char *fname,
74                                  FILE *filep, krb5_boolean verbose,
75                                  int *linenop);
76 
77 extern void load_db (int argc, char **argv);
78 extern void dump_db (int argc, char **argv);
79 extern void kdb5_create (int argc, char **argv);
80 extern void kdb5_destroy (int argc, char **argv);
81 extern void kdb5_stash (int argc, char **argv);
82 extern void kdb5_add_mkey (int argc, char **argv);
83 extern void kdb5_use_mkey (int argc, char **argv);
84 extern void kdb5_list_mkeys (int argc, char **argv);
85 extern void kdb5_update_princ_encryption (int argc, char **argv);
86 extern void tabdump (int argc, char **argv);
87 
88 extern krb5_error_code master_key_convert(krb5_context context,
89                                           krb5_db_entry *db_entry);
90 extern void kdb5_purge_mkeys (int argc, char **argv);
91 
92 extern int kadm5_create (kadm5_config_params *params);
93 
94 extern krb5_error_code add_new_mkey(krb5_context, krb5_db_entry *,
95                                     krb5_keyblock *, krb5_kvno);
96 
97 extern krb5_kvno get_next_kvno(krb5_context, krb5_db_entry *);
98 
99 void usage (void);
100