Index: src/platform/tpm_lite/src/tlcl/generator.c |
diff --git a/src/platform/tpm_lite/src/tlcl/generator.c b/src/platform/tpm_lite/src/tlcl/generator.c |
index 1906d5f66439d372c3d2ec43a8b5a6f75c99fa57..f3762f48ab961e28f1bf5989af897fb7e4a6c8e0 100644 |
--- a/src/platform/tpm_lite/src/tlcl/generator.c |
+++ b/src/platform/tpm_lite/src/tlcl/generator.c |
@@ -16,6 +16,7 @@ |
#include <stdlib.h> |
#include <tss/tcs.h> |
+#include "tlcl.h" |
#include "tlcl_internal.h" |
#include "tpmextras.h" |
@@ -196,6 +197,13 @@ Command* BuildSelftestfullCommand(void) { |
return cmd; |
} |
+Command* BuildReadPubekCommand(void) { |
+ int size = kTpmRequestHeaderLength + sizeof(TPM_NONCE); |
+ Command* cmd = newCommand(TPM_ORD_ReadPubek, size); |
+ cmd->name = "tpm_readpubek_cmd"; |
+ return cmd; |
+} |
+ |
/* Output the fields of a structure. |
*/ |
void OutputFields(Field* fld) { |
@@ -298,6 +306,7 @@ Command* (*builders[])(void) = { |
BuildPhysicalPresenceCommand, |
BuildStartupCommand, |
BuildSelftestfullCommand, |
+ BuildReadPubekCommand, |
}; |
static void FreeFields(Field* fld) { |
@@ -312,6 +321,7 @@ static void FreeCommands(Command* cmd) { |
if (cmd != NULL) { |
Command* next_command = cmd->next; |
free(cmd); |
+ FreeFields(cmd->fields); |
FreeCommands(next_command); |
} |
} |
@@ -327,7 +337,7 @@ int main(void) { |
printf("/* This file is automatically generated */\n\n"); |
OutputCommands(commands); |
- printf("const int kWriteInfoLength = %ld;\n", sizeof(TPM_WRITE_INFO)); |
+ printf("const int kWriteInfoLength = %d;\n", (int) sizeof(TPM_WRITE_INFO)); |
FreeCommands(commands); |
return 0; |