+
+Tue Dec 12 01:10:34 1995 Chris Provenzano (proven@mit.edu)
+
+ * extern.h: Added a krb5_keytab to the realm context. The keytab
+ should be associated with a krb5_db_context which will
+ make having a krb5_context unnecessary in the realm context.
+ * kdc_util.c kdc_process_tgs_req(): Use the realm keytab instead
+ of faking up a user-to-user key to pass to krb5_rd_req_decode().
+ * main.c: Added code to use the new database keytab routines.
+
Mon Dec 11 16:58:31 1995 Chris Provenzano (proven@mit.edu)
* kdc_preauth.c return_padata(): Initialize local variable "size"
* General Kerberos per-realm data.
*/
char * realm_name; /* Realm name */
+/* XXX the real context should go away once the db_context is done.
+ * The db_context is then associated with the realm keytab using
+ * krb5_ktkdb_resolv(). There should be nothing in the context which
+ * cannot span multiple realms -- proven */
krb5_context realm_context; /* Context to be used for realm */
+ krb5_keytab realm_keytab; /* keytab to be used for this realm */
char * realm_profile; /* Profile file for this realm */
/*
* Database per-realm data.
kdc_rcache)))
goto cleanup_auth_context;
+/*
if ((retval = kdc_get_server_key(apreq->ticket, &key, &kvno)))
goto cleanup_auth_context;
+*/
/*
* XXX This is currently wrong but to fix it will require making a
* new keytab for groveling over the kdb.
*/
+/*
retval = krb5_auth_con_setuseruserkey(kdc_context, auth_context, key);
krb5_free_keyblock(kdc_context, key);
if (retval)
goto cleanup_auth_context;
+*/
if ((retval = krb5_rd_req_decoded(kdc_context, &auth_context, apreq,
- apreq->ticket->server, NULL,
+ apreq->ticket->server,
+ kdc_active_realm->realm_keytab,
NULL, ticket))) {
/*
* I'm not so sure that this is right, but it's better than nothing
(retval == KRB5_RC_IO_UNKNOWN)) {
(void) krb5_rc_close(kdc_context, kdc_rcache);
kdc_rcache = (krb5_rcache) NULL;
- if (!(retval = kdc_initialize_rcache(kdc_context,
- (char *) NULL))) {
- if ((retval = krb5_auth_con_setrcache(kdc_context,
- auth_context,
+ if (!(retval = kdc_initialize_rcache(kdc_context, (char *) NULL))) {
+ if ((retval = krb5_auth_con_setrcache(kdc_context, auth_context,
kdc_rcache)) ||
- (retval = krb5_rd_req_decoded(kdc_context,
- &auth_context,
- apreq,
- apreq->ticket->server,
- NULL,
- NULL,
- ticket))
+ (retval = krb5_rd_req_decoded(kdc_context, &auth_context,
+ apreq, apreq->ticket->server,
+ kdc_active_realm->realm_keytab,
+ NULL, ticket))
)
goto cleanup_auth_context;
}
- }
- else
+ } else
goto cleanup_auth_context;
}
return retval;
}
+/* XXX This function should no longer be necessary.
+ * The KDC should take the keytab associated with the realm and pass that to
+ * the krb5_rd_req_decode(). --proven
+ */
krb5_error_code
kdc_get_server_key(ticket, key, kvno)
krb5_ticket * ticket;
#include "kdc_util.h"
#include "extern.h"
#include "kdc5_err.h"
+#include "kdb_dbc.h"
#ifdef KRB5_USE_INET
#include <netinet/in.h>
#endif
free(rdp->realm_ports);
if (rdp->realm_kstypes)
free(rdp->realm_kstypes);
+ if (rdp->realm_keytab)
+ krb5_kt_close(rdp->realm_context, rdp->realm_keytab);
if (rdp->realm_context) {
if (rdp->realm_mprinc)
krb5_free_principal(rdp->realm_context, rdp->realm_mprinc);
char *def_ports;
krb5_boolean def_manual;
{
+ krb5_db_context db_context;
krb5_error_code kret;
krb5_boolean manual;
krb5_db_entry db_entry;
goto whoops;
}
+/* Set master encblock with db_context */
+if ((kret = krb5_dbm_db_set_mkey(rdp->realm_context, &db_context,
+ &rdp->realm_encblock))) {
+com_err(progname, kret, "while setting master key for realm %s", realm);
+goto whoops;
+}
+
+/* Set up the keytab */
+if (kret = krb5_ktkdb_resolve(rdp->realm_context, &db_context,
+ &rdp->realm_keytab)) {
+com_err(progname, kret, "while resolving kdb keytab for realm %s", realm);
+goto whoops;
+}
+
/* Preformat the TGS name */
if ((kret = krb5_build_principal(rdp->realm_context,
&rdp->realm_tgsprinc,