summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/rd_priv.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-04-08 15:58:24 +0000
committerGreg Hudson <ghudson@mit.edu>2009-04-08 15:58:24 +0000
commit40e425b53b10f753fb62caff577d2679cdd6325b (patch)
treec786746c59f217446923a49ba42fbc4380f6eb57 /src/lib/krb5/krb/rd_priv.c
parente4a65c8b42384add772624273d1b03ba0689a3dc (diff)
downloadkrb5-40e425b53b10f753fb62caff577d2679cdd6325b.tar.gz
krb5-40e425b53b10f753fb62caff577d2679cdd6325b.tar.xz
krb5-40e425b53b10f753fb62caff577d2679cdd6325b.zip
mk_safe and mk_priv require the local address to be set in the auth
context; rd_safe and rd_priv require the remote address to be set. Create error codes for both kinds of missing addresses and stop trying futilely to handle the cases where they are not set. ticket: 1165 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22184 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/rd_priv.c')
-rw-r--r--src/lib/krb5/krb/rd_priv.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/krb5/krb/rd_priv.c b/src/lib/krb5/krb/rd_priv.c
index 7d1dbc3cae..eaeaed894b 100644
--- a/src/lib/krb5/krb/rd_priv.c
+++ b/src/lib/krb5/krb/rd_priv.c
@@ -169,12 +169,15 @@ krb5_rd_priv(krb5_context context, krb5_auth_context auth_context,
/* Need a better error */
return KRB5_RC_REQUIRED;
+ if (!auth_context->remote_addr)
+ return KRB5_REMOTE_ADDR_REQUIRED;
+
if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_TIME) &&
(auth_context->rcache == NULL))
return KRB5_RC_REQUIRED;
{
- krb5_address * premote_fulladdr = NULL;
+ krb5_address * premote_fulladdr;
krb5_address * plocal_fulladdr = NULL;
krb5_address remote_fulladdr;
krb5_address local_fulladdr;
@@ -195,20 +198,18 @@ krb5_rd_priv(krb5_context context, krb5_auth_context auth_context,
}
}
- if (auth_context->remote_addr) {
- if (auth_context->remote_port) {
- 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 (auth_context->remote_port) {
+ 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 {
- premote_fulladdr = auth_context->remote_addr;
- }
+ CLEANUP_DONE();
+ return retval;
+ }
+ } else {
+ premote_fulladdr = auth_context->remote_addr;
}
memset(&replaydata, 0, sizeof(replaydata));