+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)
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
}
}
-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
}
\f
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;
{
maxkvno = -1;
datap = (krb5_key_data *) NULL;
for (i=0; i<dbentp->n_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;
/*
* 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);
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)) {
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));
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);
}
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;
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;
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 */
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))) {
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,
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);
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;
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;
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++;
}
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 */
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) {
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);