From: Richard Basch Date: Tue, 12 Dec 1995 02:34:56 +0000 (+0000) Subject: * main.c: Use the master key enctype from the stash file if none X-Git-Tag: krb5-1.0-beta6~715 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a65a59a95b97d8119f336f9e8e7df6ac56be8c8;p=krb5.git * main.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@7198 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/main.c b/src/kdc/main.c index 260c40257..49f2a89ed 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -337,14 +337,6 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, rdp->realm_mpname = (def_mpname) ? strdup(def_mpname) : strdup(KRB5_KDB_M_NAME); - /* Handle master key type */ - if (rparams && rparams->realm_enctype_valid) - rdp->realm_mkey.enctype = - (krb5_enctype) rparams->realm_enctype; - else - rdp->realm_mkey.enctype = (def_enctype) ? def_enctype : - ENCTYPE_DES_CBC_CRC; - /* Handle KDC port */ if (rparams && rparams->realm_kdc_ports) rdp->realm_ports = strdup(rparams->realm_kdc_ports); @@ -359,6 +351,15 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, else manual = def_manual; + /* Handle master key type */ + if (rparams && rparams->realm_enctype_valid) + rdp->realm_mkey.enctype = + (krb5_enctype) rparams->realm_enctype; + else + /* If not manual, we can lookup the enctype */ + rdp->realm_mkey.enctype = (def_enctype || !manual) + ? def_enctype : ENCTYPE_DES_CBC_CRC; + /* Handle ticket maximum life */ rdp->realm_maxlife = (rparams && rparams->realm_max_life_valid) ? rparams->realm_max_life : KRB5_KDB_MAX_LIFE; @@ -423,8 +424,9 @@ init_realm(progname, rdp, realm, def_dbname, def_mpname, } /* Select the specified encryption type */ - krb5_use_enctype(rdp->realm_context, &rdp->realm_encblock, - rdp->realm_mkey.enctype); + if (rdp->realm_mkey.enctype) + krb5_use_enctype(rdp->realm_context, &rdp->realm_encblock, + rdp->realm_mkey.enctype); /* * Get the master key.