+Tue Aug 15 14:29:26 EDT 1995 Paul Park (pjpark@mit.edu)
+ * adm_{adm_func,fmt_inq,funcs,process,server}.c, adm_extern.h - Replace
+ adm_find_keytype() with krb5_dbe_find_keytype().
+
+
Thu Aug 10 14:38:14 EDT 1995 Paul Park (pjpark@mit.edu)
* adm_funcs.c - Rework adm_modify_kdb() to use kdb5's change-password
interfaces. Gut callers of adm_modify_kdb() because most of
if (oper_type == CHGOPER || oper_type == CH4OPER) {
key_data = (krb5_key_data *) NULL;
- if (adm_find_keytype(&entry,
- KEYTYPE_DES,
- ((oper_type == CHGOPER) ?
- KRB5_KDB_SALTTYPE_NORMAL : KRB5_KDB_SALTTYPE_V4),
- &key_data)) {
+ if (krb5_dbe_find_keytype(context,
+ &entry,
+ KEYTYPE_DES,
+ ((oper_type == CHGOPER) ?
+ KRB5_KDB_SALTTYPE_NORMAL :
+ KRB5_KDB_SALTTYPE_V4),
+ -1,
+ &key_data)) {
com_err("adm_build_key", ENOENT, "finding key data");
+ return(4); /* Unable to get password */
}
outbuf.data[3] = key_data->key_data_type[1];
outbuf.length = 4;
* We could loop through all the supported key/salt types, but
* we don't have that technology yet.
*/
- if (!adm_find_keytype(&entry,
- KEYTYPE_DES,
- KRB5_KDB_SALTTYPE_NORMAL,
- &kdata))
+ if (!krb5_dbe_find_keytype(context,
+ &entry,
+ KEYTYPE_DES,
+ KRB5_KDB_SALTTYPE_NORMAL,
+ -1,
+ &kdata))
kdata->key_data_kvno = atoi(tempstr);
- if (!adm_find_keytype(&entry,
- KEYTYPE_DES,
- KRB5_KDB_SALTTYPE_V4,
- &kdata))
+ if (!krb5_dbe_find_keytype(context,
+ &entry,
+ KEYTYPE_DES,
+ KRB5_KDB_SALTTYPE_V4,
+ -1,
+ &kdata))
kdata->key_data_kvno = atoi(tempstr);
- if (!adm_find_keytype(&entry,
- KEYTYPE_DES,
- KRB5_KDB_SALTTYPE_NOREALM,
- &kdata))
+ if (!krb5_dbe_find_keytype(context,
+ &entry,
+ KEYTYPE_DES,
+ KRB5_KDB_SALTTYPE_NOREALM,
+ -1,
+ &kdata))
kdata->key_data_kvno = atoi(tempstr);
- if (!adm_find_keytype(&entry,
- KEYTYPE_DES,
- KRB5_KDB_SALTTYPE_ONLYREALM,
- &kdata))
+ if (!krb5_dbe_find_keytype(context,
+ &entry,
+ KEYTYPE_DES,
+ KRB5_KDB_SALTTYPE_ONLYREALM,
+ -1,
+ &kdata))
kdata->key_data_kvno = atoi(tempstr);
}
int,
krb5_db_entry *));
-krb5_error_code adm_find_keytype
- PROTOTYPE((krb5_db_entry *,
- krb5_keytype,
- krb5_int32,
- krb5_key_data **));
-
krb5_error_code adm_update_tl_attrs
PROTOTYPE((krb5_context,
krb5_db_entry *,
entry->max_renewable_life);
strcat(my_data, thisline);
pkey = (krb5_key_data *) NULL;
- if (retval = adm_find_keytype(entry,
- KEYTYPE_DES,
- KRB5_KDB_SALTTYPE_NORMAL,
- &pkey)) {
+ if (retval = krb5_dbe_find_keytype(context,
+ entry,
+ KEYTYPE_DES,
+ KRB5_KDB_SALTTYPE_NORMAL,
+ -1,
+ &pkey)) {
free(my_data);
return retval;
}
return(retval);
}
-krb5_error_code
-adm_find_keytype(dbentp, keytype, salttype, kentp)
- krb5_db_entry *dbentp;
- krb5_keytype keytype;
- krb5_int32 salttype;
- krb5_key_data **kentp;
-{
- int i;
- int maxkvno;
- krb5_key_data *datap;
-
- 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) &&
- ((dbentp->key_data[i].key_data_type[1] == salttype) ||
- (salttype < 0))) {
- maxkvno = dbentp->key_data[i].key_data_kvno;
- datap = &dbentp->key_data[i];
- }
- }
- if (maxkvno >= 0) {
- *kentp = datap;
- return(0);
- }
- return(ENOENT);
-}
-
krb5_error_code
adm_update_tl_attrs(kcontext, dbentp, mod_name, is_pwchg)
krb5_context kcontext;
}
/* Find our key */
- if (retval = adm_find_keytype(&cpw_entry,
- KEYTYPE_DES,
- -1,
- &kdatap)) {
+ if (retval = krb5_dbe_find_keytype(context,
+ &cpw_entry,
+ KEYTYPE_DES,
+ -1,
+ -1,
+ &kdatap)) {
krb5_db_free_principal(context, &cpw_entry, nprincs);
syslog(LOG_ERR, "cpw_keyproc: cannot find server DES key");
close(client_server_info.client_socket);
}
/* Find our key */
- if (retval = adm_find_keytype(&server_entry,
- KEYTYPE_DES,
- -1,
- &kdatap)) {
+ if (retval = krb5_dbe_find_keytype(context,
+ &server_entry,
+ KEYTYPE_DES,
+ -1,
+ -1,
+ &kdatap)) {
krb5_db_free_principal(context, &server_entry, number_of_entries);
syslog(LOG_ERR,
"kadmind error: cannot find server DES key");
convert server.key into a real key
(it may be encrypted in the database)
*/
- if (retval = adm_find_keytype(&server_entry,
- KEYTYPE_DES,
- -1,
- &kdatap)) {
+ if (retval = krb5_dbe_find_keytype(context,
+ &server_entry,
+ KEYTYPE_DES,
+ -1,
+ -1,
+ &kdatap)) {
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));