Select the cryptosystem to be used using krb5_use_cstype() instead of
authorTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 22:55:34 +0000 (22:55 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 19 Oct 1994 22:55:34 +0000 (22:55 +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@4546 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/server/ChangeLog
src/kadmin/server/adm_server.c

index 95bfa930dfada8525327bf32856c162e8e1ea3b1..7ca21a3027b897816d2143ef3902f87171e8ff9e 100644 (file)
@@ -1,3 +1,10 @@
+Wed Oct 19 17:40:22 1994  Theodore Y. Ts'o  (tytso@dcl)
+
+       * adm_server.c (main): 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  4 17:08:25 1994  Theodore Y. Ts'o  (tytso@dcl)
 
        * adm_process.c (cpw_keyproc): Add widen.h and narrow.h around
index a408331ffa838ce5c3d4f10bb255bc6ce31ede57..a5a140f64f09965c93120b13a8c25900d882d21b 100644 (file)
@@ -126,6 +126,7 @@ char **argv;
     char *mkey_name = 0;
     char *local_realm;
     krb5_enctype etype;
+    krb5_enctype kdc_etype = DEFAULT_KDC_ETYPE;
 
 #ifdef SANDIA
     char input_string[80];
@@ -152,7 +153,7 @@ char **argv;
         fclose(startup_file);
     }
 #endif
-    while ((c = getopt(argc, argv, "hmMa:d:k:r:D")) != EOF) {
+    while ((c = getopt(argc, argv, "hmMa:d:k:r:De:")) != EOF) {
        switch(c) {
            case 'a':                   /* new acl directory */
                acl_file_name = optarg;
@@ -168,6 +169,10 @@ char **argv;
                }
                break;
 
+           case 'e':
+               kdc_etype = atoi(optarg);
+               break;
+               
            case 'k':                   /* keytype for master key */
                master_keyblock.keytype = atoi(optarg);
                keytypedone++;
@@ -224,7 +229,12 @@ char **argv;
        exit(1);
     }
 
-    master_encblock.crypto_entry = krb5_des_cst_entry.system;
+    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,