Add SPI for dynamically loading mechanism object information
This commit is contained in:
@@ -252,6 +252,8 @@ _gss_load_mech(void)
|
|||||||
rk_cloexec_file(fp);
|
rk_cloexec_file(fp);
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), fp)) {
|
while (fgets(buf, sizeof(buf), fp)) {
|
||||||
|
_gss_mo_init *mi;
|
||||||
|
|
||||||
if (*buf == '#')
|
if (*buf == '#')
|
||||||
continue;
|
continue;
|
||||||
p = buf;
|
p = buf;
|
||||||
@@ -360,10 +362,18 @@ _gss_load_mech(void)
|
|||||||
OPTSPISYM(acquire_cred_with_password);
|
OPTSPISYM(acquire_cred_with_password);
|
||||||
OPTSYM(add_cred_with_password);
|
OPTSYM(add_cred_with_password);
|
||||||
|
|
||||||
/* API-as-SPI compatibility */
|
mi = dlsym(so, "gss_mo_init");
|
||||||
COMPATSYM(inquire_saslname_for_mech);
|
if (mi != NULL) {
|
||||||
COMPATSYM(inquire_mech_for_saslname);
|
major_status = mi(&minor_status, &mech_oid,
|
||||||
COMPATSYM(inquire_attrs_for_mech);
|
&m->gm_mech.gm_mo, &m->gm_mech.gm_mo_num);
|
||||||
|
if (GSS_ERROR(major_status))
|
||||||
|
goto bad;
|
||||||
|
} else {
|
||||||
|
/* API-as-SPI compatibility */
|
||||||
|
COMPATSYM(inquire_saslname_for_mech);
|
||||||
|
COMPATSYM(inquire_mech_for_saslname);
|
||||||
|
COMPATSYM(inquire_attrs_for_mech);
|
||||||
|
}
|
||||||
|
|
||||||
/* pick up the oid sets of names */
|
/* pick up the oid sets of names */
|
||||||
|
|
||||||
|
@@ -40,4 +40,15 @@ HEIM_SLIST_HEAD(_gss_mech_switch_list, _gss_mech_switch);
|
|||||||
extern struct _gss_mech_switch_list _gss_mechs;
|
extern struct _gss_mech_switch_list _gss_mechs;
|
||||||
extern gss_OID_set _gss_mech_oids;
|
extern gss_OID_set _gss_mech_oids;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialization function for MO SPI, so they may dynamically return a
|
||||||
|
* set of mechanism objects at load time.
|
||||||
|
*/
|
||||||
|
typedef OM_uint32 GSSAPI_CALLCONV _gss_mo_init (
|
||||||
|
OM_uint32 *minor,
|
||||||
|
gss_OID oid,
|
||||||
|
gss_mo_desc **mo,
|
||||||
|
size_t *mo_num
|
||||||
|
);
|
||||||
|
|
||||||
void _gss_load_mech(void);
|
void _gss_load_mech(void);
|
||||||
|
Reference in New Issue
Block a user