From 1d918e542675a3bd77b893148d6dda0aa3eef49e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Fri, 27 Jul 2018 17:17:18 -0400 Subject: [PATCH] Fix regression from 'Recalculate the entrysize in front of ...' 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 --- src/tpm2/NVMarshal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 29ea2ea5..6d068f5a 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -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: "