From 7d6bc3aff08fbdadccf9ca0c850297c1fbbc394d Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Wed, 6 Sep 1995 19:09:36 +0000 Subject: [PATCH] * adm_kt_dec.c, adm_kt_enc.c, alt_prof.c, keysalt.c, str_conv.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6717 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm/ChangeLog | 4 +++ src/lib/kadm/adm_kt_dec.c | 8 ++--- src/lib/kadm/adm_kt_enc.c | 22 ++++++------ src/lib/kadm/alt_prof.c | 8 ++--- src/lib/kadm/keysalt.c | 26 +++++++------- src/lib/kadm/str_conv.c | 76 +++++++++++++++++++-------------------- 6 files changed, 74 insertions(+), 70 deletions(-) diff --git a/src/lib/kadm/ChangeLog b/src/lib/kadm/ChangeLog index 4ef0cf8fb..691a2cac7 100644 --- a/src/lib/kadm/ChangeLog +++ b/src/lib/kadm/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu) + + * adm_kt_dec.c, adm_kt_enc.c, alt_prof.c, keysalt.c, str_conv.c : + s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g Tue Sep 05 22:10:34 1995 Chris Provenzano (proven@mit.edu) diff --git a/src/lib/kadm/adm_kt_dec.c b/src/lib/kadm/adm_kt_dec.c index 7426a0f64..7886a70da 100644 --- a/src/lib/kadm/adm_kt_dec.c +++ b/src/lib/kadm/adm_kt_dec.c @@ -88,13 +88,13 @@ 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_keytype */ - if (complist[KRB5_ADM_KT_KEY_KEYTYPE].length < sizeof(krb5_keytype)) { + /* Parse the supplied key_enctype */ + if (complist[KRB5_ADM_KT_KEY_ENCTYPE].length < sizeof(krb5_enctype)) { kret = EINVAL; goto done; } - v = complist[KRB5_ADM_KT_KEY_KEYTYPE].data; - ktentp->key.keytype = (krb5_keytype) + v = complist[KRB5_ADM_KT_KEY_ENCTYPE].data; + ktentp->key.enctype = (krb5_enctype) (((krb5_int32) ((unsigned char) v[0]) << 24) + ((krb5_int32) ((unsigned char) v[1]) << 16) + ((krb5_int32) ((unsigned char) v[2]) << 8) + diff --git a/src/lib/kadm/adm_kt_enc.c b/src/lib/kadm/adm_kt_enc.c index a003928b3..d7dc65af1 100644 --- a/src/lib/kadm/adm_kt_enc.c +++ b/src/lib/kadm/adm_kt_enc.c @@ -106,19 +106,19 @@ krb5_adm_ktent_to_proto(kcontext, ktentp, ncompp, complistp) } /* - * Fill in key_keytype. + * Fill in key_enctype. */ - if (clist[KRB5_ADM_KT_KEY_KEYTYPE].data = + if (clist[KRB5_ADM_KT_KEY_ENCTYPE].data = (char *) malloc(sizeof(krb5_ui_4))) { - clist[KRB5_ADM_KT_KEY_KEYTYPE].length = sizeof(krb5_ui_4); - clist[KRB5_ADM_KT_KEY_KEYTYPE].data[0] = - (ktentp->key.keytype >> 24) & 0xff; - clist[KRB5_ADM_KT_KEY_KEYTYPE].data[1] = - (ktentp->key.keytype >> 16) & 0xff; - clist[KRB5_ADM_KT_KEY_KEYTYPE].data[2] = - (ktentp->key.keytype >> 8) & 0xff; - clist[KRB5_ADM_KT_KEY_KEYTYPE].data[3] = - ktentp->key.keytype & 0xff; + clist[KRB5_ADM_KT_KEY_ENCTYPE].length = sizeof(krb5_ui_4); + clist[KRB5_ADM_KT_KEY_ENCTYPE].data[0] = + (ktentp->key.enctype >> 24) & 0xff; + clist[KRB5_ADM_KT_KEY_ENCTYPE].data[1] = + (ktentp->key.enctype >> 16) & 0xff; + clist[KRB5_ADM_KT_KEY_ENCTYPE].data[2] = + (ktentp->key.enctype >> 8) & 0xff; + clist[KRB5_ADM_KT_KEY_ENCTYPE].data[3] = + ktentp->key.enctype & 0xff; nents++; } else { diff --git a/src/lib/kadm/alt_prof.c b/src/lib/kadm/alt_prof.c index 8c6314c87..f51be4259 100644 --- a/src/lib/kadm/alt_prof.c +++ b/src/lib/kadm/alt_prof.c @@ -333,8 +333,8 @@ krb5_read_realm_params(kcontext, realm, kdcprofile, kdcenv, rparamp) /* Get the value for the master key type */ hierarchy[2] = "master_key_type"; if (!krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { - if (!krb5_string_to_keytype(svalue, &rparams->realm_keytype)) - rparams->realm_keytype_valid = 1; + if (!krb5_string_to_enctype(svalue, &rparams->realm_enctype)) + rparams->realm_enctype_valid = 1; krb5_xfree(svalue); } @@ -401,8 +401,8 @@ krb5_read_realm_params(kcontext, realm, kdcprofile, kdcenv, rparamp) krb5_xfree(svalue); } - /* Get the value for the supported keytype/salttype matrix */ - hierarchy[2] = "supported_keytypes"; + /* Get the value for the supported enctype/salttype matrix */ + hierarchy[2] = "supported_enctypes"; if (!krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { krb5_string_to_keysalts(svalue, ", \t", /* Tuple separators */ diff --git a/src/lib/kadm/keysalt.c b/src/lib/kadm/keysalt.c index 817cb66ad..011a73747 100644 --- a/src/lib/kadm/keysalt.c +++ b/src/lib/kadm/keysalt.c @@ -36,13 +36,13 @@ static const char default_ksaltseps[] = ":."; * krb5_keysalt_is_present() - Determine if a key/salt pair is present * in a list of key/salt tuples. * - * Salttype may be negative to indicate a search for only a keytype. + * Salttype may be negative to indicate a search for only a enctype. */ krb5_boolean -krb5_keysalt_is_present(ksaltlist, nksalts, keytype, salttype) +krb5_keysalt_is_present(ksaltlist, nksalts, enctype, salttype) krb5_key_salt_tuple *ksaltlist; krb5_int32 nksalts; - krb5_keytype keytype; + krb5_enctype enctype; krb5_int32 salttype; { krb5_boolean foundit; @@ -51,7 +51,7 @@ krb5_keysalt_is_present(ksaltlist, nksalts, keytype, salttype) foundit = 0; if (ksaltlist) { for (i=0; i + * * or - * + * */ sp = (char *) NULL; /* Attempt to find a separator */ @@ -152,7 +152,7 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) ep = strchr(kp, (int) *septmp)); if (sp) { - /* Separate keytype from salttype */ + /* Separate enctype from salttype */ sepchar = *sp; *sp = '\0'; sp++; @@ -161,10 +161,10 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) stype = -1; /* - * Attempt to parse keytype and salttype. If we parse well + * Attempt to parse enctype and salttype. If we parse well * then make sure that it specifies a unique key/salt combo */ - if (!krb5_string_to_keytype(kp, &ktype) && + if (!krb5_string_to_enctype(kp, &ktype) && (!sp || !krb5_string_to_salttype(sp, &stype)) && (dups || !krb5_keysalt_is_present(*ksaltp, *nksaltp, ktype, stype))) { @@ -184,7 +184,7 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) } /* Save our values */ - (*ksaltp)[(*nksaltp)].ks_keytype = ktype; + (*ksaltp)[(*nksaltp)].ks_enctype = ktype; (*ksaltp)[(*nksaltp)].ks_salttype = stype; (*nksaltp)++; } diff --git a/src/lib/kadm/str_conv.c b/src/lib/kadm/str_conv.c index c11465593..71716ad7b 100644 --- a/src/lib/kadm/str_conv.c +++ b/src/lib/kadm/str_conv.c @@ -31,7 +31,7 @@ * * String decoding: * ---------------- - * krb5_string_to_keytype() - Convert string to krb5_keytype. + * krb5_string_to_enctype() - Convert string to krb5_enctype. * krb5_string_to_salttype() - Convert string to salttype (krb5_int32) * krb5_string_to_enctype() - Convert string to krb5_enctype. * krb5_string_to_cksumtype() - Convert string to krb5_cksumtype; @@ -41,7 +41,7 @@ * * String encoding: * ---------------- - * krb5_keytype_to_string() - Convert krb5_keytype to string. + * krb5_enctype_to_string() - Convert krb5_enctype to string. * krb5_salttype_to_string() - Convert salttype (krb5_int32) to string. * krb5_enctype_to_string() - Convert krb5_enctype to string. * krb5_cksumtype_to_string() - Convert krb5_cksumtype to string. @@ -58,14 +58,14 @@ /* * Local data structures. */ -struct keytype_lookup_entry { - krb5_keytype ktt_keytype; /* Keytype */ +struct enctype_lookup_entry { + krb5_enctype ktt_enctype; /* Keytype */ const char * ktt_specifier; /* How to recognize it */ const char * ktt_output; /* How to spit it out */ }; struct salttype_lookup_entry { - krb5_int32 stt_keytype; /* Salt type */ + krb5_int32 stt_enctype; /* Salt type */ const char * stt_specifier; /* How to recognize it */ const char * stt_output; /* How to spit it out */ }; @@ -97,17 +97,17 @@ struct deltat_match_entry { */ /* Keytype strings */ -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"; +static const char enctype_des_in[] = "des"; +static const char enctype_null_in[] = "null"; +static const char enctype_descbccrc_in[] = "des-cbc-crc"; +static const char enctype_descbcmd4_in[] = "des-cbc-md4"; +static const char enctype_descbcmd5_in[] = "des-cbc-md5"; +static const char enctype_descbcraw_in[] = "des-cbc-raw"; +static const char enctype_null_out[] = "Null"; +static const char enctype_descbccrc_out[] = "DES cbc mode with CRC-32"; +static const char enctype_descbcmd4_out[] = "DES cbc mode with RSA-MD4"; +static const char enctype_descbcmd5_out[] = "DES cbc mode with RSA-MD5"; +static const char enctype_descbcraw_out[] = "DES cbc mode raw"; /* Salttype strings */ static const char stype_v5_in[] = "normal"; @@ -214,18 +214,18 @@ 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 */ +static const struct enctype_lookup_entry enctype_table[] = { +/* krb5_enctype 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 } +{ ENCTYPE_NULL, enctype_null_in, enctype_null_out }, +{ ENCTYPE_DES_CBC_MD5, enctype_des_in, enctype_descbcmd5_out }, +{ ENCTYPE_DES_CBC_CRC, enctype_descbccrc_in, enctype_descbccrc_out }, +{ ENCTYPE_DES_CBC_MD4, enctype_descbcmd4_in, enctype_descbcmd4_out }, +{ ENCTYPE_DES_CBC_MD5, enctype_descbcmd5_in, enctype_descbcmd5_out }, +{ ENCTYPE_DES_CBC_RAW, enctype_descbcraw_in, enctype_descbcraw_out } }; -static const int keytype_table_nents = sizeof(keytype_table)/ - sizeof(keytype_table[0]); +static const int enctype_table_nents = sizeof(enctype_table)/ + sizeof(enctype_table[0]); static const struct salttype_lookup_entry salttype_table[] = { /* salt type input specifier output string */ @@ -416,18 +416,18 @@ strptime(buf, format, tm) * These routines return 0 for success, EINVAL for invalid entry. */ krb5_error_code -krb5_string_to_keytype(string, keytypep) +krb5_string_to_enctype(string, enctypep) char * string; - krb5_keytype * keytypep; + krb5_enctype * enctypep; { int i; int found; found = 0; - for (i=0; i