gss: add gss_mg_name_to_oid internal API
Add a new function for future internal use, gss_mg_name_to_oid(), which takes either a dot-separated OID or a "short" mechanism name (such as "sanon-x25519"), and returns a mechanism OID.
This commit is contained in:
@@ -701,6 +701,9 @@ gss_cred_id_t
|
|||||||
_gss_mg_find_mech_cred(gss_const_cred_id_t cred_handle,
|
_gss_mg_find_mech_cred(gss_const_cred_id_t cred_handle,
|
||||||
gss_const_OID mech_type);
|
gss_const_OID mech_type);
|
||||||
|
|
||||||
|
GSSAPI_LIB_FUNCTION gss_const_OID
|
||||||
|
GSSAPI_CALLCONV gss_mg_name_to_oid(const char *);
|
||||||
|
|
||||||
#include <krb5.h>
|
#include <krb5.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -69,6 +69,7 @@ EXPORTS
|
|||||||
gss_krb5_set_allowable_enctypes
|
gss_krb5_set_allowable_enctypes
|
||||||
gss_localname
|
gss_localname
|
||||||
gss_mg_collect_error
|
gss_mg_collect_error
|
||||||
|
gss_mg_name_to_oid
|
||||||
gss_mo_get
|
gss_mo_get
|
||||||
gss_mo_set
|
gss_mo_set
|
||||||
gss_mo_list
|
gss_mo_list
|
||||||
|
@@ -490,3 +490,21 @@ _gss_mg_support_mechanism(gss_const_OID mech)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GSSAPI_LIB_FUNCTION gss_const_OID GSSAPI_CALLCONV
|
||||||
|
gss_mg_name_to_oid(const char *name)
|
||||||
|
{
|
||||||
|
struct _gss_mech_switch *m;
|
||||||
|
gss_OID oid = GSS_C_NO_OID;
|
||||||
|
|
||||||
|
if (isdigit(name[0]) && _gss_string_to_oid(name, &oid) == 0)
|
||||||
|
return oid;
|
||||||
|
|
||||||
|
_gss_load_mech();
|
||||||
|
HEIM_TAILQ_FOREACH(m, &_gss_mechs, gm_link) {
|
||||||
|
if (m->gm_mech.gm_name &&
|
||||||
|
strcmp(m->gm_mech.gm_name, name) == 0)
|
||||||
|
return m->gm_mech_oid;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@@ -69,6 +69,7 @@ HEIMDAL_GSS_2.0 {
|
|||||||
gss_krb5_set_allowable_enctypes;
|
gss_krb5_set_allowable_enctypes;
|
||||||
gss_localname;
|
gss_localname;
|
||||||
gss_mg_collect_error;
|
gss_mg_collect_error;
|
||||||
|
gss_mg_name_to_oid;
|
||||||
gss_oid_equal;
|
gss_oid_equal;
|
||||||
gss_oid_to_str;
|
gss_oid_to_str;
|
||||||
gss_pname_to_uid;
|
gss_pname_to_uid;
|
||||||
|
Reference in New Issue
Block a user