Select the cryptosystem to be used using krb5_use_cstype() instead of
authorTheodore Tso <tytso@mit.edu>
Fri, 14 Oct 1994 04:32:13 +0000 (04:32 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 14 Oct 1994 04:32:13 +0000 (04:32 +0000)
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

src/kdc/ChangeLog
src/kdc/main.c

index 165b404a9b232f710934d79787d01092ba6bb1cb..c9564d2475100347fd1b5e9eece21a44452a0662 100644 (file)
@@ -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
index a3da6cf419d6cf95310b786b346f31e55d7b2b23..4912ab8943e2f4bf8f83fe7077e5d7d542b84f5a 100644 (file)
@@ -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 */