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:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:asymmetric_verify

Proto:int asymmetric_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
82  hdr = sig
84  ret = -ENOMEM
86  If siglen <= size of hdr Then Return -EBADMSG
89  siglen -= size of hdr
91  If siglen != be16_to_cpu(signature size ) Then Return -EBADMSG
94  If Digest algorithm [enum hash_algo] >= HASH_ALGO__LAST Then Return -ENOPKG
97  key = Request an asymmetric key.
98  If IS_ERR(key) Then Return PTR_ERR(key)
101  memset( & pks, 0, size of pks )
103  hash_algo = hash_algo_name[Digest algorithm [enum hash_algo] ]
104  If Digest algorithm [enum hash_algo] == HASH_ALGO_STREEBOG_256 || Digest algorithm [enum hash_algo] == HASH_ALGO_STREEBOG_512 Then
107  pkey_algo = "ecrdsa"
108  encoding = "raw"
109  Else
110  pkey_algo = "rsa"
111  encoding = "pkcs1"
113  digest = data
114  Number of bytes in digest = datalen
115  Signature = signature payload
116  Number of bytes in signature = siglen
117  ret = verify_signature(key, & pks)
118  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
119  pr_debug("%s() = %d\n", __func__, ret)
120  Return ret
Caller
NameDescribe
integrity_digsig_verify