* adm_kt_dec.c, adm_kt_enc.c, alt_prof.c, str_conv.c:
authorChris Provenzano <proven@mit.edu>
Wed, 6 Sep 1995 03:31:56 +0000 (03:31 +0000)
committerChris Provenzano <proven@mit.edu>
Wed, 6 Sep 1995 03:31:56 +0000 (03:31 +0000)
Remove krb5_enctype references, and replace
with krb5_keytype where appropriate

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6680 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm/ChangeLog
src/lib/kadm/adm_kt_dec.c
src/lib/kadm/adm_kt_enc.c
src/lib/kadm/alt_prof.c
src/lib/kadm/str_conv.c

index e9830f22af217ef803e5db80fe49e1a1de25091c..4ef0cf8fb667a00e9e2d70575b9c3c249df64ef3 100644 (file)
@@ -1,4 +1,10 @@
 
+Tue Sep 05 22:10:34 1995   Chris Provenzano (proven@mit.edu)
+
+        * adm_kt_dec.c, adm_kt_enc.c, alt_prof.c, str_conv.c: 
+               Remove krb5_enctype references, and replace 
+               with krb5_keytype where appropriate
+
 Tue Aug 29 15:31:50 EDT 1995   Paul Park       (pjpark@mit.edu)
        * .Sanitize, krb5strings.M - Add new manpage describing string syntax
                for common datatypes handled by str_conv.c.
index 8140af2a627cd32b253a099d8e8376215456d876..7426a0f64c015e7aaded58212a2cb694b678b997 100644 (file)
@@ -100,18 +100,6 @@ krb5_adm_proto_to_ktent(kcontext, ncomp, complist, ktentp)
         ((krb5_int32) ((unsigned char) v[2]) << 8) +
         ((krb5_int32) ((unsigned char) v[3])));
 
-    /* Parse the supplied key_etype */
-    if (complist[KRB5_ADM_KT_KEY_ETYPE].length < sizeof(krb5_enctype)) {
-       kret = EINVAL;
-       goto done;
-    }
-    v = complist[KRB5_ADM_KT_KEY_ETYPE].data;
-    ktentp->key.etype = (krb5_enctype)
-       (((krb5_int32) ((unsigned char) v[0]) << 24) +
-        ((krb5_int32) ((unsigned char) v[1]) << 16) +
-        ((krb5_int32) ((unsigned char) v[2]) << 8) +
-        ((krb5_int32) ((unsigned char) v[3])));
-
     /* Finally, shuck the key contents */
     if (ktentp->key.contents = (krb5_octet *)
        malloc((size_t) complist[KRB5_ADM_KT_KEY_KEY].length)) {
index 0d85687b352d0435982401a29416431704fe0fb6..a003928b3509f397d75446fa338ecac5c42dd735 100644 (file)
@@ -126,27 +126,6 @@ krb5_adm_ktent_to_proto(kcontext, ktentp, ncompp, complistp)
            goto done;
        }
 
-       /*
-        * Fill in key_etype.
-        */
-       if (clist[KRB5_ADM_KT_KEY_ETYPE].data = 
-           (char *) malloc(sizeof(krb5_ui_4))) {
-           clist[KRB5_ADM_KT_KEY_ETYPE].length = sizeof(krb5_ui_4);
-           clist[KRB5_ADM_KT_KEY_ETYPE].data[0] =
-               (ktentp->key.etype >> 24) & 0xff;
-           clist[KRB5_ADM_KT_KEY_ETYPE].data[1] =
-               (ktentp->key.etype >> 16) & 0xff;
-           clist[KRB5_ADM_KT_KEY_ETYPE].data[2] =
-               (ktentp->key.etype >> 8) & 0xff;
-           clist[KRB5_ADM_KT_KEY_ETYPE].data[3] =
-               ktentp->key.etype & 0xff;
-           nents++;
-       }
-       else {
-           kret = ENOMEM;
-           goto done;
-       }
-
        /*
         * Fill in key_key.
         */
