函数逻辑报告 |
Source Code:security\keys\key.c |
Create Date:2022-07-27 19:51:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:key_create_or_update - Update or create and instantiate a key.*@keyring_ref: A pointer to the destination keyring with possession flag.*@type: The type of key.*@description: The searchable description for the key.
函数原型:key_ref_t key_create_or_update(key_ref_t keyring_ref, const char *type, const char *description, const void *payload, size_t plen, key_perm_t perm, unsigned long flags)
返回类型:key_ref_t
参数:
类型 | 参数 | 名称 |
---|---|---|
key_ref_t | keyring_ref | |
const char * | type | |
const char * | description | |
const void * | payload | |
size_t | plen | |
key_perm_t | perm | |
unsigned long | flags |
816 | struct keyring_index_key index_key = {description = description, } |
820 | struct assoc_array_edit * edit = NULL |
821 | cred等于current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.() |
825 | struct key_restriction * restrict_link = NULL |
829 | type等于Find and lock the specified key type against removal.* We return with the sem read-locked if successful. If the type wasn't* available -ENOKEY is returned instead. |
830 | 如果是错误则 |
836 | 如果非instantiate或非description且非preparse则转到:error_put_type |
840 | keyring等于key_ref_to_ptr(keyring_ref) |
848 | 如果 type of key 不等于key_type_keyring则转到:error_put_type |
853 | Raw datalen 等于plen |
856 | 如果preparse则 |
869 | key_set_index_key( & index_key) |
871 | ret等于__key_link_lock(keyring, & index_key) |
872 | 如果ret小于0则 |
874 | 转到:error_free_prep |
878 | 如果ret小于0则 |
880 | 转到:error_link_end |
883 | 如果restrict_link且check则 |
886 | 如果ret小于0则 |
888 | 转到:error_link_end |
895 | 如果ret小于0则 |
897 | 转到:error_link_end |
904 | 如果update则 |
905 | key_ref等于find_key_to_update(keyring_ref, & index_key) |
906 | 如果key_ref则转到:found_matching_key |
911 | 如果perm恒等于KEY_PERM_UNDEF则 |
912 | perm等于possessor can view a key's attributes 按位或possessor can find a key in search / search a keyring 按位或possessor can create a link to a key/keyring 按位或possessor can set key attributes |
913 | perm或等于user permissions... |
926 | 如果是错误则 |
928 | 转到:error_link_end |
933 | 如果ret小于0则 |
936 | 转到:error_link_end |
941 | error_link_end : |
942 | Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called. |
943 | error_free_prep : |
944 | 如果preparse则free_preparse( & prep) |
946 | error_put_type : |
948 | error : |
949 | 返回:key_ref |
951 | found_matching_key : |
955 | Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called. |
957 | key等于key_ref_to_ptr(key_ref) |
959 | ret等于wait_for_key_construction(key, true) |
960 | 如果ret小于0则 |
967 | key_ref等于Attempt to update an existing key.* The key is given to us with an incremented refcount that we need to discard* if we get an error. |
968 | 转到:error_free_prep |
名称 | 描述 |
---|---|
SYSCALL_DEFINE5 | Extract the description of a new key from userspace and either add it as a* new key to the specified keyring or update a matching key in that keyring.* If the description is NULL or an empty string, the key type is asked to* generate one from the payload. |
integrity_add_key |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |