Function report |
Source Code:security\integrity\ima\ima_appraise.c |
Create Date:2022-07-28 19:59:24 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:xattr_verify - verify xattr digest or signature* Verify whether the hash or signature matches the file contents.* Return 0 on success, error code otherwise.
Proto:static int xattr_verify(enum ima_hooks func, struct integrity_iint_cache *iint, struct evm_ima_xattr_data *xattr_value, int xattr_len, enum integrity_status *status, const char **cause)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| enum ima_hooks | func | |
| struct integrity_iint_cache * | iint | |
| struct evm_ima_xattr_data * | xattr_value | |
| int | xattr_len | |
| enum integrity_status * | status | |
| const char ** | cause |
| 214 | rc = -EINVAL , hash_start = 0 |
| 217 | Case type == IMA_XATTR_DIGEST_NG |
| 219 | hash_start = 1 |
| 221 | Case type == IMA_XATTR_DIGEST |
| 222 | If flags & IMA_DIGSIG_REQUIRED Then |
| 228 | If xattr_len - size of type - hash_start >= length Then rc = memcmp( & data[hash_start], digest, length) |
| 239 | If rc Then |
| 244 | status = INTEGRITY_PASS |
| 245 | Break |
| 246 | Case type == EVM_IMA_XATTR_DIGSIG |
| 248 | rc = integrity_digsig_verify(INTEGRITY_KEYRING_IMA, (constchar * )xattr_value, xattr_len, digest, length) |
| 253 | If rc == -EOPNOTSUPP Then |
| 254 | status = INTEGRITY_UNKNOWN |
| 255 | Break |
| 264 | If rc Then |
| 265 | cause = "invalid-signature" |
| 266 | status = INTEGRITY_FAIL |
| 267 | Else |
| 268 | status = INTEGRITY_PASS |
| 270 | Break |
| 271 | Default |
| 277 | Return rc |
| Name | Describe |
|---|---|
| ima_appraise_measurement | ma_appraise_measurement - appraise file measurement* Call evm_verifyxattr() to verify the integrity of 'security.ima'.* Assuming success, compare the xattr hash with the collected measurement.* Return 0 on success, error code otherwise |
| 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 |