index 10645f56a5f9d6e8643f50624e6400c5223130a1..8c6314c870ea7d4f6e613e1845ac609e7fc9d9e3 100644 (file)
@@ -338,14 +338,6 @@ krb5_read_realm_params(kcontext, realm, kdcprofile, kdcenv, rparamp)
                krb5_xfree(svalue);
            }
            
-           /* Get the value for the encryption type */
-           hierarchy[2] = "encryption_type";
-           if (!krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) {
-               if (!krb5_string_to_enctype(svalue, &rparams->realm_enctype))
-                   rparams->realm_enctype_valid = 1;
-               krb5_xfree(svalue);
-           }
-           
            /* Get the value for the stashfile */
            hierarchy[2] = "key_stash_file";
            if (!krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue))
index 2d91d951191214cf29f9b528cd8310584da79299..c114655935964ece6aecc3c4c22667f239b948e0 100644 (file)
@@ -70,12 +70,6 @@ struct salttype_lookup_entry {
     const char *       stt_output;             /* How to spit it out   */
 };
 
-struct enctype_lookup_entry {
-    krb5_enctype       ett_enctype;            /* Encryption type      */
-    const char *       ett_specifier;          /* How to recognize it  */
-    const char *       ett_output;             /* How to spit it out   */
-};
-
 struct cksumtype_lookup_entry {
     krb5_cksumtype     cst_cksumtype;          /* Checksum type        */
     const char *       cst_specifier;          /* How to recognize it  */
@@ -101,11 +95,19 @@ struct deltat_match_entry {
 /*
  * Local strings
  */
+
 /* Keytype strings */
-static const char keytype_null_in[]    = "null";
-static const char keytype_des_in[]     = "des";
-static const char keytype_null_out[]   = "Null";
-static const char keytype_des_out[]    = "DES";
+static const char keytype_des_in[]             = "des";
+static const char keytype_null_in[]            = "null";
+static const char keytype_descbccrc_in[]       = "des-cbc-crc";
+static const char keytype_descbcmd4_in[]       = "des-cbc-md4";
+static const char keytype_descbcmd5_in[]       = "des-cbc-md5";
+static const char keytype_descbcraw_in[]       = "des-cbc-raw";
+static const char keytype_null_out[]           = "Null";
+static const char keytype_descbccrc_out[]      = "DES cbc mode with CRC-32";
+static const char keytype_descbcmd4_out[]      = "DES cbc mode with RSA-MD4";
+static const char keytype_descbcmd5_out[]      = "DES cbc mode with RSA-MD5";
+static const char keytype_descbcraw_out[]      = "DES cbc mode raw";
 
 /* Salttype strings */
 static const char stype_v5_in[]                = "normal";
@@ -119,18 +121,6 @@ static const char stype_norealm_out[]      = "Version 5 - No Realm";
 static const char stype_olrealm_out[]  = "Version 5 - Realm Only";
 static const char stype_special_out[]  = "Special";
 
-/* Encryption type strings */
-static const char etype_null_in[]      = "null";
-static const char etype_descbccrc_in[] = "des-cbc-crc";
-static const char etype_descbcmd4_in[] = "des-cbc-md4";
-static const char etype_descbcmd5_in[] = "des-cbc-md5";
-static const char etype_rawdescbc_in[] = "raw-des-cbc";
-static const char etype_null_out[]     = "Null";
-static const char etype_descbccrc_out[]        = "DES cbc mode with CRC-32";
-static const char etype_descbcmd4_out[]        = "DES cbc mode with RSA-MD4";
-static const char etype_descbcmd5_out[]        = "DES cbc mode with RSA-MD5";
-static const char etype_rawdescbc_out[]        = "DES cbc mode";
-
 /* Checksum type strings */
 static const char cstype_crc32_in[]    = "crc32";
 static const char cstype_md4_in[]      = "md4";
@@ -225,10 +215,14 @@ static const char dt_output_hms[] = "%d:%02d:%02d";
  * Lookup tables.
  */
 static const struct keytype_lookup_entry keytype_table[] = {
-/* krb5_keytype        input specifier         output string           */
-/*-------------        ----------------------- ------------------------*/
-{ KEYTYPE_NULL,        keytype_null_in,        keytype_null_out        },
-{ KEYTYPE_DES, keytype_des_in,         keytype_des_out         }
+/* krb5_keytype                input specifier         output string           */
+/*-------------                ----------------------- ------------------------*/
+{ KEYTYPE_NULL,                keytype_null_in,        keytype_null_out        },
+{ KEYTYPE_DES_CBC_MD5, keytype_des_in,         keytype_descbcmd5_out   },
+{ KEYTYPE_DES_CBC_CRC, keytype_descbccrc_in,   keytype_descbccrc_out   },
+{ KEYTYPE_DES_CBC_MD4, keytype_descbcmd4_in,   keytype_descbcmd4_out   },
+{ KEYTYPE_DES_CBC_MD5, keytype_descbcmd5_in,   keytype_descbcmd5_out   },
+{ KEYTYPE_DES_CBC_RAW, keytype_descbcraw_in,   keytype_descbcraw_out   }
 };
 static const int keytype_table_nents = sizeof(keytype_table)/
                                       sizeof(keytype_table[0]);
@@ -245,18 +239,6 @@ static const struct salttype_lookup_entry salttype_table[] = {
 static const int salttype_table_nents = sizeof(salttype_table)/
                                        sizeof(salttype_table[0]);
 
-static const struct enctype_lookup_entry enctype_table[] = {
-/* krb5_enctype             input specifier            output string           */
-/*------------------ ---------------------     ------------------------*/
-{ ETYPE_NULL,       etype_null_in,             etype_null_out          },
-{ ETYPE_DES_CBC_CRC, etype_descbccrc_in,       etype_descbccrc_out     },
-{ ETYPE_DES_CBC_MD4, etype_descbcmd4_in,       etype_descbcmd4_out     },
-{ ETYPE_DES_CBC_MD5, etype_descbcmd5_in,       etype_descbcmd5_out     },
-{ ETYPE_RAW_DES_CBC, etype_rawdescbc_in,       etype_rawdescbc_out     }
-};
-static const int enctype_table_nents = sizeof(enctype_table)/
-                                      sizeof(enctype_table[0]);
-
 static const struct cksumtype_lookup_entry cksumtype_table[] = {
 /* krb5_cksumtype         input specifier      output string           */
 /*----------------------- ---------------------        ------------------------*/
@@ -471,25 +453,6 @@ krb5_string_to_salttype(string, salttypep)
     return((found) ? 0 : EINVAL);
 }
 
-krb5_error_code
-krb5_string_to_enctype(string, enctypep)
-    char               * string;
-    krb5_enctype       * enctypep;
-{
-    int i;
-    int found;
-
-    found = 0;
-    for (i=0; i<enctype_table_nents; i++) {
-       if (!strcasecmp(string, enctype_table[i].ett_specifier)) {
-           found = 1;
-           *enctypep = enctype_table[i].ett_enctype;
-           break;
-       }
-    }
-    return((found) ? 0 : EINVAL);
-}
-
 krb5_error_code
 krb5_string_to_cksumtype(string, cksumtypep)
     char               * string;
@@ -678,33 +641,6 @@ krb5_salttype_to_string(salttype, buffer, buflen)
        return(EINVAL);
 }
 
-krb5_error_code
-krb5_enctype_to_string(enctype, buffer, buflen)
-    krb5_enctype       enctype;
-    char               * buffer;
-    size_t             buflen;
-{
-    int i;
-    const char *out;
-
-    out = (char *) NULL;
-    for (i=0; i<enctype_table_nents; i++) {
-       if (enctype ==  enctype_table[i].ett_enctype) {
-           out = enctype_table[i].ett_output;
-           break;
-       }
-    }
-    if (out) {
-       if (buflen > strlen(out))
-           strcpy(buffer, out);
-       else
-           out = (char *) NULL;
-       return((out) ? 0 : ENOMEM);
-    }
-    else
-       return(EINVAL);
-}
-
 krb5_error_code
 krb5_cksumtype_to_string(cksumtype, buffer, buflen)
     krb5_cksumtype     cksumtype;