diff options
| author | Paul Park <pjpark@mit.edu> | 1995-07-17 19:35:58 +0000 |
|---|---|---|
| committer | Paul Park <pjpark@mit.edu> | 1995-07-17 19:35:58 +0000 |
| commit | 98b59e5b55dda7eef896bb9edfc36a5b13b1eccb (patch) | |
| tree | e24aa5a4973411a7df959bd677960864c42b874b /src/admin/convert | |
| parent | 014c25c2a4825abf099bd91a01daa5f33be0839e (diff) | |
| download | krb5-98b59e5b55dda7eef896bb9edfc36a5b13b1eccb.tar.gz krb5-98b59e5b55dda7eef896bb9edfc36a5b13b1eccb.tar.xz krb5-98b59e5b55dda7eef896bb9edfc36a5b13b1eccb.zip | |
Add KDC profile and stash file support
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6304 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/admin/convert')
| -rw-r--r-- | src/admin/convert/ChangeLog | 7 | ||||
| -rw-r--r-- | src/admin/convert/configure.in | 1 | ||||
| -rw-r--r-- | src/admin/convert/kdb5_convert.c | 56 |
3 files changed, 63 insertions, 1 deletions
diff --git a/src/admin/convert/ChangeLog b/src/admin/convert/ChangeLog index 2a95d0689..02b81707f 100644 --- a/src/admin/convert/ChangeLog +++ b/src/admin/convert/ChangeLog @@ -1,4 +1,11 @@ +Mon Jul 17 14:55:58 EDT 1995 Paul Park (pjpark@mit.edu) + * configure.in - Add KADM library. + * kdb5_convert.c - Change calling sequence to krb5_db_fetch_mkey(), + using the stash file. Add KDC profile reading/handling as + a supplement to command line supplied arguments. + + Wed Jul 12 11:55:44 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in - Temporarily add --with-kdb4 option. Default is without kdb4. Without kdb4 enables a define. With kdb4 uses -lkdb4 and diff --git a/src/admin/convert/configure.in b/src/admin/convert/configure.in index e44ba56df..444d81d74 100644 --- a/src/admin/convert/configure.in +++ b/src/admin/convert/configure.in @@ -14,6 +14,7 @@ if test "$withval" = yes; then else AC_DEFINE(KDB4_DISABLE) fi +USE_KADM_LIBRARY USE_KDB5_LIBRARY USE_KRB4_LIBRARY KRB5_LIBRARIES diff --git a/src/admin/convert/kdb5_convert.c b/src/admin/convert/kdb5_convert.c index b1a47cb6e..b4c4b8e17 100644 --- a/src/admin/convert/kdb5_convert.c +++ b/src/admin/convert/kdb5_convert.c @@ -41,6 +41,8 @@ static long master_key_version; #include "k5-int.h" #include "com_err.h" +#include "adm.h" +#include "adm_proto.h" #include <stdio.h> #include <netinet/in.h> /* ntohl */ @@ -168,6 +170,8 @@ char *argv[]; int tempdb = 0; char *tempdbname; krb5_context context; + char *stash_file = (char *) NULL; + krb5_realm_params *rparams; krb5_enctype etype = 0xffff; @@ -232,6 +236,56 @@ char *argv[]; } } + /* + * Attempt to read the KDC profile. If we do, then read appropriate values + * from it and augment values supplied on the command line. + */ + if (!(retval = krb5_read_realm_params(context, + realm, + (char *) NULL, + (char *) NULL, + &rparams))) { + /* Get the value for the database */ + if (rparams->realm_dbname && !dbname) + dbname = strdup(rparams->realm_dbname); + + /* Get the value for the master key name */ + if (rparams->realm_mkey_name && !mkey_name) + mkey_name = strdup(rparams->realm_mkey_name); + + /* Get the value for the master key type */ + if (rparams->realm_keytype_valid && !keytypedone) { + master_keyblock.keytype = rparams->realm_keytype; + keytypedone++; + } + + /* Get the value for the encryption type */ + if (rparams->realm_enctype_valid && (etype == 0xffff)) + etype = rparams->realm_enctype; + + /* Get the value for the stashfile */ + if (rparams->realm_stash_file) + stash_file = strdup(rparams->realm_stash_file); + + /* Get the value for maximum ticket lifetime. */ + if (rparams->realm_max_life_valid) + rblock.max_life = rparams->realm_max_life; + + /* Get the value for maximum renewable ticket lifetime. */ + if (rparams->realm_max_rlife_valid) + rblock.max_rlife = rparams->realm_max_rlife; + + /* Get the value for the default principal expiration */ + if (rparams->realm_expiration_valid) + rblock.expiration = rparams->realm_expiration; + + /* Get the value for the default principal flags */ + if (rparams->realm_flags_valid) + rblock.flags = rparams->realm_flags; + + krb5_free_realm_params(context, rparams); + } + #if defined(ODBM) || defined(KDB4_DISABLE) if (!v4dumpfile) { usage(PROGNAME, 1); @@ -315,7 +369,7 @@ master key name '%s'\n", } if (retval = krb5_db_fetch_mkey(context, master_princ, &master_encblock, - read_mkey, read_mkey, 0, + read_mkey, read_mkey, stash_file, 0, &master_keyblock)) { com_err(PROGNAME, retval, "while reading master key"); exit(1); |
