KEYS: trusted: Add generic trusted keys framework
authorSumit Garg <sumit.garg@linaro.org>
Mon, 1 Mar 2021 13:11:24 +0000 (18:41 +0530)
committerJarkko Sakkinen <jarkko@kernel.org>
Wed, 14 Apr 2021 13:30:30 +0000 (16:30 +0300)
commit5d0682be318910e028bdf57c90a1695ffc34be37
tree37aa150e7a9dd030eb237cbddf8ede241c6db797
parente5fb5d2c5a03e229ded1f45aa2a42f2c288689c7
KEYS: trusted: Add generic trusted keys framework

Current trusted keys framework is tightly coupled to use TPM device as
an underlying implementation which makes it difficult for implementations
like Trusted Execution Environment (TEE) etc. to provide trusted keys
support in case platform doesn't posses a TPM device.

Add a generic trusted keys framework where underlying implementations
can be easily plugged in. Create struct trusted_key_ops to achieve this,
which contains necessary functions of a backend.

Also, define a module parameter in order to select a particular trust
source in case a platform support multiple trust sources. In case its
not specified then implementation itetrates through trust sources list
starting with TPM and assign the first trust source as a backend which
has initiazed successfully during iteration.

Note that current implementation only supports a single trust source at
runtime which is either selectable at compile time or during boot via
aforementioned module parameter.

Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
include/keys/trusted-type.h
include/keys/trusted_tpm.h
security/keys/trusted-keys/Makefile
security/keys/trusted-keys/trusted_core.c [new file with mode: 0644]
security/keys/trusted-keys/trusted_tpm1.c