KEYS: trusted: improve scalability of trust source config
authorDavid Gstir <david@sigma-star.at>
Wed, 3 Apr 2024 07:21:18 +0000 (09:21 +0200)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 9 May 2024 15:29:03 +0000 (18:29 +0300)
commit633cb72fb6969e420518fee4b2ae6040688ecc5a
tree6190bad926f788ef08cae3bef95c5ea33a531a0c
parent3d16af0b4cfac4b2c3b238e2ec37b38c2f316978
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 <david@sigma-star.at>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org> # for TRUSTED_KEYS_TPM
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/Kconfig