Use better error code when key reload fails.

When an operation uses a key that has been evicted from the TPM, tcsd
attempts to reload the key. On some TPMs this can fail with
TPM_E_AUTHFAIL. We want to convert this into something more appropriate
so an application can distinguish this case from an actual authorization
problem with the current operation.

TEST=Reproduce the problem and verify the error code.

Change-Id: I918f4e2c12c6258c8078ea10a3562c1e6345cfb9
Reviewed-by: Kees Cook <>
Commit-Ready: Darren Krahn <>
Tested-by: Darren Krahn <>
1 file changed