+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)
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(
* 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;
/*
* 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,
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);
} 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;
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;
}
typedef struct _old_krb5_encrypted_keyblock {
- krb5_keytype keytype;
+ krb5_enctype enctype;
int length;
krb5_octet *contents;
} old_krb5_encrypted_keyblock;
*/
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;
}
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;
}
}
/* 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;
}
*/
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;
}
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);
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);
}
/*
- * 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;
{
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
#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) ||
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))
goto goodbye;
- stat_kb.keytype = DEFAULT_KDC_KEYTYPE;
+ stat_kb.enctype = DEFAULT_KDC_ENCTYPE;
stat_kb.length = 8;
stat_kb.contents = (krb5_octet *) "helpmeee";