]> git.proxmox.com Git - libtpms.git/commitdiff
Fix regression from 'Recalculate the entrysize in front of ...'
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 27 Jul 2018 21:17:18 +0000 (17:17 -0400)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 27 Jul 2018 21:22:20 +0000 (17:22 -0400)
The patch 'Recalculate the entrysize in front of every USER_NVRAM blob'
did not properly account for the TPM_HANDLE when recalculating the
entry size of an OBJECT in NVRAM. As a consequence all OBJECTS and NVRAM
indices following the first OBJECT got lost.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
src/tpm2/NVMarshal.c

index 29ea2ea53e229d935ccbeae91fbe1ab0c9aab902..6d068f5a7c42870c4c888950f124d454db8155b8 100644 (file)
@@ -4370,7 +4370,7 @@ USER_NVRAM_Unmarshal(BYTE **buffer, INT32 *size)
                     NvWrite(entryRef + o + offset, sizeof(obj), &obj);
                     offset += sizeof(obj);
                 }
-                entrysize = sizeof(UINT32) + sizeof(obj);
+                entrysize = sizeof(UINT32) + sizeof(TPM_HANDLE) + sizeof(obj);
             break;
             default:
                 TPMLIB_LogTPM2Error("USER_NVRAM: "