[27853] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix OTP KDC module get_string error handling

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Jul 17 12:30:58 2013

Date: Wed, 17 Jul 2013 12:24:21 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201307171624.r6HGOLqL001679@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/acb490bd01235511294ecb6b23750e648e48f7dc
commit acb490bd01235511294ecb6b23750e648e48f7dc
Author: Greg Hudson <ghudson@mit.edu>
Date:   Wed Jul 17 12:14:13 2013 -0400

    Fix OTP KDC module get_string error handling
    
    If cb->get_string returns 0 with no result in otp_edata, make sure we
    set retval to avoid sending an empty OTP hint.  If cb->get_string
    returns an error code in otp_verify, avoid masking that code.

 src/plugins/preauth/otp/main.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/plugins/preauth/otp/main.c b/src/plugins/preauth/otp/main.c
index 2f7470e..bf9c6a8 100644
--- a/src/plugins/preauth/otp/main.c
+++ b/src/plugins/preauth/otp/main.c
@@ -204,7 +204,9 @@ otp_edata(krb5_context context, krb5_kdc_req *request,
 
     /* Determine if otp is enabled for the user. */
     retval = cb->get_string(context, rock, "otp", &config);
-    if (retval != 0 || config == NULL)
+    if (retval == 0 && config == NULL)
+        retval = ENOENT;
+    if (retval != 0)
         goto out;
     cb->free_string(context, rock, config);
 
@@ -305,7 +307,7 @@ otp_verify(krb5_context context, krb5_data *req_pkt, krb5_kdc_req *request,
 
     /* Get the principal's OTP configuration string. */
     retval = cb->get_string(context, rock, "otp", &config);
-    if (config == NULL)
+    if (retval == 0 && config == NULL)
         retval = KRB5_PREAUTH_FAILED;
     if (retval != 0) {
         free(rs);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post