diff options
author | Dmitry Kasatkin <d.kasatkin@samsung.com> | 2013-04-25 03:43:56 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2013-10-25 17:16:58 -0400 |
commit | c7c8bb237fdbff932b5e431aebee5ce862ea07d1 (patch) | |
tree | 4cdbc7c250dd4418b47ab45dd1108848b50f8cff /security/integrity/ima/ima.h | |
parent | 3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8 (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.h | 7 |
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 */ |
40 | extern int ima_initialized; | 40 | extern int ima_initialized; |
41 | extern int ima_used_chip; | 41 | extern int ima_used_chip; |
42 | extern char *ima_hash; | 42 | extern int ima_hash_algo; |
43 | extern int ima_appraise; | 43 | extern int ima_appraise; |
44 | 44 | ||
45 | /* IMA inode template definition */ | 45 | /* IMA inode template definition */ |
@@ -70,8 +70,9 @@ void ima_fs_cleanup(void); | |||
70 | int ima_inode_alloc(struct inode *inode); | 70 | int ima_inode_alloc(struct inode *inode); |
71 | int ima_add_template_entry(struct ima_template_entry *entry, int violation, | 71 | int 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); |
73 | int ima_calc_file_hash(struct file *file, char *digest); | 73 | int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash); |
74 | int ima_calc_buffer_hash(const void *data, int len, char *digest); | 74 | int ima_calc_buffer_hash(const void *data, int len, |
75 | struct ima_digest_data *hash); | ||
75 | int ima_calc_boot_aggregate(char *digest); | 76 | int ima_calc_boot_aggregate(char *digest); |
76 | void ima_add_violation(struct inode *inode, const unsigned char *filename, | 77 | void ima_add_violation(struct inode *inode, const unsigned char *filename, |
77 | const char *op, const char *cause); | 78 | const char *op, const char *cause); |