Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\digsig.c Create Date:2022-07-28 07:20:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:digsig_verify() - digital signature verification with public key*@keyring: keyring to search key in*@sig: digital signature*@siglen: length of the signature*@data: data*@datalen: length of the data* Returns 0 on success, -EINVAL otherwise

Proto:int digsig_verify(struct key *keyring, const char *sig, int siglen, const char *data, int datalen)

Type:int

Parameter:

TypeParameterName
struct key *keyring
const char *sig
intsiglen
const char *data
intdatalen
202  err = -ENOMEM
203  sh = sig
204  struct shash_desc * desc = NULL
209  If siglen < size of sh + 2 Then Return -EINVAL
212  If algo != PUBKEY_ALGO_RSA Then Return -Operation is not supported
215  sprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@fmt: The format string to use*@...: Arguments for the format string* The function returns the number of characters written* into @buf
217  If keyring Then
220  kref = keyring_search - Search the supplied keyring tree for a matching key*@keyring: The root of the keyring tree to be searched
222  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.
224  Else key = key_ref_to_ptr(kref)
226  Else
227  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).
229  If IS_ERR(key) Then
230  pr_err("key not found, id: %s\n", name)
231  Return PTR_ERR(key)
234  desc = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
236  If Not desc Then Go to err
239  tfm = shash
241  rypto_shash_init() - (re)initialize message digest*@desc: operational state handle that is already filled* The call (re-)initializes the message digest referenced by the* operational state handle. Any potentially existing state created by
242  rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
243  rypto_shash_update() - add data to message digest for processing*@desc: operational state handle that is already initialized*@data: input data to be added to the message digest*@len: length of the input data
244  rypto_shash_final() - calculate message digest*@desc: operational state handle that is already filled with data*@out: output buffer filled with the message digest* Finalize the message digest operation and create the message digest
246  kfree(desc)
249  err = RSA Signature verification with public key
252  err :
253  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
255  Return If err Then -EINVAL Else 0