ima: Add digest and digest_len params to the functions to measure a buffer
authorRoberto Sassu <roberto.sassu@huawei.com>
Fri, 23 Jul 2021 08:53:04 +0000 (10:53 +0200)
committerMimi Zohar <zohar@linux.ibm.com>
Fri, 23 Jul 2021 13:27:02 +0000 (09:27 -0400)
commitca3c9bdb101d9b9eb3ed8a85cc0fe55915ba49de
tree46966a8fd69ed70c7223b0c044f5244fddaef4ce
parentce5bb5a86e5ebcd3c2e40e6dd1382027b5d43caf
ima: Add digest and digest_len params to the functions to measure a buffer

This patch performs the final modification necessary to pass the buffer
measurement to callers, so that they provide a functionality similar to
ima_file_hash(). It adds the 'digest' and 'digest_len' parameters to
ima_measure_critical_data() and process_buffer_measurement().

These functions calculate the digest even if there is no suitable rule in
the IMA policy and, in this case, they simply return 1 before generating a
new measurement entry.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
include/linux/ima.h
security/integrity/ima/ima.h
security/integrity/ima/ima_appraise.c
security/integrity/ima/ima_asymmetric_keys.c
security/integrity/ima/ima_init.c
security/integrity/ima/ima_main.c
security/integrity/ima/ima_queue_keys.c
security/selinux/ima.c