aboutsummaryrefslogtreecommitdiff
path: root/lib/libgssapi
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2007-06-14 19:58:24 +0000
committerHartmut Brandt <harti@FreeBSD.org>2007-06-14 19:58:24 +0000
commit513edbb8b0956d316e547d81060e0cc023c4a4d3 (patch)
tree2d92494f8fc5ef7af78dd7f0e1a3d229c50912f6 /lib/libgssapi
parentf616ebc73f1fe5ec47ea696fb033efc010fe9a5b (diff)
Notes
Diffstat (limited to 'lib/libgssapi')
-rw-r--r--lib/libgssapi/gss_init_sec_context.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libgssapi/gss_init_sec_context.c b/lib/libgssapi/gss_init_sec_context.c
index 0d4099eca98e..b9325fe94ee7 100644
--- a/lib/libgssapi/gss_init_sec_context.c
+++ b/lib/libgssapi/gss_init_sec_context.c
@@ -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