=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/Attic/auth-krb4.c,v retrieving revision 1.24.2.4 retrieving revision 1.25 diff -u -r1.24.2.4 -r1.25 --- src/usr.bin/ssh/Attic/auth-krb4.c 2002/10/11 14:53:06 1.24.2.4 +++ src/usr.bin/ssh/Attic/auth-krb4.c 2001/12/19 07:18:56 1.25 @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-krb4.c,v 1.24.2.4 2002/10/11 14:53:06 miod Exp $"); +RCSID("$OpenBSD: auth-krb4.c,v 1.25 2001/12/19 07:18:56 deraadt Exp $"); #include "ssh.h" #include "ssh1.h" @@ -57,8 +57,8 @@ if (lstat("/ticket", &st) != -1) tkt_root = "/ticket/"; #endif /* AFS */ - snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%ld", - tkt_root, authctxt->pw->pw_uid, (long)getpid()); + snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%d", + tkt_root, authctxt->pw->pw_uid, getpid()); krb_set_tkt_string(authctxt->krb4_ticket_file); } /* Register ticket cleanup in case of fatal error. */ @@ -210,9 +210,10 @@ } int -auth_krb4(Authctxt *authctxt, KTEXT auth, char **client, KTEXT reply) +auth_krb4(Authctxt *authctxt, KTEXT auth, char **client) { AUTH_DAT adat = {0}; + KTEXT_ST reply; Key_schedule schedule; struct sockaddr_in local, foreign; char instance[INST_SZ]; @@ -252,7 +253,6 @@ log("Kerberos v4 .klogin authorization failed for %s to " "account %s", *client, authctxt->user); xfree(*client); - *client = NULL; return (0); } /* Increment the checksum, and return it encrypted with the @@ -262,16 +262,21 @@ /* If we can't successfully encrypt the checksum, we send back an empty message, admitting our failure. */ - if ((r = krb_mk_priv((u_char *) & cksum, reply->dat, sizeof(cksum) + 1, + if ((r = krb_mk_priv((u_char *) & cksum, reply.dat, sizeof(cksum) + 1, schedule, &adat.session, &local, &foreign)) < 0) { debug("Kerberos v4 mk_priv: (%d) %s", r, krb_err_txt[r]); - reply->dat[0] = 0; - reply->length = 0; + reply.dat[0] = 0; + reply.length = 0; } else - reply->length = r; + reply.length = r; /* Clear session key. */ memset(&adat.session, 0, sizeof(&adat.session)); + + packet_start(SSH_SMSG_AUTH_KERBEROS_RESPONSE); + packet_put_string((char *) reply.dat, reply.length); + packet_send(); + packet_write_wait(); return (1); } #endif /* KRB4 */