aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/ima.h
diff options
context:
space:
mode:
authorDmitry Kasatkin <d.kasatkin@samsung.com>2013-04-25 03:43:56 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2013-10-25 17:16:58 -0400
commitc7c8bb237fdbff932b5e431aebee5ce862ea07d1 (patch)
tree4cdbc7c250dd4418b47ab45dd1108848b50f8cff /security/integrity/ima/ima.h
parent3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8 (diff)
ima: provide support for arbitrary hash algorithms
In preparation of supporting more hash algorithms with larger hash sizes needed for signature verification, this patch replaces the 20 byte sized digest, with a more flexible structure. The new structure includes the hash algorithm, digest size, and digest. Changelog: - recalculate filedata hash for the measurement list, if the signature hash digest size is greater than 20 bytes. - use generic HASH_ALGO_ - make ima_calc_file_hash static - scripts lindent and checkpatch fixes Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima.h')
-rw-r--r--security/integrity/ima/ima.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h
index b3dd616560f7..eb86032f4f1e 100644
--- a/security/integrity/ima/ima.h
+++ b/security/integrity/ima/ima.h
@@ -39,7 +39,7 @@ enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8 };
39/* set during initialization */ 39/* set during initialization */
40extern int ima_initialized; 40extern int ima_initialized;
41extern int ima_used_chip; 41extern int ima_used_chip;
42extern char *ima_hash; 42extern int ima_hash_algo;
43extern int ima_appraise; 43extern int ima_appraise;
44 44
45/* IMA inode template definition */ 45/* IMA inode template definition */
@@ -70,8 +70,9 @@ void ima_fs_cleanup(void);
70int ima_inode_alloc(struct inode *inode); 70int ima_inode_alloc(struct inode *inode);
71int ima_add_template_entry(struct ima_template_entry *entry, int violation, 71int ima_add_template_entry(struct ima_template_entry *entry, int violation,
72 const char *op, struct inode *inode); 72 const char *op, struct inode *inode);
73int ima_calc_file_hash(struct file *file, char *digest); 73int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash);
74int ima_calc_buffer_hash(const void *data, int len, char *digest); 74int ima_calc_buffer_hash(const void *data, int len,
75 struct ima_digest_data *hash);
75int ima_calc_boot_aggregate(char *digest); 76int ima_calc_boot_aggregate(char *digest);
76void ima_add_violation(struct inode *inode, const unsigned char *filename, 77void ima_add_violation(struct inode *inode, const unsigned char *filename,
77 const char *op, const char *cause); 78 const char *op, const char *cause);