From: Chris Provenzano Date: Thu, 27 Apr 1995 02:14:06 +0000 (+0000) Subject: * server.c, client.c : Use krb5_auth_con_genaddrs() instead of X-Git-Tag: krb5-1.0-beta5~221 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c562ba8d00f0a1f1e8035e7e6c7949d7c68212c;p=krb5.git * server.c, client.c : Use krb5_auth_con_genaddrs() instead of krb5_auth_con_setaddrs(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5531 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/user_user/ChangeLog b/src/appl/user_user/ChangeLog index df804b0ac..9c79fbfa2 100644 --- a/src/appl/user_user/ChangeLog +++ b/src/appl/user_user/ChangeLog @@ -1,4 +1,10 @@ -Mon Mar 27 07:56:26 1995 Chris Provenzano (proven@mit.edu) + +Wed Apr 26 22:12:26 1995 Chris Provenzano (proven@mit.edu) + + * server.c, client.c : Use krb5_auth_con_genaddrs() instead of + krb5_auth_con_setaddrs(). + +Mon Mar 27 07:56:26 11995 Chris Provenzano (proven@mit.edu) * server.c: Use new calling conventions for krb5_sendauth(), krb5_mk_req_extended(), and krb5_mk_safe(). diff --git a/src/appl/user_user/client.c b/src/appl/user_user/client.c index ea6d39e66..4679fbf1d 100644 --- a/src/appl/user_user/client.c +++ b/src/appl/user_user/client.c @@ -47,7 +47,6 @@ char *argv[]; struct servent *serv; struct hostent *host; struct sockaddr_in serv_net_addr, cli_net_addr; - krb5_address serv_addr, cli_addr; krb5_ccache cc; krb5_creds creds, *new_creds; krb5_data reply, msg, princ_data; @@ -206,31 +205,25 @@ char *argv[]; com_err("uu-client", retval, "reading reply from server"); return 9; } - serv_addr.addrtype = ADDRTYPE_INET; - serv_addr.length = sizeof (serv_net_addr.sin_addr); - serv_addr.contents = (krb5_octet *)&serv_net_addr.sin_addr; - - cli_addr.addrtype = ADDRTYPE_INET; - cli_addr.length = sizeof(cli_net_addr.sin_addr); - cli_addr.contents = (krb5_octet *)&cli_net_addr.sin_addr; if (retval = krb5_auth_con_init(context, &auth_context)) { com_err("uu-client", retval, "initializing the auth_context"); return 9; } + if (retval = krb5_auth_con_genaddrs(context, auth_context, s, + KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR | + KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR)) { + com_err("uu-client", retval, "generating addrs for auth_context"); + return 9; + } + if (retval = krb5_auth_con_setflags(context, auth_context, KRB5_AUTH_CONTEXT_DO_SEQUENCE)) { com_err("uu-client", retval, "initializing the auth_context flags"); return 9; } - if (retval = krb5_auth_con_setaddrs(context, auth_context, &cli_addr, - &serv_addr)) { - com_err("uu-client", retval, "setting addresses for auth_context"); - return 9; - } - if (retval = krb5_auth_con_setuseruserkey(context, auth_context, &new_creds->keyblock)) { com_err("uu-client", retval, "setting useruserkey for authcontext"); @@ -247,6 +240,14 @@ char *argv[]; 0, /* server */, NULL, 0, NULL, &ticket); #endif +/* XXX This will be removed -- proven */ + if (retval = krb5_auth_con_genaddrs(context, auth_context, s, + KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR | + KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR)) { + com_err("uu-client", retval, "generating addrs for auth_context"); + return 9; + } + if (retval) { com_err("uu-client", retval, "reading AP_REQ from server"); return 9; diff --git a/src/appl/user_user/server.c b/src/appl/user_user/server.c index 175fce123..f20347a8e 100644 --- a/src/appl/user_user/server.c +++ b/src/appl/user_user/server.c @@ -47,7 +47,6 @@ char *argv[]; int l, sock = 0; int retval; struct sockaddr_in l_inaddr, f_inaddr; /* local, foreign address */ - krb5_address laddr, faddr; krb5_creds creds, *new_creds; krb5_ccache cc; krb5_data msgtext, msg; @@ -147,10 +146,6 @@ char *argv[]; return 6; } #endif - faddr.addrtype = ADDRTYPE_INET; - faddr.length = sizeof (f_inaddr.sin_addr); - faddr.contents = (krb5_octet *)&f_inaddr.sin_addr; - l = sizeof(l_inaddr); if (getsockname(0, (struct sockaddr *)&l_inaddr, &l) == -1) { @@ -158,10 +153,6 @@ char *argv[]; return 6; } - laddr.addrtype = ADDRTYPE_INET; - laddr.length = sizeof (l_inaddr.sin_addr); - laddr.contents = (krb5_octet *)&l_inaddr.sin_addr; - /* send a ticket/authenticator to the other side, so it can get the key we're using for the krb_safe below. */ @@ -176,8 +167,10 @@ char *argv[]; return 8; } - if (retval = krb5_auth_con_setaddrs(context, auth_context, &laddr, &faddr)){ - com_err("uu-server", retval, "setting addresses for auth_context"); + if (retval = krb5_auth_con_genaddrs(context, auth_context, sock, + KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR | + KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR)) { + com_err("uu-server", retval, "generating addrs for auth_context"); return 9; }