From aa51031256c0c92e9e1de87f718336f379e46445 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 16 May 2018 09:13:41 -0400 Subject: [PATCH] Increase MIN_EVICT_OBJECTS to 7 for value of TPM_PT_HR_PERSISTENT_MIN Adapt the MIN_EVICT_OBJETCS #define value to 7 so that it meeds to TPM Profile (PTP) Specification and TPM_PT_HR_PERSISTENT_MIN returns the proper value. We allow to read the state from a TPM that had a lesser value before. Signed-off-by: Stefan Berger --- src/tpm2/Implementation.h | 2 +- src/tpm2/NVMarshal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tpm2/Implementation.h b/src/tpm2/Implementation.h index acf320dc..715ca6d6 100644 --- a/src/tpm2/Implementation.h +++ b/src/tpm2/Implementation.h @@ -360,7 +360,7 @@ #define MAX_LOADED_SESSIONS 3 #define MAX_SESSION_NUM 3 #define MAX_LOADED_OBJECTS 3 -#define MIN_EVICT_OBJECTS 2 +#define MIN_EVICT_OBJECTS 7 #define NUM_POLICY_PCR_GROUP 1 #define NUM_AUTHVALUE_PCR_GROUP 1 #define MAX_CONTEXT_SIZE 2474 diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 34a23d36..35d60819 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -3407,7 +3407,7 @@ static const struct _entry { { COMPILE_CONSTANT(MAX_LOADED_SESSIONS, EQ) }, { COMPILE_CONSTANT(MAX_SESSION_NUM, EQ) }, { COMPILE_CONSTANT(MAX_LOADED_OBJECTS, EQ) }, - { COMPILE_CONSTANT(MIN_EVICT_OBJECTS, EQ) }, + { COMPILE_CONSTANT(MIN_EVICT_OBJECTS, LE) }, { COMPILE_CONSTANT(NUM_POLICY_PCR_GROUP, EQ) }, { COMPILE_CONSTANT(NUM_AUTHVALUE_PCR_GROUP, EQ) }, { COMPILE_CONSTANT(MAX_CONTEXT_SIZE, EQ) },