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:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Get parameters from userspace. Callers must always call the free function* on params, even if an error is returned.

Proto:static int keyctl_pkey_params_get_2(const struct keyctl_pkey_params __user *_params, const char __user *_info, int op, struct kernel_pkey_params *params)

Type:int

Parameter:

TypeParameterName
const struct keyctl_pkey_params __user *_params
const char __user *_info
intop
struct kernel_pkey_params *params
122  memset(params, 0, size of params )
123  Encoding (eg. "oaep" or "raw" for none) = "raw"
125  If copy_from_user( & uparams, _params, size of uparams ) != 0 Then Return -EFAULT
128  ret = Interpret parameters. Callers must always call the free function* on params, even if an error is returned.
129  If ret < 0 Then Return ret
132  ret = asym_query(params, & info)
133  If ret < 0 Then Return ret
137  Case op == Encrypt a blob using a public key
138  Case op == Decrypt a blob using a public key
139  If Input data size > Maximum size of encrypted blob in bytes || Output buffer size (encrypt/decrypt/sign) > Maximum size of decrypted blob in bytes Then Return -EINVAL
142  Break
143  Case op == Create a public key signature
144  Case op == Verify a public key signature
145  If Input data size > Maximum size of signature in bytes || Output buffer size (encrypt/decrypt/sign) > Maximum size of raw data to sign in bytes Then Return -EINVAL
148  Break
149  Default
150  BUG()
153  Input data size = Input data size
154  Output buffer size (enc/dec/sign) = Output buffer size (encrypt/decrypt/sign)
155  Return 0
Caller
NameDescribe
keyctl_pkey_e_d_sEncrypt/decrypt/sign* Encrypt data, decrypt data or sign data using a public key
keyctl_pkey_verifyVerify a signature