Skip to content
Commit 7d761119 authored by Jarkko Sakkinen's avatar Jarkko Sakkinen
Browse files

tpm: fix RC value check in tpm2_seal_trusted

The error code handling is broken as any error code that has the same
bits set as TPM_RC_HASH passes. Implemented tpm2_rc_value() helper to
parse the error value from FMT0 and FMT1 error codes so that these types
of mistakes are prevented in the future.

Fixes: 5ca4c20c

 ("keys, trusted: select hash algorithm for TPM2 chips")
Signed-off-by: default avatarJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
parent 419a16d9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment