aboutsummaryrefslogtreecommitdiff
path: root/hw/tpm/tpm_int.h
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2019-07-24 23:36:56 -0400
committerStefan Berger <stefanb@linux.vnet.ibm.com>2019-07-25 11:37:10 -0400
commit7e095e84ba0b7c0a1ac45bc6824dace2fd352e56 (patch)
tree7cb8ac307e1215748004177231f77cae40e41fc4 /hw/tpm/tpm_int.h
parentbcfd16fe26d6bb6eabfd2dfb46b9fda59d5493db (diff)
tpm_emulator: Translate TPM error codes to strings
Implement a function to translate TPM error codes to strings so that at least the most common error codes can be translated to human readable strings. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'hw/tpm/tpm_int.h')
-rw-r--r--hw/tpm/tpm_int.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/tpm/tpm_int.h b/hw/tpm/tpm_int.h
index a4c77fbd7e..3fb28a9d6c 100644
--- a/hw/tpm/tpm_int.h
+++ b/hw/tpm/tpm_int.h
@@ -39,7 +39,16 @@ struct tpm_resp_hdr {
#define TPM_TAG_RSP_AUTH1_COMMAND 0xc5
#define TPM_TAG_RSP_AUTH2_COMMAND 0xc6
+#define TPM_BAD_PARAMETER 3
#define TPM_FAIL 9
+#define TPM_KEYNOTFOUND 13
+#define TPM_BAD_PARAM_SIZE 25
+#define TPM_ENCRYPT_ERROR 32
+#define TPM_DECRYPT_ERROR 33
+#define TPM_BAD_KEY_PROPERTY 40
+#define TPM_BAD_MODE 44
+#define TPM_BAD_VERSION 46
+#define TPM_BAD_LOCALITY 61
#define TPM_ORD_ContinueSelfTest 0x53
#define TPM_ORD_GetTicks 0xf1
@@ -59,4 +68,8 @@ struct tpm_resp_hdr {
#define TPM2_PT_MAX_COMMAND_SIZE 0x11e
+#define TPM_RC_INSUFFICIENT 0x9a
+#define TPM_RC_FAILURE 0x101
+#define TPM_RC_LOCALITY 0x907
+
#endif /* TPM_TPM_INT_H */