From: Theodore Tso Date: Fri, 14 Oct 1994 04:32:13 +0000 (+0000) Subject: Select the cryptosystem to be used using krb5_use_cstype() instead of X-Git-Tag: krb5-1.0-beta5~1122 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=50ca78c56176a2350d89829041434ab4991075f1;p=krb5.git Select the cryptosystem to be used using krb5_use_cstype() instead of using a implementation specific assignment. Also, allow the encryption type to be specified using a command line option. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4505 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 165b404a9..c9564d247 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,10 @@ +Fri Oct 14 00:31:14 1994 Theodore Y. Ts'o (tytso@dcl) + + * main.c (process_args): Select the cryptosystem to be used using + krb5_use_cstype() instead of using a implementation + specific assignment. Also, allow the encryption type to + be specified using a command line option. + Tue Oct 11 22:11:09 1994 Theodore Y. Ts'o (tytso@dcl) * do_as_req.c (process_as_req): Don't assume that the request diff --git a/src/kdc/main.c b/src/kdc/main.c index a3da6cf41..4912ab894 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -150,12 +150,13 @@ char **argv; char *rcname = 0; char *lrealm; krb5_error_code retval, retval2; + krb5_enctype kdc_etype = DEFAULT_KDC_ETYPE; krb5_enctype etype; extern krb5_deltat krb5_clockskew; extern char *optarg; - while ((c = getopt(argc, argv, "r:d:mM:k:R:")) != EOF) { + while ((c = getopt(argc, argv, "r:d:mM:k:R:e:")) != EOF) { switch(c) { case 'r': /* realm name for db */ db_realm = optarg; @@ -176,6 +177,9 @@ char **argv; case 'R': rcname = optarg; break; + case 'e': + kdc_etype = atoi(optarg); + break; case '?': default: usage(argv[0]); @@ -229,11 +233,12 @@ char **argv; exit(1); } -#ifdef PROVIDE_DES_CBC_CRC - master_encblock.crypto_entry = krb5_des_cst_entry.system; -#else -error(You gotta figure out what cryptosystem to use in the KDC); -#endif + if (!valid_etype(kdc_etype)) { + com_err(argv[0], KRB5_PROG_ETYPE_NOSUPP, + "while setting up etype %d", kdc_etype); + exit(1); + } + krb5_use_cstype(&master_encblock, kdc_etype); if (retval = krb5_db_fetch_mkey(master_princ, &master_encblock, manual, FALSE, /* only read it once, if at all */