]> git.proxmox.com Git - libtpms.git/commitdiff
tpm12: Build without support for maintentance commands
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Sat, 30 Mar 2019 12:42:12 +0000 (08:42 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Mon, 1 Apr 2019 14:16:25 +0000 (10:16 -0400)
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>
src/Makefile.am
src/tpm12/tpm_maint.c
src/tpm12/tpm_owner.c
src/tpm12/tpm_process.c

index fbaa3a5811fd72808db11a740105bd1eabdd8ede..529ed61aad67cfb7e340adbf59d5b55f00f2f3fe 100644 (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@
 
index 6cb65c74df4985f365e13387d8ac280dad5d4d7b..98753a2c4e73d1028e47c3a14f6ce518dfd32042 100644 (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>
index d05215044b85a9b6d4db1da69413dd36ad2f3a5c..6553b98597a24f5041e5be7dd93877d35751a8a2 100644 (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;
index f144a1b6668a96fa648a8d0a2284a1d6c584e0ed..d6a3b8e59af5054e4e8152fe79f96fd0fd0edb68 100644 (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,