Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:aa_calc_profile_hash

Proto:int aa_calc_profile_hash(struct aa_profile *profile, unsigned int version, void *start, size_t len)

Type:int

Parameter:

TypeParameterName
struct aa_profile *profile
unsigned intversion
void *start
size_tlen
64  SHASH_DESC_ON_STACK(desc, apparmor_tfm)
65  error = -ENOMEM
66  le32_version = cpu_to_le32(version)
68  If Not whether policy verification hashing is enabled Then Return 0
71  If Not apparmor_tfm Then Return 0
74  hash = 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).
75  If Not hash Then Go to fail
78  tfm = apparmor_tfm
80  error = 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
81  If error Then Go to fail
83  error = 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
84  If error Then Go to fail
86  error = 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
87  If error Then Go to fail
89  error = 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
90  If error Then Go to fail
93  Return 0
95  fail :
96  kfree(hash)
97  hash = NULL
99  Return error