Skip to content

Commit 633cb72

Browse files
iokilljarkkojs
authored andcommitted
KEYS: trusted: improve scalability of trust source config
Enabling trusted keys requires at least one trust source implementation (currently TPM, TEE or CAAM) to be enabled. Currently, this is done by checking each trust source's config option individually. This does not scale when more trust sources like the one for DCP are added, because the condition will get long and hard to read. Add config HAVE_TRUSTED_KEYS which is set to true by each trust source once its enabled and adapt the check for having at least one active trust source to use this option. Whenever a new trust source is added, it now needs to select HAVE_TRUSTED_KEYS. Signed-off-by: David Gstir <[email protected]> Tested-by: Jarkko Sakkinen <[email protected]> # for TRUSTED_KEYS_TPM Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 3d16af0 commit 633cb72

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

security/keys/trusted-keys/Kconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
config HAVE_TRUSTED_KEYS
2+
bool
3+
14
config TRUSTED_KEYS_TPM
25
bool "TPM-based trusted keys"
36
depends on TCG_TPM >= TRUSTED_KEYS
@@ -9,6 +12,7 @@ config TRUSTED_KEYS_TPM
912
select ASN1_ENCODER
1013
select OID_REGISTRY
1114
select ASN1
15+
select HAVE_TRUSTED_KEYS
1216
help
1317
Enable use of the Trusted Platform Module (TPM) as trusted key
1418
backend. Trusted keys are random number symmetric keys,
@@ -20,6 +24,7 @@ config TRUSTED_KEYS_TEE
2024
bool "TEE-based trusted keys"
2125
depends on TEE >= TRUSTED_KEYS
2226
default y
27+
select HAVE_TRUSTED_KEYS
2328
help
2429
Enable use of the Trusted Execution Environment (TEE) as trusted
2530
key backend.
@@ -29,10 +34,11 @@ config TRUSTED_KEYS_CAAM
2934
depends on CRYPTO_DEV_FSL_CAAM_JR >= TRUSTED_KEYS
3035
select CRYPTO_DEV_FSL_CAAM_BLOB_GEN
3136
default y
37+
select HAVE_TRUSTED_KEYS
3238
help
3339
Enable use of NXP's Cryptographic Accelerator and Assurance Module
3440
(CAAM) as trusted key backend.
3541

36-
if !TRUSTED_KEYS_TPM && !TRUSTED_KEYS_TEE && !TRUSTED_KEYS_CAAM
37-
comment "No trust source selected!"
42+
if !HAVE_TRUSTED_KEYS
43+
comment "No trust source selected!"
3844
endif

0 commit comments

Comments
 (0)