gss_mechanism mech;
OM_uint32 status, temp_minor_status;
gss_name_t internal_name;
- gss_OID selected_mech;
+ gss_OID selected_mech, public_mech;
if (minor_status != NULL)
*minor_status = 0;
return (GSS_S_DEFECTIVE_CREDENTIAL);
#endif
+ public_mech = gssint_get_public_oid(selected_mech);
status = mech->gss_inquire_cred_by_mech(minor_status,
- mech_cred, selected_mech,
+ mech_cred, public_mech,
name ? &internal_name : NULL,
initiator_lifetime,
acceptor_lifetime, cred_usage);
{
OM_uint32 status;
- gss_OID selected_mech = GSS_C_NO_OID;
+ gss_OID selected_mech = GSS_C_NO_OID, public_mech;
gss_mechanism mech;
/* Initialize outputs. */
return (status);
mech = gssint_get_mechanism(selected_mech);
+ if (mech == NULL)
+ return GSS_S_BAD_MECH;
+ else if (mech->gss_inquire_names_for_mech == NULL)
+ return GSS_S_UNAVAILABLE;
+ public_mech = gssint_get_public_oid(selected_mech);
+ status = mech->gss_inquire_names_for_mech(minor_status, public_mech,
+ name_types);
+ if (status != GSS_S_COMPLETE)
+ map_error(minor_status, mech);
- if (mech) {
-
- if (mech->gss_inquire_names_for_mech) {
- status = mech->gss_inquire_names_for_mech(
- minor_status,
- selected_mech,
- name_types);
- if (status != GSS_S_COMPLETE)
- map_error(minor_status, mech);
- } else
- status = GSS_S_UNAVAILABLE;
-
- return(status);
- }
-
- return (GSS_S_BAD_MECH);
+ return status;
}
static OM_uint32
gss_OID_set *elements_stored,
gss_cred_usage_t *cred_usage_stored)
{
+ gss_OID public_mech = gssint_get_public_oid(desired_mech);
+
if (mech->gss_store_cred_into != NULL) {
return mech->gss_store_cred_into(minor_status, mech_cred,
- cred_usage, desired_mech,
+ cred_usage, public_mech,
overwrite_cred, default_cred,
cred_store, elements_stored,
cred_usage_stored);
} else if (cred_store == GSS_C_NO_CRED_STORE) {
return mech->gss_store_cred(minor_status, mech_cred,
- cred_usage, desired_mech,
+ cred_usage, public_mech,
overwrite_cred, default_cred,
elements_stored,
cred_usage_stored);
gss_mechanism mech;
gss_union_name_t unionName;
gss_name_t mechName = GSS_C_NO_NAME, mechNameP;
- gss_OID selected_mech = GSS_C_NO_OID;
+ gss_OID selected_mech = GSS_C_NO_OID, public_mech;
if (localname != GSS_C_NO_BUFFER) {
localname->length = 0;
mech = gssint_get_mechanism(unionName->mech_type);
if (mech == NULL)
- return GSS_S_UNAVAILABLE;
+ return GSS_S_BAD_MECH;
/* may need to create a mechanism specific name */
if (unionName->mech_type == GSS_C_NO_OID ||
major = GSS_S_UNAVAILABLE;
if (mech->gss_localname != NULL) {
- major = mech->gss_localname(minor, mechNameP, mech_type, localname);
+ public_mech = gssint_get_public_oid(selected_mech);
+ major = mech->gss_localname(minor, mechNameP, public_mech, localname);
if (GSS_ERROR(major))
map_error(minor, mech);
}