]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Enable interposing gss_inquire_attrs_for_mech()
authorRobbie Harwood <rharwood@redhat.com>
Mon, 11 Jan 2016 22:50:39 +0000 (17:50 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 16 Feb 2016 03:49:18 +0000 (22:49 -0500)
Use gssint_select_mech_type() to locate an interposer mechanism, and
pass the public mech OID to the mech.  Also call map_error() on the
resulting minor code.

ticket: 8330 (new)

src/lib/gssapi/mechglue/g_mechattr.c

index e9299f4737b227e702fefd42b42062d854d54ab7..57c0e526f114f5c6206a5f53776a4ae5bf7fa198 100644 (file)
@@ -160,6 +160,7 @@ gss_inquire_attrs_for_mech(
     gss_OID_set       *known_mech_attrs)
 {
     OM_uint32       status, tmpMinor;
+    gss_OID         selected_mech, public_mech;
     gss_mechanism   mech;
 
     if (minor == NULL)
@@ -173,14 +174,20 @@ gss_inquire_attrs_for_mech(
     if (known_mech_attrs != NULL)
         *known_mech_attrs = GSS_C_NO_OID_SET;
 
-    mech = gssint_get_mechanism((gss_OID)mech_oid);
+    status = gssint_select_mech_type(minor, mech_oid, &selected_mech);
+    if (status != GSS_S_COMPLETE)
+        return status;
+
+    mech = gssint_get_mechanism(selected_mech);
     if (mech != NULL && mech->gss_inquire_attrs_for_mech != NULL) {
-        status = mech->gss_inquire_attrs_for_mech(minor,
-                                                  mech_oid,
+        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))
+        if (GSS_ERROR(status)) {
+            map_error(minor, mech);
             return status;
+        }
     }
 
     if (known_mech_attrs != NULL && *known_mech_attrs == GSS_C_NO_OID_SET) {