tpm2: Use CONTEXT_SLOT definition from TpmProfile.h

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-11-26 14:41:41 -05:00 committed by Stefan Berger
parent 1f686aa8e9
commit 2a28b96aac
3 changed files with 9 additions and 6 deletions

View File

@ -73,6 +73,7 @@ _REDUCE_WARNING_LEVEL_(2)
#include <stddef.h>
_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

View File

@ -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))

View File

@ -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