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

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

krb5 commit: Report inquire_attrs_for_mech mech failures

daemon@ATHENA.MIT.EDU (Greg Hudson)
Mon Feb 15 23:23:18 2016

Date: Mon, 15 Feb 2016 23:23:11 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201602160423.u1G4NBgX011343@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/030a4a03a0480969d6acf1591f39fd194642805a
commit 030a4a03a0480969d6acf1591f39fd194642805a
Author: Robbie Harwood <rharwood@redhat.com>
Date:   Wed Jan 27 18:48:04 2016 -0500

    Report inquire_attrs_for_mech mech failures
    
    Previously, gss_inquire_attrs_for_mech() would return a list of mech
    attributes that it knew about when given a bad mech oid or a mechanism
    which did not provide a gss_inquire_attrs_for_mech() method.  It seems
    more useful to just report the failure to the application rather than
    allowing it to continue with a faulty mechanism.
    
    ticket: 8358 (new)

 src/lib/gssapi/mechglue/g_mechattr.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/lib/gssapi/mechglue/g_mechattr.c b/src/lib/gssapi/mechglue/g_mechattr.c
index 57c0e52..08a6008 100644
--- a/src/lib/gssapi/mechglue/g_mechattr.c
+++ b/src/lib/gssapi/mechglue/g_mechattr.c
@@ -179,15 +179,16 @@ gss_inquire_attrs_for_mech(
         return status;
 
     mech = gssint_get_mechanism(selected_mech);
-    if (mech != NULL && mech->gss_inquire_attrs_for_mech != NULL) {
-        public_mech = gssint_get_public_oid(selected_mech);
-        status = mech->gss_inquire_attrs_for_mech(minor, public_mech,
-                                                  mech_attrs,
-                                                  known_mech_attrs);
-        if (GSS_ERROR(status)) {
-            map_error(minor, mech);
-            return status;
-        }
+    if (mech == NULL)
+        return GSS_S_BAD_MECH;
+    else if (mech->gss_inquire_attrs_for_mech == NULL)
+        return GSS_S_UNAVAILABLE;
+    public_mech = gssint_get_public_oid(selected_mech);
+    status = mech->gss_inquire_attrs_for_mech(minor, public_mech, mech_attrs,
+                                              known_mech_attrs);
+    if (GSS_ERROR(status)) {
+        map_error(minor, mech);
+        return status;
     }
 
     if (known_mech_attrs != NULL && *known_mech_attrs == GSS_C_NO_OID_SET) {
_______________________________________________
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