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;
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");
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;
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;
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)
{
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. */
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;
}