vtpmmgr: Print error code to aid debugging

tpm_get_error_name returns "Unknown Error Code" when an error string
is not defined.  In that case, we should print the Error Code so it can
be looked up offline.  tpm_get_error_name returns a const string, so
just have the two callers always print the error code so it is always
available.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Jason Andryuk authored and Andrew Cooper committed 2021-05-07 19:50:50 +01:00
1 parent 93b2558fae
commit 15a59d6ef3
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -109,7 +109,7 @@
UINT32 rsp_status; \
UNPACK_OUT(TPM_RSP_HEADER, &rsp_tag, &rsp_len, &rsp_status); \
if (rsp_status != TPM_SUCCESS) { \
vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(rsp_status)); \
vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s (%x)\n", tpm_get_error_name(rsp_status), rsp_status); \
status = rsp_status; \
goto abort_egress; \
} \
+1 -1
View File
@@ -126,7 +126,7 @@
ptr = unpack_TPM_RSP_HEADER(ptr, \
&(tag), &(paramSize), &(status));\
if ((status) != TPM_SUCCESS){ \
vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", tpm_get_error_name(status));\
vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s (%x)\n", tpm_get_error_name(status), (status));\
goto abort_egress;\
}\
} while(0)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.