]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: trusted: fix TPM trusted keys for generic framework
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 21 Apr 2021 22:52:37 +0000 (15:52 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 21 Apr 2021 23:30:06 +0000 (16:30 -0700)
commit02ce5b4c5fa75b3933ac952ed2c08e8789e7fe86
tree95839381b3dd85b564d5c6183c128e0eec93001a
parent564a8456f33aa2c3b1b24dde238b65bf34c33e01
KEYS: trusted: fix TPM trusted keys for generic framework

The generic framework patch broke the current TPM trusted keys because
it doesn't correctly remove the values consumed by the generic parser
before passing them on to the implementation specific parser.  Fix
this by having the generic parser return the string minus the consumed
tokens.

Additionally, there may be no tokens left for the implementation
specific parser, so make it handle the NULL case correctly and finally
fix a TPM 1.2 specific check for no keyhandle.

Fixes: 2eb67b35451e ("KEYS: trusted: Add generic trusted keys framework")
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
security/keys/trusted-keys/trusted_core.c
security/keys/trusted-keys/trusted_tpm1.c