]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Check mech cred in gss_inquire_cred_by_mech()
authorGreg Hudson <ghudson@mit.edu>
Thu, 13 Sep 2018 21:03:36 +0000 (17:03 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 29 Oct 2018 22:12:22 +0000 (18:12 -0400)
If gss_inquire_cred_by_mech() is called with a mechanism and there is
no corresponding mechanism credential in the union cred, return
GSS_S_NO_CRED (as Heimdal does) instead of interrogating the mechanism
about the default credential.

(cherry picked from commit 8ea7e36661cfa6d8acb2b1af615870092a408cce)

ticket: 8736
version_fixed: 1.15.4

src/lib/gssapi/mechglue/g_inq_cred.c

index 911196264f1fead649b3b53ea99e82763469b841..5025bf1d7c923fa2a01b213e120ba9c8e418c1c5 100644 (file)
@@ -197,6 +197,8 @@ gss_inquire_cred_by_mech(minor_status, cred_handle, mech_type, name,
 
     union_cred = (gss_union_cred_t) cred_handle;
     mech_cred = gssint_get_mechanism_cred(union_cred, selected_mech);
+    if (cred_handle != GSS_C_NO_CREDENTIAL && mech_cred == GSS_C_NO_CREDENTIAL)
+       return (GSS_S_NO_CRED);
 
 #if 0
     if (mech_cred == NULL)