函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\encrypted-keys\encrypted.c Create Date:2022-07-27 20:06:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:datablob_parse - parse the keyctl data* datablob format:* new [<format>] <master-key name> <decrypted data length>* load [<format>] <master-key name> <decrypted data length>* <encrypted iv + data>* update <new-master-key name>* Tokenizes a copy of the

函数原型:static int datablob_parse(char *datablob, const char **format, char **master_desc, char **decrypted_datalen, char **hex_encoded_iv)

返回类型:int

参数:

类型参数名称
char *datablob
const char **format
char **master_desc
char **decrypted_datalen
char **hex_encoded_iv
176  ret等于负EINVAL
181  keyword等于分割字符串
182  如果非keyword
183  打印信息("encrypted_key: insufficient parameters specified\n")
184  返回:ret
186  key_cmd等于match_token(keyword, key_tokens, args)
189  p等于分割字符串
190  如果非p
191  打印错误信息("encrypted_key: insufficient parameters specified\n")
192  返回:ret
195  key_format等于match_token(p, key_format_tokens, args)
197  :key_format恒等于Opt_ecryptfs
198  :key_format恒等于Opt_enc32
199  :key_format恒等于Opt_default
200  format等于p
201  master_desc等于分割字符串
202  退出
203  :key_format恒等于Opt_error
204  master_desc等于p
205  退出
208  如果非master_desc
209  打印信息("encrypted_key: master key parameter is missing\n")
210  转到:out
213  如果valid_master_desc - verify the 'key-type:desc' of a new/updated master-key* key-type:= "trusted:" | "user:"* desc:= master-key description* Verify that 'key-type' is valid and that 'desc' exists. On key update,小于0则
214  打印信息("encrypted_key: master key parameter \'%s\' is invalid\n", * master_desc)
216  转到:out
219  如果decrypted_datalen
220  decrypted_datalen等于分割字符串
221  如果非decrypted_datalen
222  打印信息("encrypted_key: keylen parameter is missing\n")
223  转到:out
228  :key_cmd恒等于Opt_new
229  如果非decrypted_datalen
230  打印信息("encrypted_key: keyword \'%s\' not allowed when called from .update method\n", keyword)
232  退出
234  ret等于0
235  退出
236  :key_cmd恒等于Opt_load
237  如果非decrypted_datalen
238  打印信息("encrypted_key: keyword \'%s\' not allowed when called from .update method\n", keyword)
240  退出
243  如果非hex_encoded_iv
244  打印信息("encrypted_key: hex blob is missing\n")
245  退出
247  ret等于0
248  退出
249  :key_cmd恒等于Opt_update
250  如果decrypted_datalen
251  打印信息("encrypted_key: keyword \'%s\' not allowed when called from .instantiate method\n", keyword)
254  退出
256  ret等于0
257  退出
258  :key_cmd恒等于Opt_err
259  打印信息("encrypted_key: keyword \'%s\' not recognized\n", keyword)
261  退出
263  out :
264  返回:ret
调用者
名称描述
encrypted_instantiaterypted_instantiate - instantiate an encrypted key* Decrypt an existing encrypted datablob or create a new encrypted key* based on a kernel random number.* On success, return 0. Otherwise return errno.
encrypted_updaterypted_update - update the master key description* Change the master key description for an existing encrypted key.* The next read will return an encrypted datablob using the new* master key description.* On success, return 0. Otherwise return errno.