• Roberto Sassu's avatar
    ima: define new function ima_alloc_init_template() to API · 7bc5f447
    Roberto Sassu authored
    Instead of allocating and initializing the template entry from multiple
    places (eg. boot aggregate, violation, and regular measurements), this
    patch defines a new function called ima_alloc_init_template().  The new
    function allocates and initializes the measurement entry with the inode
    digest and the filename.
    
    In respect to the current behavior, it truncates the file name passed
    in the 'filename' argument if the latter's size is greater than 255 bytes
    and the passed file descriptor is NULL.
    
    Changelog:
    - initialize 'hash' variable for non TPM case - Mimi
    - conform to expectation for 'iint' to be defined as a pointer. - Mimi
    - add missing 'file' dependency for recalculating file hash. - Mimi
    Signed-off-by: default avatarRoberto Sassu <roberto.sassu@polito.it>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
    7bc5f447
ima_api.c 9.08 KB