From 527f1eaca9cab3f3e9950ce2fe85dc5f6f34005b Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Wed, 6 Sep 1995 18:59:17 +0000 Subject: [PATCH] * cpw.c, dump.c, dumpv4.c, kdb5_edit.c, loadv4.c : s/keytype/enctype/g, s/KEYTYPE/ENCTYPE/g git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6698 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/edit/ChangeLog | 4 ++++ src/admin/edit/cpw.c | 4 ++-- src/admin/edit/dump.c | 14 +++++++------- src/admin/edit/dumpv4.c | 4 ++-- src/admin/edit/kdb5_edit.c | 32 ++++++++++++++++---------------- src/admin/edit/loadv4.c | 30 +++++++++++++++--------------- 6 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index ecd3eed00..5814b0146 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,7 @@ +Wed Sep 06 14:20:57 1995 Chris Provenzano (proven@mit.edu) + + * cpw.c, dump.c, dumpv4.c, kdb5_edit.c, loadv4.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/admin/edit/cpw.c b/src/admin/edit/cpw.c index efd023c92..4dacbc63f 100644 --- a/src/admin/edit/cpw.c +++ b/src/admin/edit/cpw.c @@ -51,7 +51,7 @@ extern char *krb5_default_pwd_prompt1, *krb5_default_pwd_prompt2; extern krb5_boolean dbactive; extern FILE *scriptfile; -static krb5_key_salt_tuple ks_tuple_rnd_def[] = {{ KEYTYPE_DES_CBC_CRC, 0 }}; +static krb5_key_salt_tuple ks_tuple_rnd_def[] = {{ ENCTYPE_DES_CBC_CRC, 0 }}; static int ks_tuple_rnd_def_count = 1; static void @@ -180,7 +180,7 @@ void change_rnd_key(argc, argv) } } -static krb5_key_salt_tuple ks_tuple_default[] = {{ KEYTYPE_DES_CBC_CRC, 0 }}; +static krb5_key_salt_tuple ks_tuple_default[] = {{ ENCTYPE_DES_CBC_CRC, 0 }}; static int ks_tuple_count_default = 1; void diff --git a/src/admin/edit/dump.c b/src/admin/edit/dump.c index bbf2d09d0..c0aaa72ee 100644 --- a/src/admin/edit/dump.c +++ b/src/admin/edit/dump.c @@ -275,9 +275,9 @@ name_matches(name, arglist) } static krb5_error_code -find_keytype(dbentp, keytype, salttype, kentp) +find_enctype(dbentp, enctype, salttype, kentp) krb5_db_entry *dbentp; - krb5_keytype keytype; + krb5_enctype enctype; krb5_int32 salttype; krb5_key_data **kentp; { @@ -288,7 +288,7 @@ find_keytype(dbentp, keytype, salttype, kentp) maxkvno = -1; datap = (krb5_key_data *) NULL; for (i=0; in_key_data; i++) { - if ((dbentp->key_data[i].key_data_type[0] == keytype) && + if ((dbentp->key_data[i].key_data_type[0] == enctype) && ((dbentp->key_data[i].key_data_type[1] == salttype) || (salttype < 0))) { maxkvno = dbentp->key_data[i].key_data_kvno; @@ -397,12 +397,12 @@ dump_k5beta_iterator(ptr, entry) /* * Find the 'primary' key and the 'alternate' key. */ - if ((retval = find_keytype(entry, - KEYTYPE_DES_CBC_CRC, + if ((retval = find_enctype(entry, + ENCTYPE_DES_CBC_CRC, KRB5_KDB_SALTTYPE_NORMAL, &pkey)) && - (retval = find_keytype(entry, - KEYTYPE_DES_CBC_CRC, + (retval = find_enctype(entry, + ENCTYPE_DES_CBC_CRC, KRB5_KDB_SALTTYPE_V4, &akey))) { fprintf(stderr, nokeys_err, arg->programname, name); diff --git a/src/admin/edit/dumpv4.c b/src/admin/edit/dumpv4.c index 286e5180e..84c501cc6 100644 --- a/src/admin/edit/dumpv4.c +++ b/src/admin/edit/dumpv4.c @@ -334,7 +334,7 @@ int handle_keys(arg) exit(1); } - krb5_use_keytype(edit_context, &master_encblock, DEFAULT_KDC_KEYTYPE); + krb5_use_enctype(edit_context, &master_encblock, DEFAULT_KDC_ENCTYPE); if (retval = krb5_db_fetch_mkey(edit_context, master_princ, &master_encblock, 0, 0, (char *) NULL, 0, &master_keyblock)) { @@ -367,7 +367,7 @@ handle_one_key(arg, v5master, v5key, v4key) return retval; /* v4v5key.contents = (krb5_octet *)v4key; */ - /* v4v5key.keytype = KEYTYPE_DES; */ + /* v4v5key.enctype = ENCTYPE_DES; */ /* v4v5key.length = sizeof(v4key); */ memcpy(v4key, v5plainkey.contents, sizeof(des_cblock)); diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 90a6b2bea..98f6998d7 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -78,7 +78,7 @@ usage(who, status) fprintf(stderr, "usage: %s [-d dbpathname] [-r realmname] [-R request ]\n", who); - fprintf(stderr, "\t [-k keytype] [-M mkeyname]\n"); + fprintf(stderr, "\t [-k enctype] [-M mkeyname]\n"); exit(status); } @@ -107,7 +107,7 @@ char *kdb5_edit_Init(argc, argv) krb5_error_code retval; char *dbname = (char *) NULL; char *defrealm; - int keytypedone = 0; + int enctypedone = 0; extern krb5_kt_ops krb5_ktf_writable_ops; char *request = NULL; krb5_realm_params *rparams; @@ -147,10 +147,10 @@ char *kdb5_edit_Init(argc, argv) request = optarg; break; case 'k': - if (!krb5_string_to_keytype(optarg, &master_keyblock.keytype)) - keytypedone++; + if (!krb5_string_to_enctype(optarg, &master_keyblock.enctype)) + enctypedone++; else - com_err(argv[0], 0, "%s is an invalid keytype", optarg); + com_err(argv[0], 0, "%s is an invalid enctype", optarg); break; case 'M': /* master key name in DB */ mkey_name = optarg; @@ -191,9 +191,9 @@ char *kdb5_edit_Init(argc, argv) mkey_name = strdup(rparams->realm_mkey_name); /* Get the value for the master key type */ - if (rparams->realm_keytype_valid && !keytypedone) { - master_keyblock.keytype = rparams->realm_keytype; - keytypedone++; + if (rparams->realm_enctype_valid && !enctypedone) { + master_keyblock.enctype = rparams->realm_enctype; + enctypedone++; } /* Get the value for the stashfile */ @@ -234,20 +234,20 @@ char *kdb5_edit_Init(argc, argv) if (!dbname) dbname = DEFAULT_KDB_FILE; - if (!keytypedone) - master_keyblock.keytype = DEFAULT_KDC_KEYTYPE; + if (!enctypedone) + master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; - if (!valid_keytype(master_keyblock.keytype)) { + if (!valid_enctype(master_keyblock.enctype)) { char tmp[32]; - if (krb5_keytype_to_string(master_keyblock.keytype, tmp, sizeof(tmp))) + if (krb5_enctype_to_string(master_keyblock.enctype, tmp, sizeof(tmp))) com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, - "while setting up keytype %d", master_keyblock.keytype); + "while setting up enctype %d", master_keyblock.enctype); else com_err(argv[0], KRB5_PROG_KEYTYPE_NOSUPP, tmp); exit(1); } - krb5_use_keytype(edit_context, &master_encblock, master_keyblock.keytype); + krb5_use_enctype(edit_context, &master_encblock, master_keyblock.enctype); if (cur_realm) { if ((retval = krb5_set_default_realm(edit_context, cur_realm))) { @@ -460,7 +460,7 @@ set_dbname_help(pname, dbname) return(1); } retval = krb5_string_to_key(edit_context, &master_encblock, - master_keyblock.keytype, + master_keyblock.enctype, &master_keyblock, &pwd, &scratch); if (retval) { com_err(pname, retval, @@ -803,7 +803,7 @@ void extract_v4_srvtab(argc, argv) exit_status++; goto cleanall; } - if (key.keytype != 1) { + if (key.enctype != 1) { com_err(argv[0], 0, "%s does not have a DES key!", pname); exit_status++; memset((char *)key.contents, 0, key.length); diff --git a/src/admin/edit/loadv4.c b/src/admin/edit/loadv4.c index 5ae9400b8..e72c7996a 100644 --- a/src/admin/edit/loadv4.c +++ b/src/admin/edit/loadv4.c @@ -90,7 +90,7 @@ usage(who, status) char *who; int status; { - fprintf(stderr, "usage: %s [-d v5dbpathname] [-t] [-n] [-r realmname] [-K] [-k keytype]\n\ + fprintf(stderr, "usage: %s [-d v5dbpathname] [-t] [-n] [-r realmname] [-K] [-k enctype]\n\ \t[-M mkeyname] -f inputfile\n", who); return; @@ -142,7 +142,7 @@ char *argv[]; char *mkey_name = 0; char *mkey_fullname; char *defrealm; - int keytypedone = 0; + int enctypedone = 0; int v4manual = 0; int read_mkey = 0; int tempdb = 0; @@ -183,11 +183,11 @@ char *argv[]; verbose = 1; } else if (!strcmp(argv[op_ind], "-k") && ((argc - op_ind) >= 2)) { - if (!krb5_string_to_keytype(argv[op_ind+1], - &master_keyblock.keytype)) - keytypedone++; + if (!krb5_string_to_enctype(argv[op_ind+1], + &master_keyblock.enctype)) + enctypedone++; else - com_err(argv[0], 0, "%s is an invalid keytype", + com_err(argv[0], 0, "%s is an invalid enctype", argv[op_ind+1]); op_ind++; } @@ -229,9 +229,9 @@ char *argv[]; mkey_name = strdup(rparams->realm_mkey_name); /* Get the value for the master key type */ - if (rparams->realm_keytype_valid && !keytypedone) { - master_keyblock.keytype = rparams->realm_keytype; - keytypedone++; + if (rparams->realm_enctype_valid && !enctypedone) { + master_keyblock.enctype = rparams->realm_enctype; + enctypedone++; } /* Get the value for the stashfile */ @@ -262,16 +262,16 @@ char *argv[]; return; } - if (!keytypedone) - master_keyblock.keytype = DEFAULT_KDC_KEYTYPE; + if (!enctypedone) + master_keyblock.enctype = DEFAULT_KDC_ENCTYPE; - if (!valid_keytype(master_keyblock.keytype)) { + if (!valid_enctype(master_keyblock.enctype)) { com_err(PROGNAME, KRB5_PROG_KEYTYPE_NOSUPP, - "while setting up keytype %d", master_keyblock.keytype); + "while setting up enctype %d", master_keyblock.enctype); return; } - krb5_use_keytype(context, &master_encblock, master_keyblock.keytype); + krb5_use_enctype(context, &master_encblock, master_keyblock.enctype); /* If the user has not requested locking, don't modify an existing database. */ if (! tempdb) { @@ -530,7 +530,7 @@ Principal *princ; v4v5key.magic = KV5M_KEYBLOCK; v4v5key.contents = (krb5_octet *)v4key; - v4v5key.keytype = KEYTYPE_DES_CBC_CRC; + v4v5key.enctype = ENCTYPE_DES_CBC_CRC; v4v5key.length = sizeof(v4key); retval = krb5_dbe_create_key_data(context, &entry); -- 2.26.2