From ae1ec1e7d637b1778f6a693f2bc5c4ac43521ef0 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Tue, 12 Dec 1995 02:34:40 +0000 Subject: [PATCH] * kdb5_edit.c: Use the master key enctype from the stash file if none is specified (set the keyblock enctype to NULL). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7197 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/edit/kdb5_edit.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 1871d3eb3..f56af7e76 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -247,20 +247,27 @@ char *kdb5_edit_Init(argc, argv) if (!dbname) dbname = DEFAULT_KDB_FILE; - if (!enctypedone) - master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; - - if (!valid_enctype(master_keyblock.enctype)) { - char tmp[32]; - if (krb5_enctype_to_string(master_keyblock.enctype, tmp, sizeof(tmp))) - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, - "while setting up enctype %d", master_keyblock.enctype); + if (!enctypedone) { + if (manual_mkey) + master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; else - com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); - exit(1); + master_keyblock.enctype = NULL; } - krb5_use_enctype(edit_context, &master_encblock, master_keyblock.enctype); + if (master_keyblock.enctype) { + if (!valid_enctype(master_keyblock.enctype)) { + char tmp[32]; + if (krb5_enctype_to_string(master_keyblock.enctype, + tmp, sizeof(tmp))) + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, + "while setting up enctype %d", master_keyblock.enctype); + else + com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); + exit(1); + } + krb5_use_enctype(edit_context, &master_encblock, + master_keyblock.enctype); + } if (cur_realm) { if ((retval = krb5_set_default_realm(edit_context, cur_realm))) { -- 2.26.2