tpm12: Build without support for maintentance commands

Introduce TPM_NOMAINTENANCE_COMMANDS #define to build the TPM 1.2 code
without maintenance commands support. The state for the maintenance
commands has been written out so far, so we have to leave this part
alive even though nothing can be done with the maintenance key anymore.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-03-30 08:42:12 -04:00 committed by Stefan Berger
parent d0b9d9a9ff
commit 402fc2b1e1
4 changed files with 9 additions and 7 deletions

View File

@ -44,6 +44,8 @@ libtpms_tpm12_la_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
libtpms_tpm12_la_CFLAGS += -DTPM_NV_DISK
# build a POSIX type of TPM
libtpms_tpm12_la_CFLAGS += -DTPM_POSIX
# build without maintenance commands
libtpms_tpm12_la_CFLAGS += -DTPM_NOMAINTENANCE_COMMANDS
libtpms_tpm12_la_CFLAGS += @DEBUG_DEFINES@

View File

@ -37,7 +37,7 @@
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/********************************************************************************/
#ifndef TPM_NOMAINTENANCE
#if !defined(TPM_NOMAINTENANCE) && !defined(TPM_NOMAINTENANCE_COMMANDS)
#include <stdio.h>
#include <stdlib.h>

View File

@ -1035,7 +1035,7 @@ TPM_RESULT TPM_OwnerClearCommon(tpm_state_t *tpm_state,
tpm_state->tpm_permanent_flags.disableFullDALogicInfo = FALSE;
#endif
/* f. allowMaintenance */
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
tpm_state->tpm_permanent_flags.allowMaintenance = FALSE;
#else
tpm_state->tpm_permanent_flags.allowMaintenance = TRUE;

View File

@ -633,7 +633,7 @@ static TPM_ORDINAL_TABLE tpm_ordinal_table[] =
FALSE},
{TPM_ORD_CreateMaintenanceArchive,
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
TPM_Process_Unused, TPM_Process_Unused,
FALSE,
FALSE,
@ -1172,7 +1172,7 @@ static TPM_ORDINAL_TABLE tpm_ordinal_table[] =
FALSE},
{TPM_ORD_KillMaintenanceFeature,
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
TPM_Process_Unused, TPM_Process_Unused,
FALSE,
FALSE,
@ -1256,7 +1256,7 @@ static TPM_ORDINAL_TABLE tpm_ordinal_table[] =
FALSE},
{TPM_ORD_LoadMaintenanceArchive,
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
TPM_Process_Unused, TPM_Process_Unused,
FALSE,
FALSE,
@ -1275,7 +1275,7 @@ static TPM_ORDINAL_TABLE tpm_ordinal_table[] =
FALSE},
{TPM_ORD_LoadManuMaintPub,
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
TPM_Process_Unused, TPM_Process_Unused,
FALSE,
FALSE,
@ -1567,7 +1567,7 @@ static TPM_ORDINAL_TABLE tpm_ordinal_table[] =
FALSE},
{TPM_ORD_ReadManuMaintPub,
#ifdef TPM_NOMAINTENANCE
#if defined(TPM_NOMAINTENANCE) || defined(TPM_NOMAINTENANCE_COMMANDS)
TPM_Process_Unused, TPM_Process_Unused,
FALSE,
FALSE,