Lines Matching +full:in2 +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Public-key operation keyctls
14 #include <keys/user-type.h>
19 kfree(params->info); in keyctl_pkey_params_free()
20 key_put(params->key); in keyctl_pkey_params_free()
26 Opt_hash, /* "hash=<digest-name>" eg. "hash=sha1" */
42 char *c = params->info, *p, *q; in keyctl_pkey_params_parse()
50 return -EINVAL; in keyctl_pkey_params_parse()
52 return -EINVAL; in keyctl_pkey_params_parse()
55 return -EINVAL; in keyctl_pkey_params_parse()
59 params->encoding = q; in keyctl_pkey_params_parse()
63 params->hash_algo = q; in keyctl_pkey_params_parse()
67 return -EINVAL; in keyctl_pkey_params_parse()
87 params->encoding = "raw"; in keyctl_pkey_params_get()
92 params->info = p; in keyctl_pkey_params_get()
101 params->key = key_ref_to_ptr(key_ref); in keyctl_pkey_params_get()
103 if (!params->key->type->asym_query) in keyctl_pkey_params_get()
104 return -EOPNOTSUPP; in keyctl_pkey_params_get()
123 params->encoding = "raw"; in keyctl_pkey_params_get_2()
126 return -EFAULT; in keyctl_pkey_params_get_2()
132 ret = params->key->type->asym_query(params, &info); in keyctl_pkey_params_get_2()
140 return -EINVAL; in keyctl_pkey_params_get_2()
145 return -EINVAL; in keyctl_pkey_params_get_2()
150 return -EINVAL; in keyctl_pkey_params_get_2()
155 return -EINVAL; in keyctl_pkey_params_get_2()
161 params->in_len = uparams.in_len; in keyctl_pkey_params_get_2()
162 params->out_len = uparams.out_len; /* Note: same as in2_len */ in keyctl_pkey_params_get_2()
181 ret = params.key->type->asym_query(&params, &res); in keyctl_pkey_query()
185 ret = -EFAULT; in keyctl_pkey_query()
187 clear_user(_res->__spare, sizeof(_res->__spare)) == 0) in keyctl_pkey_query()
226 ret = -EOPNOTSUPP; in keyctl_pkey_e_d_s()
227 if (!params.key->type->asym_eds_op) in keyctl_pkey_e_d_s()
250 ret = -ENOMEM; in keyctl_pkey_e_d_s()
255 ret = params.key->type->asym_eds_op(&params, in, out); in keyctl_pkey_e_d_s()
260 ret = -EFAULT; in keyctl_pkey_e_d_s()
294 void *in, *in2; in keyctl_pkey_verify() local
302 ret = -EOPNOTSUPP; in keyctl_pkey_verify()
303 if (!params.key->type->asym_verify_signature) in keyctl_pkey_verify()
312 in2 = memdup_user(_in2, params.in2_len); in keyctl_pkey_verify()
313 if (IS_ERR(in2)) { in keyctl_pkey_verify()
314 ret = PTR_ERR(in2); in keyctl_pkey_verify()
319 ret = params.key->type->asym_verify_signature(&params, in, in2); in keyctl_pkey_verify()
321 kfree(in2); in keyctl_pkey_verify()