+Thu Aug 3 11:46:10 EDT 1995 Paul Park (pjpark@mit.edu)
+ * adm_{adm_func,fmt_inq,funcs,process,server}.c - In order to get
+ things to compile, replace "salt_type" with "key_data[0].
+ key_data_type[1]", "kvno" with "key_data[0].key_data_kvno"
+ blindly. Also #ifdef out anything having to do with mod_name
+ mod_date and last_pwd_change. Change "principal" to "princ"
+ and remove or replace references to "key" and "alt_key".
+
+
Mon Jul 17 15:11:40 EDT 1995 Paul Park (pjpark@mit.edu)
* adm_server.c - Add NULL stash file argument to krb5_db_fetch_mkey().
outbuf.length = 3;
if (oper_type == CHGOPER || oper_type == CH4OPER) {
- outbuf.data[3] = entry.salt_type;
+ outbuf.data[3] = entry.key_data[0].key_data_type[1];
outbuf.length = 4;
}
retval = krb5_unparse_name(context, newprinc, &composite_name);
- entry.salt_type = (krb5_int32) salttype;
+ entry.key_data[0].key_data_type[1] = (krb5_int16) salttype;
if (retval = adm_enter_pwd_key(context, "adm_change_pwd",
composite_name,
if (msg_data.data[3] == KMODVNO) {
(void) memcpy(tempstr, (char *) msg_data.data + 4,
msg_data.length - 4);
- entry.kvno = atoi(tempstr);
+ entry.key_data[0].key_data_kvno = atoi(tempstr);
}
if (msg_data.data[3] == KMODATTR) {
}
free(msg_data.data);
+#ifdef notdef
entry.mod_name = client_server_info.client;
if (retval = krb5_timeofday(context, &entry.mod_date)) {
com_err("adm_mod_old_key", retval, "while fetching date");
krb5_db_free_principal(context, &entry, nprincs);
return(5); /* Protocol Failure */
}
+#endif /* notdef */
retval = krb5_db_put_principal(context, &entry, &one);
if (retval) {
sprintf(thisline, "Maximum Renewal Lifetime (MRL) = %d (seconds)\n",
entry->max_renewable_life);
strcat(my_data, thisline);
- sprintf(thisline, "Principal Key Version (PKV) = %d\n", entry->kvno);
+ sprintf(thisline, "Principal Key Version (PKV) = %d\n",
+ entry->key_data[0].key_data_kvno);
strcat(my_data, thisline);
if (retval = adm_print_exp_time(context, my_data, &entry->expiration)) {
free(my_data);
return retval;
}
+#ifdef notdef
mod_time = localtime((time_t *) &entry->mod_date);
sprintf(thisline,
"Last Modification Date (LMD): %02d%02d/%02d/%02d:%02d:%02d:%02d\n",
mod_time->tm_min,
mod_time->tm_sec);
strcat(my_data, thisline);
+#endif /* notdef */
if (retval = adm_print_attributes(my_data, entry->attributes)) {
free(my_data);
return retval;
}
- switch (entry->salt_type & 0xff) {
+ switch (entry->key_data[0].key_data_type[1] & 0xff) {
case 0 : strcat(my_data,
"Principal Salt Type (PST) = Version 5 Normal\n");
break;
if (!req_type) { /* New entry - initialize */
memset((char *) entry, 0, sizeof(krb5_db_entry));
- retval = krb5_copy_principal(context, principal, &entry->principal);
+ retval = krb5_copy_principal(context, principal, &entry->princ);
if (retval)
return retval;
- entry->kvno = KDB5_VERSION_NUM;
entry->max_life = master_entry.max_life;
entry->max_renewable_life = master_entry.max_renewable_life;
- entry->mkvno = master_entry.mkvno;
entry->expiration = master_entry.expiration;
+#ifdef notdef
+ entry->kvno = KDB5_VERSION_NUM;
+ entry->mkvno = master_entry.mkvno;
retval = krb5_copy_principal(context, master_princ, &entry->mod_name);
if (retval) {
krb5_free_principal(context, entry->principal);
entry->principal = 0;
return retval;
}
+#endif /* notdef */
} else { /* Modify existing entry */
- entry->kvno++;
#ifdef SANDIA
entry->attributes &= ~KRB5_KDB_REQUIRES_PWCHANGE;
#endif
+#ifdef notdef
+ entry->kvno++;
retval = krb5_copy_principal(context, principal, &entry->mod_name);
if (retval)
return retval;
+#endif /* notdef */
}
+#ifdef notdef
if (key && key->length) {
retval = krb5_kdb_encrypt_key(context, &master_encblock,
key,
return(5);
}
}
+#endif /* notdef */
retval = krb5_db_put_principal(context, entry, &one);
- if (entry->key.contents) {
- memset((char *) entry->key.contents, 0, entry->key.length);
- krb5_xfree(entry->key.contents);
- entry->key.contents = 0;
- }
-
- if (entry->alt_key.contents) {
- memset((char *) entry->alt_key.contents, 0, entry->alt_key.length);
- krb5_xfree(entry->alt_key.contents);
- entry->alt_key.contents = 0;
- }
-
if (retval) {
com_err("adm_modify_kdb", retval,
"while storing entry for '%s'\n", newprinc);
return retval;
}
+#ifdef notdef
if (entry.salt_type == KRB5_KDB_SALTTYPE_V4) {
entry.salt_type = KRB5_KDB_SALTTYPE_NORMAL;
entry.alt_salt_type = KRB5_KDB_SALTTYPE_V4;
com_err("adm5_change", 0, "Converting v4user to v5user");
}
+#endif /* notdef */
retval = adm_enter_pwd_key(context, "adm5_change",
composite_name,
struct saltblock salt;
char *principal_name;
+#ifdef notdef
salt.salttype = salttype;
entry->salt_type = salttype;
+#endif /* notdef */
if (retval = krb5_init_random_key(context, &master_encblock,
&master_keyblock,
krb5_keyblock *realkey;
krb5_boolean more;
int nprincs = 1;
+ krb5_keysalt salt;
if (*keyblock == NULL) {
if (retval = krb5_parse_name(context,
}
/* Extract the real kadmin/<realm> keyblock */
- if (retval = krb5_kdb_decrypt_key(context,
+ if (retval = krb5_dbekd_decrypt_key_data(context,
&master_encblock,
- &cpw_entry.key,
- realkey)) {
+ &cpw_entry.key_data[0],
+ realkey,
+ &salt)) {
krb5_db_free_principal(context, &cpw_entry, nprincs);
free(realkey);
syslog(LOG_ERR,
krb5_data outbuf;
krb5_data inbuf, msg_data;
extern int errno;
+ krb5_keysalt salt;
krb5_timestamp adm_time;
}
/* Extract the real kadmin/<realm> keyblock */
- if (retval = krb5_kdb_decrypt_key(context,
+ if (retval = krb5_dbekd_decrypt_key_data(context,
&master_encblock,
- &server_entry.key,
- cpw_keyblock)) {
+ &server_entry.key_data[0],
+ cpw_keyblock,
+ &salt)) {
krb5_db_free_principal(context, &server_entry, number_of_entries);
free(cpw_keyblock);
syslog(LOG_ERR,
krb5_boolean more;
int number_of_entries;
char tgs_name[255];
+ krb5_keysalt salt;
/* set db name if appropriate */
if (dbname && (retval = krb5_db_set_name(context, dbname)))
convert server.key into a real key
(it may be encrypted in the database)
*/
- if (retval = krb5_kdb_decrypt_key(context,&master_encblock,
- &server_entry.key,&tgs_key)) {
+ if (retval = krb5_dbekd_decrypt_key_data(context,&master_encblock,
+ &server_entry.key_data[0],&tgs_key,
+ &salt)) {
krb5_db_free_principal(context, &server_entry, number_of_entries);
(void) krb5_finish_key(context, &master_encblock);
memset((char *)&master_encblock, 0, sizeof(master_encblock));
return(retval);
}
- tgs_kvno = server_entry.kvno;
+ tgs_kvno = server_entry.key_data[0].key_data_kvno;
krb5_db_free_principal(context, &server_entry, number_of_entries);
return(0);
}