Function report |
Source Code:security\keys\key.c |
Create Date:2022-07-28 18:16:17 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto: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)
Type:key_ref_t
Parameter:
Type | Parameter | Name |
---|---|---|
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. |
836 | If Not instantiate || Not description && Not preparse Then Go to error_put_type |
840 | keyring = key_ref_to_ptr(keyring_ref) |
848 | If type of key != key_type_keyring Then Go to error_put_type |
853 | Raw datalen = plen |
856 | If preparse Then |
858 | If ret < 0 Then |
860 | Go to error_free_prep |
862 | If Not description Then description = Proposed key description (or NULL) |
865 | If Not description Then Go to error_free_prep |
869 | key_set_index_key( & index_key) |
871 | ret = __key_link_lock(keyring, & index_key) |
872 | If ret < 0 Then |
874 | Go to error_free_prep |
878 | If ret < 0 Then |
880 | Go to error_link_end |
883 | If restrict_link && check Then |
886 | If ret < 0 Then |
888 | Go to error_link_end |
895 | If ret < 0 Then |
897 | Go to error_link_end |
904 | If update Then |
905 | key_ref = find_key_to_update(keyring_ref, & index_key) |
906 | If key_ref Then Go to found_matching_key |
911 | If perm == KEY_PERM_UNDEF Then |
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... |
915 | If read Then perm |= possessor can read key payload / view keyring |
918 | If type == key_type_keyring || update Then perm |= possessor can update key payload / add link to keyring |
928 | Go to error_link_end |
933 | If ret < 0 Then |
936 | Go to error_link_end |
939 | key_ref = make_key_ref(key, is_key_possessed(keyring_ref)) |
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 | If preparse Then free_preparse( & prep) |
946 | error_put_type : |
948 | error : |
949 | Return 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 | If ret < 0 Then |
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 | Go to error_free_prep |
Name | Describe |
---|---|
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 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |