allow user to select mech; krb5, spnego, and no-oid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12798 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -109,6 +109,16 @@ proto (int sock, const char *hostname, const char *service)
|
|||||||
struct gss_channel_bindings_struct input_chan_bindings;
|
struct gss_channel_bindings_struct input_chan_bindings;
|
||||||
u_char init_buf[4];
|
u_char init_buf[4];
|
||||||
u_char acct_buf[4];
|
u_char acct_buf[4];
|
||||||
|
gss_OID mech_oid;
|
||||||
|
|
||||||
|
if (strcasecmp(mech, "krb5") == 0)
|
||||||
|
mech_oid = GSS_KRB5_MECHANISM;
|
||||||
|
else if (strcasecmp(mech, "spnego") == 0)
|
||||||
|
mech_oid = GSS_SPNEGO_MECHANISM;
|
||||||
|
else if (strcasecmp(mech, "no-oid") == 0)
|
||||||
|
mech_oid = GSS_C_NO_OID;
|
||||||
|
else
|
||||||
|
errx (1, "Unknown mechanism '%s'", mech);
|
||||||
|
|
||||||
name_token.length = asprintf ((char **)&name_token.value,
|
name_token.length = asprintf ((char **)&name_token.value,
|
||||||
"%s@%s", service, hostname);
|
"%s@%s", service, hostname);
|
||||||
@@ -166,7 +176,7 @@ proto (int sock, const char *hostname, const char *service)
|
|||||||
GSS_C_NO_CREDENTIAL,
|
GSS_C_NO_CREDENTIAL,
|
||||||
&context_hdl,
|
&context_hdl,
|
||||||
server,
|
server,
|
||||||
GSS_C_NO_OID,
|
mech_oid,
|
||||||
GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG
|
GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG
|
||||||
| GSS_C_DELEG_FLAG,
|
| GSS_C_DELEG_FLAG,
|
||||||
0,
|
0,
|
||||||
|
Reference in New Issue
Block a user