From e2ae7095158c1e77655826152bbfa6f5259bfe08 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Mon, 1 May 1995 20:49:56 +0000 Subject: * auth_con.c (krb5_auth_con_free()) : Free all the data associated with the auth_context. * auth_con.c (krb5_auth_con_setkey()) : Removed. * mk_rep.c (mk_rep()), The krb5_mk_rep() routine must always encode the data in the keyblock of the ticket, not the subkey. * cleanup.h, auth_con.c (krb5_auth_con_setports()) : Added. * auth_con.h, mk_cred.c (mk_cred()), mk_priv.c (mk_priv()), * mk_safe.c (mk_safe()), rd_cred.c (rd_cred()), * rd_priv.c (rd_priv()), rd_safe.c (rd_safe()) : Changes to auth_context to better support full addresses. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5677 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/rd_cred.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'src/lib/krb5/krb/rd_cred.c') diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index f221d9a..8e18a30 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -1,4 +1,5 @@ #include +#include "cleanup.h" #include "auth_con.h" #include /* NULL */ @@ -232,10 +233,44 @@ krb5_rd_cred(context, auth_context, pcreddata, pppcreds, outdata) (auth_context->rcache == NULL)) return KRB5_RC_REQUIRED; +{ + krb5_address * premote_fulladdr = NULL; + krb5_address * plocal_fulladdr = NULL; + krb5_address remote_fulladdr; + krb5_address local_fulladdr; + CLEANUP_INIT(2); + + if (auth_context->local_addr) { + if (!(retval = krb5_make_fulladdr(context, auth_context->local_addr, + auth_context->local_port, &local_fulladdr))){ + CLEANUP_PUSH(&local_fulladdr.contents, free); + plocal_fulladdr = &local_fulladdr; + } else { + return retval; + } + } + + if (auth_context->remote_addr) { + if (!(retval = krb5_make_fulladdr(context, auth_context->remote_addr, + auth_context->remote_port, &remote_fulladdr))){ + CLEANUP_PUSH(&remote_fulladdr.contents, free); + premote_fulladdr = &remote_fulladdr; + } else { + CLEANUP_DONE(); + return retval; + } + } + if (retval = krb5_rd_cred_basic(context, pcreddata, keyblock, - auth_context->local_addr, auth_context->remote_addr, - &replaydata, pppcreds)) + plocal_fulladdr, premote_fulladdr, + &replaydata, pppcreds)) { + CLEANUP_DONE(); return retval; + } + + CLEANUP_DONE(); +} + if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) { krb5_donot_replay replay; -- cgit v1.1