diff --git a/src/tpm2/Global.h b/src/tpm2/Global.h index 8b013ec2..73864810 100644 --- a/src/tpm2/Global.h +++ b/src/tpm2/Global.h @@ -73,6 +73,7 @@ _REDUCE_WARNING_LEVEL_(2) #include _NORMAL_WARNING_LEVEL_ #include "BackwardsCompatibility.h" // libtpms added + #include "Capabilities.h" #include "TpmTypes.h" #include "CommandAttributes.h" @@ -922,10 +923,6 @@ typedef struct state_reset_data UINT64 objectContextID; // This is the context ID for a saved // object context. The default reset // value is 0. -#ifndef NDEBUG -#undef CONTEXT_SLOT -#define CONTEXT_SLOT BYTE -#endif CONTEXT_SLOT contextArray[MAX_ACTIVE_SESSIONS]; // This array contains // contains the values used to track // the version numbers of saved diff --git a/src/tpm2/TpmBuildSwitches.h b/src/tpm2/TpmBuildSwitches.h index 0cacb4a8..66da38f9 100644 --- a/src/tpm2/TpmBuildSwitches.h +++ b/src/tpm2/TpmBuildSwitches.h @@ -3,7 +3,7 @@ /* Build Switches */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ -/* $Id: TpmBuildSwitches.h 1476 2019-06-10 19:32:03Z kgoldman $ */ +/* $Id: TpmBuildSwitches.h 1529 2019-11-21 23:29:01Z kgoldman $ */ /* */ /* Licenses and Notices */ /* */ @@ -211,6 +211,12 @@ // The switches in this group can only be enabled when doing debug during simulation #if SIMULATION && DEBUG +/* This forces the use of a smaller context slot size. This reduction reduces the range of the epoch + allowing the tester to force the epoch to occur faster than the normal defined in TpmProfile.h */ +# if !(defined CONTEXT_SLOT) +# define CONTEXT_SLOT UINT8 +# endif + // Enables use of the key cache. Default is YES # if !(defined USE_RSA_KEY_CACHE) \ || ((USE_RSA_KEY_CACHE != NO) && (USE_RSA_KEY_CACHE != YES)) diff --git a/src/tpm2/TpmProfile.h b/src/tpm2/TpmProfile.h index fc55bbb1..e6820a23 100644 --- a/src/tpm2/TpmProfile.h +++ b/src/tpm2/TpmProfile.h @@ -220,7 +220,7 @@ #define MAX_ACTIVE_SESSIONS 64 #endif #ifndef CONTEXT_SLOT -#define CONTEXT_SLOT UINT16 +#define CONTEXT_SLOT UINT8 /* libtpms: use 'old' type */ #endif #ifndef CONTEXT_COUNTER #define CONTEXT_COUNTER UINT64