提交 9fab303a 编写于 作者: M Mimi Zohar

ima: fix violation measurement list record

Although the violation digest in the IMA measurement list is always
zeroes, the size of the digest should be based on the hash algorithm.
Until recently the hash algorithm was hard coded to sha1.  Fix the
violation digest size included in the IMA measurement list.

This is just a cosmetic change which should not affect attestation.
Reported-by: NStefan Berger <stefanb@linux.ibm.com>
Fixes: 09091c44 ("ima: use IMA default hash algorithm for integrity violations")
Tested-by: NStefan Berger <stefanb@linux.ibm.com>
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
上级 51dd64bb
...@@ -323,10 +323,10 @@ static int ima_eventdigest_init_common(const u8 *digest, u32 digestsize, ...@@ -323,10 +323,10 @@ static int ima_eventdigest_init_common(const u8 *digest, u32 digestsize,
else else
/* /*
* If digest is NULL, the event being recorded is a violation. * If digest is NULL, the event being recorded is a violation.
* Make room for the digest by increasing the offset of * Make room for the digest by increasing the offset by the
* IMA_DIGEST_SIZE. * hash algorithm digest size.
*/ */
offset += IMA_DIGEST_SIZE; offset += hash_digest_size[hash_algo];
return ima_write_template_field_data(buffer, offset + digestsize, return ima_write_template_field_data(buffer, offset + digestsize,
fmt, field_data); fmt, field_data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册