KEYS: trusted: tpm2: Use struct tpm_buf for sized buffers
authorJarkko Sakkinen <jarkko@kernel.org>
Mon, 29 Apr 2024 20:27:57 +0000 (16:27 -0400)
committerJarkko Sakkinen <jarkko@kernel.org>
Thu, 9 May 2024 19:30:51 +0000 (22:30 +0300)
commit40813f1879e7b7d33bf70bcd67fb443e8e52247b
tree04b97491485633865543874d7093cdfe99642f8a
parentacd5eb4f50241c5e3c2e0056c0e2151295796416
KEYS: trusted: tpm2: Use struct tpm_buf for sized buffers

Take advantage of the new sized buffer (TPM2B) mode of struct tpm_buf in
tpm2_seal_trusted(). This allows to add robustness to the command
construction without requiring to calculate buffer sizes manually.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
security/keys/trusted-keys/trusted_tpm2.c