From 9d4d3979b2c8c8743f37cf049ccbcd87b786a177 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Thu, 23 Feb 1995 13:24:46 +0000 Subject: [PATCH] * client.c Call krb5_get_credentials() with new calling convention * server.c Call krb5_mk_req_extended() with new calling convention. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4987 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/user_user/ChangeLog | 6 ++++++ src/appl/user_user/client.c | 13 +++++++------ src/appl/user_user/server.c | 11 +++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/appl/user_user/ChangeLog b/src/appl/user_user/ChangeLog index 4c195bd5e..0b3e5358d 100644 --- a/src/appl/user_user/ChangeLog +++ b/src/appl/user_user/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 14 15:30:55 1995 Chris Provenzano (proven@mit.edu) + + * client.c Call krb5_get_credentials() with new calling convention. + + * server.c Call krb5_mk_req_extended() with new calling convention. + Fri Feb 3 11:58:18 1995 Theodore Y. Ts'o (tytso@dcl) * client.c: (tgt_keyproc): Add keytype argument to rd_req_proc. diff --git a/src/appl/user_user/client.c b/src/appl/user_user/client.c index 8f0845d73..91fd911ae 100644 --- a/src/appl/user_user/client.c +++ b/src/appl/user_user/client.c @@ -65,7 +65,7 @@ char *argv[]; 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; @@ -188,7 +188,8 @@ char *argv[]; } /* 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; @@ -196,7 +197,7 @@ char *argv[]; 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 */ @@ -207,7 +208,7 @@ char *argv[]; 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"); @@ -235,7 +236,7 @@ char *argv[]; &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); @@ -243,7 +244,7 @@ char *argv[]; #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 diff --git a/src/appl/user_user/server.c b/src/appl/user_user/server.c index dfa76df87..f00fc1126 100644 --- a/src/appl/user_user/server.c +++ b/src/appl/user_user/server.c @@ -50,7 +50,7 @@ char *argv[]; 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; @@ -134,7 +134,8 @@ char *argv[]; 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; @@ -166,17 +167,15 @@ char *argv[]; /* 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)) { @@ -201,7 +200,7 @@ char *argv[]; 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"); -- 2.26.2