struct sockaddr_in serv_net_addr, cli_net_addr;
krb5_address serv_addr, cli_addr;
krb5_ccache cc;
- krb5_creds creds;
+ krb5_creds creds, *new_creds;
krb5_data reply, msg, princ_data;
krb5_tkt_authent *authdat;
krb5_context context;
}
/* Get TGT from credentials cache */
- if (retval = krb5_get_credentials(context, KRB5_GC_CACHED, cc, &creds))
+ if (retval = krb5_get_credentials(context, KRB5_GC_CACHED, cc,
+ &creds, &new_creds))
{
com_err("uu-client", retval, "getting TGT");
return 6;
i = strlen(princ) + 1;
- fprintf(stderr, "uu-client: sending %d bytes\n", creds.ticket.length + i);
+ fprintf(stderr, "uu-client: sending %d bytes\n",new_creds->ticket.length + i);
princ_data.data = princ;
princ_data.length = i; /* include null terminator for
server's convenience */
return 8;
}
free(princ);
- retval = krb5_write_message(context, (krb5_pointer) &s, &creds.ticket);
+ retval = krb5_write_message(context, (krb5_pointer) &s, &new_creds->ticket);
if (retval)
{
com_err("uu-client", retval, "sending ticket to server");
&serv_addr,
0, /* no fetchfrom */
tgt_keyproc,
- (krb5_pointer)&creds, /* credentials as arg to
+ (krb5_pointer)new_creds, /* credentials as arg to
keyproc */
0, /* no rcache for the moment XXX */
&authdat);
#else
retval = krb5_recvauth(context, (krb5_pointer)&s, "???",
0, /* server */
- &serv_addr, 0, tgt_keyproc, (krb5_pointer)&creds,
+ &serv_addr, 0, tgt_keyproc, (krb5_pointer)new_creds,
0, 0,
0, 0, 0, 0);
#endif
int retval;
struct sockaddr_in l_inaddr, f_inaddr; /* local, foreign address */
krb5_address laddr, faddr;
- krb5_creds creds;
+ krb5_creds creds, *new_creds;
krb5_ccache cc;
krb5_data msgtext, msg;
krb5_int32 seqno;
printf ("uu-server: client ticket is %d bytes.\n",
creds.second_ticket.length);
- if (retval = krb5_get_credentials(context, KRB5_GC_USER_USER, cc, &creds))
+ if (retval = krb5_get_credentials(context, KRB5_GC_USER_USER, cc,
+ &creds, &new_creds))
{
com_err("uu-server", retval, "getting user-user ticket");
return 5;
/* send a ticket/authenticator to the other side, so it can get the key
we're using for the krb_safe below. */
- if (retval = krb5_generate_seq_number(context, &creds.keyblock, &seqno)) {
+ if (retval = krb5_generate_seq_number(context, &new_creds->keyblock, &seqno)){
com_err("uu-server", retval, "generating sequence number");
return 8;
}
#if 1
if (retval = krb5_mk_req_extended(context, AP_OPTS_USE_SESSION_KEY,
0, /* no application checksum here */
- krb5_kdc_default_options,
seqno,
0, /* no need for subkey */
- cc,
&creds,
0, /* don't need authenticator copy */
&msg)) {
msgtext.data = "Hello, other end of connection.";
if (retval = krb5_mk_safe(context, &msgtext, CKSUMTYPE_RSA_MD4_DES,
- &creds.keyblock, &laddr, &faddr, seqno,
+ &new_creds->keyblock, &laddr, &faddr, seqno,
KRB5_SAFE_NOTIME|KRB5_SAFE_DOSEQUENCE, 0, &msg))
{
com_err("uu-server", retval, "encoding message to client");