mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
According to the documentation mech_type for gss_init_sec_context() may
be passed as GSS_C_NO_OID in which case a default mech should be used. This case was not handled and leads to core dumps when using nss_ldap. Now use the first mech in this case. When there is no mechanism available return an error (this part is taken from the PR). PR: 113266 Submitted by: Eirik Nygaard <eirikald@pvv.ntnu.no> (partly)
This commit is contained in:
parent
f616ebc73f
commit
513edbb8b0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170734
@ -41,7 +41,7 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t initiator_cred_handle,
|
||||
gss_ctx_id_t * context_handle,
|
||||
const gss_name_t target_name,
|
||||
const gss_OID mech_type,
|
||||
const gss_OID imech_type,
|
||||
OM_uint32 req_flags,
|
||||
OM_uint32 time_req,
|
||||
const gss_channel_bindings_t input_chan_bindings,
|
||||
@ -52,6 +52,7 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
||||
OM_uint32 * time_rec)
|
||||
{
|
||||
OM_uint32 major_status;
|
||||
gss_OID mech_type;
|
||||
struct _gss_mech_switch *m;
|
||||
struct _gss_name *name = (struct _gss_name *) target_name;
|
||||
struct _gss_mechanism_name *mn;
|
||||
@ -63,6 +64,13 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
||||
|
||||
*minor_status = 0;
|
||||
|
||||
if ((mech_type = imech_type) == GSS_C_NO_OID) {
|
||||
_gss_load_mech();
|
||||
mech_type = &SLIST_FIRST(&_gss_mechs)->gm_mech_oid;
|
||||
if (mech_type == NULL)
|
||||
return (GSS_S_BAD_MECH);
|
||||
}
|
||||
|
||||
/*
|
||||
* If we haven't allocated a context yet, do so now and lookup
|
||||
* the mechanism switch table. If we have one already, make
|
||||
|
Loading…
Reference in New Issue
Block a user