From 4b442905d1e1742e5b21e76731779182d4a4baf4 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Wed, 6 Sep 1995 19:10:10 +0000 Subject: [PATCH] * decrypt_key.c, encrypt_key.c, fetch_mkey.c, kdb_compat.c, * kdb_cpw.c, kdb_xdr.c, store_mkey.c, t_kdb.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6718 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kdb/ChangeLog | 5 +++++ src/lib/kdb/decrypt_key.c | 2 +- src/lib/kdb/encrypt_key.c | 2 +- src/lib/kdb/fetch_mkey.c | 10 +++++----- src/lib/kdb/kdb_compat.h | 2 +- src/lib/kdb/kdb_cpw.c | 14 +++++++------- src/lib/kdb/kdb_xdr.c | 6 +++--- src/lib/kdb/store_mkey.c | 6 +++--- src/lib/kdb/t_kdb.c | 8 ++++---- 9 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/lib/kdb/ChangeLog b/src/lib/kdb/ChangeLog index 194089674..88d23c947 100644 --- a/src/lib/kdb/ChangeLog +++ b/src/lib/kdb/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu) + + * decrypt_key.c, encrypt_key.c, fetch_mkey.c, kdb_compat.c, + * kdb_cpw.c, kdb_xdr.c, store_mkey.c, t_kdb.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/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index 362f832f3..a1762fbec 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -45,7 +45,7 @@ krb5_dbekd_decrypt_key_data(context, eblock, key_data, keyblock, keysalt) krb5_octet * ptr; keyblock->magic = KV5M_KEYBLOCK; - keyblock->keytype = key_data->key_data_type[0]; + keyblock->enctype = key_data->key_data_type[0]; /* Decrypt key_data_contents */ if ((keyblock->contents = (krb5_octet *)malloc(krb5_encrypt_size( diff --git a/src/lib/kdb/encrypt_key.c b/src/lib/kdb/encrypt_key.c index 6e3f9b759..ea7d17ca7 100644 --- a/src/lib/kdb/encrypt_key.c +++ b/src/lib/kdb/encrypt_key.c @@ -58,7 +58,7 @@ krb5_dbekd_encrypt_key_data(context, eblock, keyblock, keysalt, keyver,key_data) * The First element of the type/length/contents * fields is the key type/length/contents */ - key_data->key_data_type[0] = keyblock->keytype; + key_data->key_data_type[0] = keyblock->enctype; key_data->key_data_length[0] = krb5_encrypt_size(keyblock->length, eblock->crypto_entry) + 2; diff --git a/src/lib/kdb/fetch_mkey.c b/src/lib/kdb/fetch_mkey.c index 0577d5eae..9f8d533c1 100644 --- a/src/lib/kdb/fetch_mkey.c +++ b/src/lib/kdb/fetch_mkey.c @@ -35,7 +35,7 @@ char *krb5_mkey_pwd_prompt2 = KRB5_KDC_MKEY_2; /* * Get the KDC database master key from somewhere, filling it into *key. * - * key->keytype should be set to the desired key type. + * key->enctype should be set to the desired key type. * * if fromkeyboard is TRUE, then the master key is read as a password * from the user's terminal. In this case, @@ -84,7 +84,7 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, keyfile, salt, k if (retval) return retval; } - retval = krb5_string_to_key(context, eblock, key->keytype, key, &pwd, + retval = krb5_string_to_key(context, eblock, key->enctype, key, &pwd, salt ? salt : &scratch); if (!salt) krb5_xfree(scratch.data); @@ -93,7 +93,7 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, keyfile, salt, k } else { /* from somewhere else */ - krb5_ui_2 keytype; + krb5_ui_2 enctype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); FILE *kf; @@ -112,11 +112,11 @@ krb5_db_fetch_mkey(context, mname, eblock, fromkeyboard, twice, keyfile, salt, k if (!(kf = fopen((keyfile) ? keyfile : defkeyfile, "r"))) #endif return KRB5_KDB_CANTREAD_STORED; - if (fread((krb5_pointer) &keytype, 2, 1, kf) != 1) { + if (fread((krb5_pointer) &enctype, 2, 1, kf) != 1) { retval = KRB5_KDB_CANTREAD_STORED; goto errout; } - if (keytype != key->keytype) { + if (enctype != key->enctype) { retval = KRB5_KDB_BADSTORED_MKEY; goto errout; } diff --git a/src/lib/kdb/kdb_compat.h b/src/lib/kdb/kdb_compat.h index 97716da50..2381d9554 100644 --- a/src/lib/kdb/kdb_compat.h +++ b/src/lib/kdb/kdb_compat.h @@ -26,7 +26,7 @@ typedef struct _old_krb5_encrypted_keyblock { - krb5_keytype keytype; + krb5_enctype enctype; int length; krb5_octet *contents; } old_krb5_encrypted_keyblock; diff --git a/src/lib/kdb/kdb_cpw.c b/src/lib/kdb/kdb_cpw.c index 990d3e8e6..4b6dcd4ba 100644 --- a/src/lib/kdb/kdb_cpw.c +++ b/src/lib/kdb/kdb_cpw.c @@ -124,7 +124,7 @@ add_key_rnd(context, master_eblock, ks_tuple, ks_tuple_count, db_entry, kvno) */ found = 0; for (j = 0; j < i; j++) { - if (ks_tuple[j].ks_keytype == ks_tuple[i].ks_keytype) { + if (ks_tuple[j].ks_enctype == ks_tuple[i].ks_enctype) { found = 1; break; } @@ -137,13 +137,13 @@ add_key_rnd(context, master_eblock, ks_tuple, ks_tuple_count, db_entry, kvno) for (j = 0; j < krbtgt_entry.n_key_data; j++) { if ((krbtgt_entry.key_data[j].key_data_kvno == max_kvno) && (krbtgt_entry.key_data[j].key_data_type[0] == - ks_tuple[i].ks_keytype)) { + ks_tuple[i].ks_enctype)) { break; } } if (j == krbtgt_entry.n_key_data) { - retval = KRB5_KDB_BAD_KEYTYPE; + retval = KRB5_KDB_BAD_ENCTYPE; goto add_key_rnd_err; } @@ -155,7 +155,7 @@ add_key_rnd(context, master_eblock, ks_tuple, ks_tuple_count, db_entry, kvno) } /* Init key */ - krb5_use_keytype(context, &krbtgt_eblock, ks_tuple[i].ks_keytype); + krb5_use_enctype(context, &krbtgt_eblock, ks_tuple[i].ks_enctype); if (retval = krb5_process_key(context,&krbtgt_eblock,&krbtgt_keyblock)){ goto add_key_rnd_err; } @@ -315,7 +315,7 @@ add_key_pwd(context, master_eblock, ks_tuple, ks_tuple_count, passwd, */ found = 0; for (j = 0; j < i; j++) { - if ((ks_tuple[j].ks_keytype == ks_tuple[i].ks_keytype) && + if ((ks_tuple[j].ks_enctype == ks_tuple[i].ks_enctype) && (ks_tuple[j].ks_salttype == ks_tuple[i].ks_salttype)) { found = 1; break; @@ -323,7 +323,7 @@ add_key_pwd(context, master_eblock, ks_tuple, ks_tuple_count, passwd, } if (found) continue; - krb5_use_keytype(context, &key_eblock, ks_tuple[i].ks_keytype); + krb5_use_enctype(context, &key_eblock, ks_tuple[i].ks_enctype); if (retval = krb5_dbe_create_key_data(context, db_entry)) return(retval); @@ -360,7 +360,7 @@ add_key_pwd(context, master_eblock, ks_tuple, ks_tuple_count, passwd, pwd.data = passwd; pwd.length = strlen(passwd); if (retval = krb5_string_to_key(context, &key_eblock, - ks_tuple[i].ks_keytype, &key, + ks_tuple[i].ks_enctype, &key, &pwd, &key_salt.data)) return(retval); diff --git a/src/lib/kdb/kdb_xdr.c b/src/lib/kdb/kdb_xdr.c index 66cc23a34..6907f6d1e 100644 --- a/src/lib/kdb/kdb_xdr.c +++ b/src/lib/kdb/kdb_xdr.c @@ -616,16 +616,16 @@ krb5_dbe_free_contents(context, entry) } /* - * Given a particular keytype and optional salttype and kvno, find the + * Given a particular enctype and optional salttype and kvno, find the * most appropriate krb5_key_data entry of the database entry. * * If stype or kvno is negative, it is ignored. */ krb5_error_code -krb5_dbe_find_keytype(kcontext, dbentp, ktype, stype, kvno, kdatap) +krb5_dbe_find_enctype(kcontext, dbentp, ktype, stype, kvno, kdatap) krb5_context kcontext; krb5_db_entry *dbentp; - krb5_keytype ktype; + krb5_enctype ktype; krb5_int32 stype; krb5_int32 kvno; krb5_key_data **kdatap; diff --git a/src/lib/kdb/store_mkey.c b/src/lib/kdb/store_mkey.c index a58d2fe7e..e63c611a4 100644 --- a/src/lib/kdb/store_mkey.c +++ b/src/lib/kdb/store_mkey.c @@ -53,7 +53,7 @@ krb5_db_store_mkey(context, keyfile, mname, key) { FILE *kf; krb5_error_code retval = 0; - krb5_ui_2 keytype; + krb5_ui_2 enctype; char defkeyfile[MAXPATHLEN+1]; krb5_data *realm = krb5_princ_realm(context, mname); #if HAVE_UMASK @@ -83,8 +83,8 @@ krb5_db_store_mkey(context, keyfile, mname, key) #endif return errno; } - keytype = key->keytype; - if ((fwrite((krb5_pointer) &keytype, + enctype = key->enctype; + if ((fwrite((krb5_pointer) &enctype, 2, 1, kf) != 1) || (fwrite((krb5_pointer) &key->length, sizeof(key->length), 1, kf) != 1) || diff --git a/src/lib/kdb/t_kdb.c b/src/lib/kdb/t_kdb.c index 6d23b43d7..fb80528c3 100644 --- a/src/lib/kdb/t_kdb.c +++ b/src/lib/kdb/t_kdb.c @@ -531,13 +531,13 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, goto goodbye; op = "converting master key"; - krb5_use_keytype(kcontext, &master_encblock, DEFAULT_KDC_KEYTYPE); - master_keyblock.keytype = DEFAULT_KDC_KEYTYPE; + krb5_use_enctype(kcontext, &master_encblock, DEFAULT_KDC_ENCTYPE); + master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; passwd.length = strlen(master_passwd); passwd.data = master_passwd; if (kret = krb5_string_to_key(kcontext, &master_encblock, - master_keyblock.keytype, + master_keyblock.enctype, &master_keyblock, &passwd, &salt_data)) @@ -585,7 +585,7 @@ do_testing(db, passes, verbose, timing, rcases, check, save_db, dontclean, goto goodbye; - stat_kb.keytype = DEFAULT_KDC_KEYTYPE; + stat_kb.enctype = DEFAULT_KDC_ENCTYPE; stat_kb.length = 8; stat_kb.contents = (krb5_octet *) "helpmeee"; -- 2.26.2