Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyctl_pkey.c Create Date:2022-07-28 18:27:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Encrypt/decrypt/sign* Encrypt data, decrypt data or sign data using a public key

Proto:long keyctl_pkey_e_d_s(int op, const struct keyctl_pkey_params __user *_params, const char __user *_info, const void __user *_in, void __user *_out)

Type:long

Parameter:

TypeParameterName
intop
const struct keyctl_pkey_params __user *_params
const char __user *_info
const void __user *_in
void __user *_out
216  ret = Get parameters from userspace. Callers must always call the free function* on params, even if an error is returned.
217  If ret < 0 Then Go to error_params
220  ret = -EOPNOTSUPP
221  If Not asym_eds_op Then Go to error_params
225  Case op == Encrypt a blob using a public key
226  op = kernel_pkey_encrypt
227  Break
228  Case op == Decrypt a blob using a public key
229  op = kernel_pkey_decrypt
230  Break
231  Case op == Create a public key signature
232  op = kernel_pkey_sign
233  Break
234  Default
235  BUG()
238  in = memdup_user - duplicate memory region from user space*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure. Result is physically* contiguous, to be freed by kfree().
239  If IS_ERR(in) Then
240  ret = PTR_ERR(in)
241  Go to error_params
244  ret = -ENOMEM
245  out = Allocation memory
246  If Not out Then Go to error_in
249  ret = asym_eds_op( & params, in, out)
250  If ret < 0 Then Go to error_out
253  If copy_to_user(_out, out, ret) != 0 Then ret = -EFAULT
256  error_out :
257  kfree(out)
258  error_in :
259  kfree(in)
260  error_params :
261  keyctl_pkey_params_free( & params)
262  Return ret
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs