qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] tpm_emulator: Translate TPM error codes to


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH 2/2] tpm_emulator: Translate TPM error codes to strings
Date: Thu, 25 Jul 2019 10:35:45 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 7/25/19 7:08 AM, Marc-André Lureau wrote:
Hi

On Thu, Jul 25, 2019 at 2:58 PM Stefan Berger
<address@hidden> wrote:
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 <address@hidden>
---
  hw/tpm/tpm_emulator.c | 50 ++++++++++++++++++++++++++++++++++---------
  1 file changed, 40 insertions(+), 10 deletions(-)

diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index 1288cbcb8d..186dde0838 100644
--- a/hw/tpm/tpm_emulator.c
+++ b/hw/tpm/tpm_emulator.c
@@ -82,6 +82,30 @@ typedef struct TPMEmulator {
      TPMBlobBuffers state_blobs;
  } TPMEmulator;

+struct tpm_error {
+    uint32_t tpm_result;
+    const char *string;
+};
+
+static const struct tpm_error tpm_errors[] = {
+    {  9 , "operation failed" },
+    {  32, "encryption error" },
+    {  33, "decryption error" },
+    /* TPM 2 codes */
+    { 0x101, "operation failed" },
+};
Wouldn't those codes be better defined in tpm_ioctl.h?

tpm_int.h has some already. will add some more there.


Stefan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]