tpm2: Use ANY_OBJECT_Marshal for OBJECTs is StateFormatLevel >=2

For profiles that work for libtpms v0.10 or later, so for
StatFormatLevel >=2, use ANY_MARSHAL_Object to write OBJECTS into
the NVRAM. This way OBJECTS are written in a more compact format.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2024-03-19 19:59:47 -04:00 committed by Stefan Berger
parent f8d9e6b853
commit e02af1e06b

View File

@ -589,7 +589,8 @@ void NvReadNvIndexInfo(NV_REF ref, // IN: points to NV where index is loc
// Convert an OBJECT into a buffer to store in NVRAM // libtpms added begin
UINT32 NvObjectToBuffer(OBJECT* object, BYTE* buffer, UINT32 size)
{
BOOL marshalAnyObject = false;
// always use ANY_OBJECT_Marshal if StateFormatLevel >=2 (v0.10)
BOOL marshalAnyObject = g_RuntimeProfile.stateFormatLevel >= 2;
pAssert(size >= MAX_MARSHALLED_OBJECT_SIZE);