aboutsummaryrefslogtreecommitdiffstats
path: root/security/integrity/ima/Kconfig
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2013-06-07 06:16:37 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2013-10-26 21:32:55 -0400
commite7a2ad7eb6f48ad80c70a22dd8167fb34b409466 (patch)
treed1b7e58d2029a273a347b9b9a08f35c50b244d27 /security/integrity/ima/Kconfig
parent9b9d4ce592d283fc4c01da746c02a840c499bb7e (diff)
ima: enable support for larger default filedata hash algorithms
The IMA measurement list contains two hashes - a template data hash and a filedata hash. The template data hash is committed to the TPM, which is limited, by the TPM v1.2 specification, to 20 bytes. The filedata hash is defined as 20 bytes as well. Now that support for variable length measurement list templates was added, the filedata hash is not limited to 20 bytes. This patch adds Kconfig support for defining larger default filedata hash algorithms and replacing the builtin default with one specified on the kernel command line. <uapi/linux/hash_info.h> contains a list of hash algorithms. The Kconfig default hash algorithm is a subset of this list, but any hash algorithm included in the list can be specified at boot, using the 'ima_hash=' kernel command line option. Changelog v2: - update Kconfig Changelog: - support hashes that are configured - use generic HASH_ALGO_ definitions - add Kconfig support - hash_setup must be called only once (Dmitry) - removed trailing whitespaces (Roberto Sassu) Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Diffstat (limited to 'security/integrity/ima/Kconfig')
-rw-r--r--security/integrity/ima/Kconfig35
1 files changed, 35 insertions, 0 deletions
diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig
index de26cc873ae6..351a58ed56ab 100644
--- a/security/integrity/ima/Kconfig
+++ b/security/integrity/ima/Kconfig
@@ -71,6 +71,41 @@ config IMA_DEFAULT_TEMPLATE
71 default "ima" if IMA_TEMPLATE 71 default "ima" if IMA_TEMPLATE
72 default "ima-ng" if IMA_NG_TEMPLATE 72 default "ima-ng" if IMA_NG_TEMPLATE
73 73
74choice
75 prompt "Default integrity hash algorithm"
76 default IMA_DEFAULT_HASH_SHA1
77 depends on IMA
78 help
79 Select the default hash algorithm used for the measurement
80 list, integrity appraisal and audit log. The compiled default
81 hash algorithm can be overwritten using the kernel command
82 line 'ima_hash=' option.
83
84 config IMA_DEFAULT_HASH_SHA1
85 bool "SHA1 (default)"
86 depends on CRYPTO_SHA1
87
88 config IMA_DEFAULT_HASH_SHA256
89 bool "SHA256"
90 depends on CRYPTO_SHA256 && !IMA_TEMPLATE
91
92 config IMA_DEFAULT_HASH_SHA512
93 bool "SHA512"
94 depends on CRYPTO_SHA512 && !IMA_TEMPLATE
95
96 config IMA_DEFAULT_HASH_WP512
97 bool "WP512"
98 depends on CRYPTO_WP512 && !IMA_TEMPLATE
99endchoice
100
101config IMA_DEFAULT_HASH
102 string
103 depends on IMA
104 default "sha1" if IMA_DEFAULT_HASH_SHA1
105 default "sha256" if IMA_DEFAULT_HASH_SHA256
106 default "sha512" if IMA_DEFAULT_HASH_SHA512
107 default "wp512" if IMA_DEFAULT_HASH_WP512
108
74config IMA_APPRAISE 109config IMA_APPRAISE
75 bool "Appraise integrity measurements" 110 bool "Appraise integrity measurements"
76 depends on IMA 111 depends on IMA