Lines Matching +full:mic +full:- +full:pos

1 // SPDX-License-Identifier: BSD-3-Clause
38 for (i = 0; i < gm->gm_pf_num; i++) { in gss_mech_free()
39 pf = &gm->gm_pfs[i]; in gss_mech_free()
40 if (pf->domain) in gss_mech_free()
41 auth_domain_put(pf->domain); in gss_mech_free()
42 kfree(pf->auth_domain_name); in gss_mech_free()
43 pf->auth_domain_name = NULL; in gss_mech_free()
68 for (i = 0; i < gm->gm_pf_num; i++) { in gss_mech_svc_setup()
69 pf = &gm->gm_pfs[i]; in gss_mech_svc_setup()
70 pf->auth_domain_name = make_auth_domain_name(pf->name); in gss_mech_svc_setup()
71 status = -ENOMEM; in gss_mech_svc_setup()
72 if (pf->auth_domain_name == NULL) in gss_mech_svc_setup()
75 pf->pseudoflavor, pf->auth_domain_name); in gss_mech_svc_setup()
80 pf->domain = dom; in gss_mech_svc_setup()
89 * gss_mech_register - register a GSS mechanism
102 list_add_rcu(&gm->gm_list, &registered_mechs); in gss_mech_register()
104 dprintk("RPC: registered gss mechanism %s\n", gm->gm_name); in gss_mech_register()
110 * gss_mech_unregister - release a GSS mechanism
117 list_del_rcu(&gm->gm_list); in gss_mech_unregister()
119 dprintk("RPC: unregistered gss mechanism %s\n", gm->gm_name); in gss_mech_unregister()
126 __module_get(gm->gm_owner); in gss_mech_get()
134 struct gss_api_mech *pos, *gm = NULL; in _gss_mech_get_by_name() local
137 list_for_each_entry_rcu(pos, &registered_mechs, gm_list) { in _gss_mech_get_by_name()
138 if (0 == strcmp(name, pos->gm_name)) { in _gss_mech_get_by_name()
139 if (try_module_get(pos->gm_owner)) in _gss_mech_get_by_name()
140 gm = pos; in _gss_mech_get_by_name()
155 request_module("rpc-auth-gss-%s", name); in gss_mech_get_by_name()
163 struct gss_api_mech *pos, *gm = NULL; in gss_mech_get_by_OID() local
166 if (sprint_oid(obj->data, obj->len, buf, sizeof(buf)) < 0) in gss_mech_get_by_OID()
168 request_module("rpc-auth-gss-%s", buf); in gss_mech_get_by_OID()
171 list_for_each_entry_rcu(pos, &registered_mechs, gm_list) { in gss_mech_get_by_OID()
172 if (obj->len == pos->gm_oid.len) { in gss_mech_get_by_OID()
173 if (0 == memcmp(obj->data, pos->gm_oid.data, obj->len)) { in gss_mech_get_by_OID()
174 if (try_module_get(pos->gm_owner)) in gss_mech_get_by_OID()
175 gm = pos; in gss_mech_get_by_OID()
191 for (i = 0; i < gm->gm_pf_num; i++) { in mech_supports_pseudoflavor()
192 if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) in mech_supports_pseudoflavor()
200 struct gss_api_mech *gm = NULL, *pos; in _gss_mech_get_by_pseudoflavor() local
203 list_for_each_entry_rcu(pos, &registered_mechs, gm_list) { in _gss_mech_get_by_pseudoflavor()
204 if (!mech_supports_pseudoflavor(pos, pseudoflavor)) in _gss_mech_get_by_pseudoflavor()
206 if (try_module_get(pos->gm_owner)) in _gss_mech_get_by_pseudoflavor()
207 gm = pos; in _gss_mech_get_by_pseudoflavor()
222 request_module("rpc-auth-gss-%u", pseudoflavor); in gss_mech_get_by_pseudoflavor()
229 * gss_svc_to_pseudoflavor - map a GSS service number to a pseudoflavor
231 * @qop: GSS quality-of-protection value
241 for (i = 0; i < gm->gm_pf_num; i++) { in gss_svc_to_pseudoflavor()
242 if (gm->gm_pfs[i].qop == qop && in gss_svc_to_pseudoflavor()
243 gm->gm_pfs[i].service == service) { in gss_svc_to_pseudoflavor()
244 return gm->gm_pfs[i].pseudoflavor; in gss_svc_to_pseudoflavor()
251 * gss_mech_info2flavor - look up a pseudoflavor given a GSS tuple
262 gm = gss_mech_get_by_OID(&info->oid); in gss_mech_info2flavor()
266 pseudoflavor = gss_svc_to_pseudoflavor(gm, info->qop, info->service); in gss_mech_info2flavor()
273 * gss_mech_flavor2info - look up a GSS tuple for a given pseudoflavor
288 return -ENOENT; in gss_mech_flavor2info()
290 for (i = 0; i < gm->gm_pf_num; i++) { in gss_mech_flavor2info()
291 if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) { in gss_mech_flavor2info()
292 memcpy(info->oid.data, gm->gm_oid.data, gm->gm_oid.len); in gss_mech_flavor2info()
293 info->oid.len = gm->gm_oid.len; in gss_mech_flavor2info()
294 info->qop = gm->gm_pfs[i].qop; in gss_mech_flavor2info()
295 info->service = gm->gm_pfs[i].service; in gss_mech_flavor2info()
302 return -ENOENT; in gss_mech_flavor2info()
310 for (i = 0; i < gm->gm_pf_num; i++) { in gss_pseudoflavor_to_service()
311 if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) in gss_pseudoflavor_to_service()
312 return gm->gm_pfs[i].service; in gss_pseudoflavor_to_service()
323 for (i = 0; i < gm->gm_pf_num; i++) { in gss_pseudoflavor_to_datatouch()
324 if (gm->gm_pfs[i].pseudoflavor == pseudoflavor) in gss_pseudoflavor_to_datatouch()
325 return gm->gm_pfs[i].datatouch; in gss_pseudoflavor_to_datatouch()
335 for (i = 0; i < gm->gm_pf_num; i++) { in gss_service_to_auth_domain_name()
336 if (gm->gm_pfs[i].service == service) in gss_service_to_auth_domain_name()
337 return gm->gm_pfs[i].auth_domain_name; in gss_service_to_auth_domain_name()
346 module_put(gm->gm_owner); in gss_mech_put()
360 return -ENOMEM; in gss_import_sec_context()
361 (*ctx_id)->mech_type = gss_mech_get(mech); in gss_import_sec_context()
363 return mech->gm_ops->gss_import_sec_context(input_token, bufsize, in gss_import_sec_context()
367 /* gss_get_mic: compute a mic over message and return mic_token. */
374 return context_handle->mech_type->gm_ops in gss_get_mic()
375 ->gss_get_mic(context_handle, in gss_get_mic()
387 return context_handle->mech_type->gm_ops in gss_verify_mic()
388 ->gss_verify_mic(context_handle, in gss_verify_mic()
413 return ctx_id->mech_type->gm_ops in gss_wrap()
414 ->gss_wrap(ctx_id, offset, buf, inpages); in gss_wrap()
423 return ctx_id->mech_type->gm_ops in gss_unwrap()
424 ->gss_unwrap(ctx_id, offset, len, buf); in gss_unwrap()
429 * Note this differs from the RFC 2744-specified prototype in that we don't
440 if ((*context_handle)->internal_ctx_id) in gss_delete_sec_context()
441 (*context_handle)->mech_type->gm_ops in gss_delete_sec_context()
442 ->gss_delete_sec_context((*context_handle) in gss_delete_sec_context()
443 ->internal_ctx_id); in gss_delete_sec_context()
444 gss_mech_put((*context_handle)->mech_type); in gss_delete_sec_context()