/** *gss_mech_flavor2info-lookupaGSStupleforagivenpseudoflavor *@pseudoflavor:GSSpseudoflavortomatch *@info:rpcsec_gss_infostructuretofillin * *Returnszeroandfillsin"info"ifpseudoflavormatchesa *supportedmechanism.Otherwiseanegativeerrnoisreturned.
*/ int gss_mech_flavor2info(rpc_authflavor_t pseudoflavor, struct rpcsec_gss_info *info)
{ struct gss_api_mech *gm; int i;
gm = gss_mech_get_by_pseudoflavor(pseudoflavor); if (gm == NULL) return -ENOENT;
for (i = 0; i < gm->gm_pf_num; i++) { if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) {
memcpy(info->oid.data, gm->gm_oid.data, gm->gm_oid.len);
info->oid.len = gm->gm_oid.len;
info->qop = gm->gm_pfs[i].qop;
info->service = gm->gm_pfs[i].service;
gss_mech_put(gm); return0;
}
}
gss_mech_put(gm); return -ENOENT;
}
u32
gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor)
{ int i;
for (i = 0; i < gm->gm_pf_num; i++) { if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) return gm->gm_pfs[i].service;
} return0;
}
EXPORT_SYMBOL(gss_pseudoflavor_to_service);
bool
gss_pseudoflavor_to_datatouch(struct gss_api_mech *gm, u32 pseudoflavor)
{ int i;
for (i = 0; i < gm->gm_pf_num; i++) { if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) return gm->gm_pfs[i].datatouch;
} returnfalse;
}
char *
gss_service_to_auth_domain_name(struct gss_api_mech *gm, u32 service)
{ int i;
for (i = 0; i < gm->gm_pf_num; i++) { if (gm->gm_pfs[i].service == service) return gm->gm_pfs[i].auth_domain_name;
} return NULL;
}
/* The mech could probably be determined from the token instead, but it's just
* as easy for now to pass it in. */ int
gss_import_sec_context(constvoid *input_token, size_t bufsize, struct gss_api_mech *mech, struct gss_ctx **ctx_id,
time64_t *endtime,
gfp_t gfp_mask)
{ if (!(*ctx_id = kzalloc(sizeof(**ctx_id), gfp_mask))) return -ENOMEM;
(*ctx_id)->mech_type = gss_mech_get(mech);
u32
gss_unwrap(struct gss_ctx *ctx_id, int offset, int len, struct xdr_buf *buf)
{ return ctx_id->mech_type->gm_ops
->gss_unwrap(ctx_id, offset, len, buf);
}
/* gss_delete_sec_context: free all resources associated with context_handle. *NotethisdiffersfromtheRFC2744-specifiedprototypeinthatwedon't
* bother returning an output token, since it would never be used anyway. */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.