Jarkko Sakkinen 7d761119a9 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: 5ca4c20cfd37 ("keys, trusted: select hash algorithm for TPM2 chips")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
2017-02-03 22:03:14 +02:00
..
2016-07-14 16:21:53 +09:00
2016-12-13 12:11:01 -08:00
2016-08-05 09:48:22 -04:00
2016-11-29 20:25:34 +01:00
2016-01-22 18:04:28 -05:00