Function report |
Source Code:security\integrity\ima\ima_api.c |
Create Date:2022-07-28 19:58:43 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ma_store_template - store ima template measurements* Calculate the hash of a template entry, add the template entry* to an ordered list of measurement entries maintained inside the kernel,* and also update the aggregate integrity value (maintained inside
Proto:int ima_store_template(struct ima_template_entry *entry, int violation, struct inode *inode, const unsigned char *filename, int pcr)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct ima_template_entry * | entry | |
| int | violation | |
| struct inode * | inode | |
| const unsigned char * | filename | |
| int | pcr |
| 95 | op[] = "add_template_measure" |
| 96 | audit_cause[] = "hashing_error" |
| 97 | template_name = name |
| 99 | struct{struct ima_digest_data hdr;char digest[20];}hash |
| 104 | If Not violation Then |
| 105 | num_fields = num_fields |
| 108 | algo = HASH_ALGO_SHA1 |
| 109 | result = ima_calc_field_array_hash( & template related data [0], template descriptor , num_fields, & hdr) |
| 112 | If result < 0 Then |
| 113 | integrity_audit_msg(PCR invalidation msgs , inode, template_name, op, audit_cause, result, 0) |
| 116 | Return result |
| 118 | memcpy( sha1 or md5 measurement hash , digest, length) |
| 122 | Return result |
| Name | Describe |
|---|---|
| process_buffer_measurement | process_buffer_measurement - Measure the buffer to ima log |
| ima_add_violation | ma_add_violation - add violation to measurement list.* Violations are flagged in the measurement list with zero hash values.* By extending the PCR with 0xFF's instead of with zeroes, the PCR* value is invalidated. |
| ima_store_measurement | ma_store_measurement - store file measurement* Create an "ima" template and then store the template by calling* ima_store_template |
| ima_add_boot_aggregate | Add the boot aggregate to the IMA measurement list and extend* the PCR register.* Calculate the boot aggregate, a SHA1 over tpm registers 0-7,* assuming a TPM chip exists, and zeroes if the TPM chip does not* exist |
| 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 |