Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\digsig_asymmetric.c Create Date:2022-07-28 19:56:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Request an asymmetric key.

Proto:static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid)

Type:struct key

Parameter:

TypeParameterName
struct key *keyring
uint32_tkeyid
29  sprintf(name, "id:%08x", keyid)
31  pr_debug("key search: \"%s\"\n", name)
33  key = get_ima_blacklist_keyring()
34  If key Then
37  kref = keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched
39  If Not IS_ERR(kref) Then
40  pr_err("Key '%s' is in ima_blacklist_keyring\n", name)
41  Return ERR_PTR( - EKEYREJECTED)
45  If keyring Then
49  kref = keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched
51  If IS_ERR(kref) Then key = ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
53  Else key = key_ref_to_ptr(kref)
55  Else
56  key = quest_key - Request a key and wait for construction*@type: Type of key.*@description: The searchable description of the key.*@callout_info: The data to pass to the instantiation upcall (or NULL).
59  If IS_ERR(key) Then
60  pr_err_ratelimited("Request for unknown key '%s' err %ld\n", name, PTR_ERR(key))
64  Case PTR_ERR(key) == -EACCES
65  Case PTR_ERR(key) == -ENOTDIR
66  Case PTR_ERR(key) == -EAGAIN
67  Return ERR_PTR( - ENOKEY)
68  Default
69  Return key
73  pr_debug("%s() = 0 [%x]\n", __func__, key_serial(key))
75  Return key
Caller
NameDescribe
asymmetric_verify