(select_mech): return the gss_OID from a mech name

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12812 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-09-10 09:29:59 +00:00
parent 48146f86c9
commit 29cede4fb6

View File

@@ -116,3 +116,15 @@ gss_err(int exitval, int status, const char *fmt, ...)
va_end(args); va_end(args);
} }
gss_OID
select_mech(const char *mech)
{
if (strcasecmp(mech, "krb5") == 0)
return GSS_KRB5_MECHANISM;
else if (strcasecmp(mech, "spnego") == 0)
return GSS_SPNEGO_MECHANISM;
else if (strcasecmp(mech, "no-oid") == 0)
return GSS_C_NO_OID;
else
errx (1, "Unknown mechanism '%s' (spnego, krb5, no-oid)", mech);
}