Make gss_store_cred() work

This commit is contained in:
Nicolas Williams
2015-03-18 15:22:09 -05:00
parent 3021258f60
commit 533578e726
2 changed files with 4 additions and 6 deletions

View File

@@ -56,7 +56,8 @@ _gsskrb5_store_cred(OM_uint32 *minor_status,
return GSS_S_FAILURE;
}
if (gss_oid_equal(desired_mech, GSS_KRB5_MECHANISM) == 0)
if (desired_mech != GSS_C_NO_OID &&
gss_oid_equal(desired_mech, GSS_KRB5_MECHANISM) == 0)
return GSS_S_BAD_MECH;
cred = (gsskrb5_cred)input_cred_handle;

View File

@@ -69,11 +69,8 @@ gss_store_cred(OM_uint32 *minor_status,
if (m == NULL || m->gm_store_cred == NULL)
continue;
if (desired_mech) {
maj = gss_oid_equal(&m->gm_mech_oid, desired_mech);
if (maj != 0)
if (desired_mech && !gss_oid_equal(&m->gm_mech_oid, desired_mech))
continue;
}
maj = (m->gm_store_cred)(minor_status, mc->gmc_cred,
cred_usage, desired_mech, overwrite_cred,