+
+Mon Jun 12 16:49:42 1995 Chris Provenzano (proven@mit.edu)
+
+ A couple bug reports/patches from Ed Phillips (flaregun@udel.edu)
+ * in_tkt_ktb.c (keytab_keyproc()): Fix memory leak.
+ * recvauth.c (krb5_recvauth()): Don't open a new rcache if
+ the auth_context already has one.
+ * auth_con.c (krb5_auth_con_free()): Close rcache is the
+ auth_context has one set.
+ * auth_con.c (krb5_auth_con_getrcache()): Return pointer
+ to the rcache set in the auth_context.
+
Sun Jun 11 12:31:39 1995 Ezra Peisach (epeisach@kangaroo.mit.edu)
* auth_con.c (krb5_auth_con_init): Zero newly allocated
krb5_free_keyblock(context, auth_context->local_subkey);
if (auth_context->remote_subkey)
krb5_free_keyblock(context, auth_context->remote_subkey);
+ if (auth_context->rcache)
+ krb5_rc_close(context, auth_context->rcache);
free(auth_context);
return 0;
}
auth_context->rcache = rcache;
return 0;
}
+
+krb5_error_code
+krb5_auth_con_getrcache(context, auth_context, rcache)
+ krb5_context context;
+ krb5_auth_context auth_context;
+ krb5_rcache * rcache;
+{
+ *rcache = auth_context->rcache;
+ return 0;
+}
+
return(problem); /* We'll return the top-level problem */
}
if (problem)
- return(problem);
+ return(problem);
+
+ /* We are clear of errors here */
-/* Were clear here */
/*
- * Setup the replay cache.
+ * Now, let's read the AP_REQ message and decode it
*/
- if (server) {
- problem = krb5_get_server_rcache(context,
- krb5_princ_component(context, server, 0), &rcache);
- } else {
- null_server.length = 7;
- null_server.data = "default";
- problem = krb5_get_server_rcache(context, &null_server, &rcache);
- }
+ if (retval = krb5_read_message(context, fd, &inbuf))
+ return retval;
- if (!problem) {
- if (krb5_rc_recover(context, rcache)) {
+ if (*auth_context == NULL) {
+ problem = krb5_auth_con_init(context, &new_auth_context);
+ *auth_context = new_auth_context;
+ }
+ if ((!problem) && ((*auth_context)->rcache == NULL)) {
+ /*
+ * Setup the replay cache.
+ */
+ if (server) {
+ problem = krb5_get_server_rcache(context,
+ krb5_princ_component(context, server, 0), &rcache);
+ } else {
+ null_server.length = 7;
+ null_server.data = "default";
+ problem = krb5_get_server_rcache(context, &null_server, &rcache);
+ }
+ if ((!problem) && krb5_rc_recover(context, rcache)) {
/*
* If the rc_recover() didn't work, then try
* initializing the replay cache.
rcache = NULL;
}
}
- }
-
- /*
- * Now, let's read the AP_REQ message and decode it
- */
- if ((retval = krb5_read_message(context, fd, &inbuf))) {
- if (problem) /* Return top level problem */
- retval = problem;
- goto cleanup;
- }
-
- if (!problem) {
- if (*auth_context == NULL) {
- problem = krb5_auth_con_init(context, &new_auth_context);
- *auth_context = new_auth_context;
- }
- }
- if (!problem) {
- problem = krb5_auth_con_setrcache(context, *auth_context, rcache);
+ if (!problem)
+ problem = krb5_auth_con_setrcache(context, *auth_context, rcache);
}
if (!problem) {
problem = krb5_rd_req(context, auth_context, &inbuf, server,
- keytab, &ap_option, ticket);
+ keytab, &ap_option, ticket);
krb5_xfree(inbuf.data);
}
if (retval) {
if (rcache)
krb5_rc_close(context, rcache);
+ krb5_auth_con_free(context, *auth_context);
}
return retval;
}