summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/mk_safe.c
diff options
context:
space:
mode:
authorChris Provenzano <proven@mit.edu>1995-05-01 20:49:56 +0000
committerChris Provenzano <proven@mit.edu>1995-05-01 20:49:56 +0000
commite2ae7095158c1e77655826152bbfa6f5259bfe08 (patch)
treeec8ac62a8f02c86ccf59dec7cc75ee4053a1f929 /src/lib/krb5/krb/mk_safe.c
parent2f95e996eb16770f8c55a5590f8ebd979e60bbe4 (diff)
downloadkrb5-e2ae7095158c1e77655826152bbfa6f5259bfe08.tar.gz
krb5-e2ae7095158c1e77655826152bbfa6f5259bfe08.tar.xz
krb5-e2ae7095158c1e77655826152bbfa6f5259bfe08.zip
* 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
Diffstat (limited to 'src/lib/krb5/krb/mk_safe.c')
-rw-r--r--src/lib/krb5/krb/mk_safe.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/lib/krb5/krb/mk_safe.c b/src/lib/krb5/krb/mk_safe.c
index 29eac3ee36..06c002209d 100644
--- a/src/lib/krb5/krb/mk_safe.c
+++ b/src/lib/krb5/krb/mk_safe.c
@@ -24,7 +24,8 @@
* krb5_mk_safe()
*/
-#include "k5-int.h"
+#include <k5-int.h>
+#include "cleanup.h"
#include "auth_con.h"
/*
@@ -166,11 +167,44 @@ krb5_mk_safe(context, auth_context, userdata, outbuf, outdata)
}
}
+{
+ 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 {
+ goto error;
+ }
+ }
+
+ 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();
+ goto error;
+ }
+ }
+
if (retval = krb5_mk_safe_basic(context, userdata, keyblock, &replaydata,
- auth_context->local_addr,
- auth_context->remote_addr,
- auth_context->cksumtype, outbuf))
+ plocal_fulladdr, premote_fulladdr,
+ auth_context->cksumtype, outbuf)) {
+ CLEANUP_DONE();
goto error;
+ }
+
+ CLEANUP_DONE();
+}
if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) {
krb5_donot_replay replay;