Function report |
Source Code:security\integrity\evm\evm_crypto.c |
Create Date:2022-07-28 20:00:09 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Calculate the HMAC value across the set of protected security xattrs.* Instead of retrieving the requested xattr, for performance, calculate* the hmac using the requested xattr value. Don't alloc/free memory for
Proto:static int evm_calc_hmac_or_hash(struct dentry *dentry, const char *req_xattr_name, const char *req_xattr_value, size_t req_xattr_value_len, uint8_t type, struct evm_digest *data)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct dentry * | dentry | |
| const char * | req_xattr_name | |
| const char * | req_xattr_value | |
| size_t | req_xattr_value_len | |
| uint8_t | type | |
| struct evm_digest * | data |
| 195 | xattr_size = 0 |
| 196 | char * xattr_value = NULL |
| 199 | bool ima_present = false |
| 201 | If Not (i_opflags & IOP_XATTR) || s_user_ns != userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ? Then Return -EOPNOTSUPP |
| 213 | bool is_ima = false |
| 215 | If strcmp(name, XATTR_NAME_IMA) == 0 Then is_ima = true |
| 218 | If req_xattr_name && req_xattr_value && Not strcmp(name, req_xattr_name) Then |
| 227 | size = vfs_getxattr_alloc(dentry, name, & xattr_value, xattr_size, GFP_NOFS) |
| 233 | If size < 0 Then Continue |
| 236 | error = 0 |
| 237 | xattr_size = size |
| 239 | If is_ima Then ima_present = true |
| 245 | If type == EVM_XATTR_PORTABLE_DIGSIG && Not ima_present Then Return -EPERM |
| 247 | out : |
| 248 | kfree(xattr_value) |
| 250 | Return error |
| Name | Describe |
|---|---|
| evm_calc_hmac | |
| evm_calc_hash |
| 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 |