From 14e78387eeb62b6f1c87f304b7dd4fe863b6c122 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sun, 2 Jul 1995 23:22:04 +0000 Subject: [PATCH] ---------------------------------------------------------------------- automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: ---------------------------------------------------------------------- Correct logic in krb5_recvauth so that it returns an error reply if authentication fails. CVS: git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6220 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 6 ++++++ src/lib/krb5/krb/recvauth.c | 17 ++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index a8c0dc05b..be02d6e7f 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +Sun Jul 2 18:59:53 1995 Sam Hartman + + * recvauth.c (krb5_recvauth): recvauth should send an error reply + if problem is not zero. Removed if that caused it to only send a + reply on success. + Fri Jun 16 22:11:21 1995 Theodore Y. Ts'o (tytso@dcl) * get_in_tkt.c (krb5_get_in_tkt): Allow the credentials cache diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index 77ea1cfc3..eb753f8ec 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -188,6 +188,11 @@ krb5_recvauth(context, auth_context, memset((char *)&error, 0, sizeof(error)); krb5_us_timeofday(context, &error.stime, &error.susec); error.server = server; + + + + + error.error = problem - ERROR_TABLE_BASE_krb5; if (error.error > 127) error.error = KRB_ERR_GENERIC; @@ -208,17 +213,15 @@ krb5_recvauth(context, auth_context, outbuf.data = 0; } - if (!problem) { - retval = krb5_write_message(context, fd, &outbuf); - if (outbuf.data) - krb5_xfree(outbuf.data); - if (retval) - goto cleanup; - } else { + retval = krb5_write_message(context, fd, &outbuf); + if (outbuf.data) { + krb5_xfree(outbuf.data); /* We sent back an error, we need cleanup then return */ retval = problem; goto cleanup; } + if (retval) + goto cleanup; /* Here lies the mutual authentication stuff... */ if ((ap_option & AP_OPTS_MUTUAL_REQUIRED)) { -- 2.26.2