Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: src/platform/tpm_lite/src/tlcl/generator.c

Issue 1056001: Additional cases for the test suite, and more commands added to TLCL (Closed)
Patch Set: Various fixes for review Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/tpm_lite/src/testsuite/writelimit.c ('k') | src/platform/tpm_lite/src/tlcl/tlcl.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1e48481e22c0c952fc50389608fc82b8322cc6bf..a1bc46bf60bdb90d8d7cf343f14b06c7ebb71a24 100644
--- a/src/platform/tpm_lite/src/tlcl/generator.c
+++ b/src/platform/tpm_lite/src/tlcl/generator.c
@@ -204,6 +204,47 @@ Command* BuildReadPubekCommand(void) {
return cmd;
}
+Command* BuildForceClearCommand(void) {
+ int size = kTpmRequestHeaderLength;
+ Command* cmd = newCommand(TPM_ORD_ForceClear, size);
+ cmd->name = "tpm_forceclear_cmd";
+ return cmd;
+}
+
+Command* BuildPhysicalEnableCommand(void) {
+ int size = kTpmRequestHeaderLength;
+ Command* cmd = newCommand(TPM_ORD_PhysicalEnable, size);
+ cmd->name = "tpm_physicalenable_cmd";
+ return cmd;
+}
+
+Command* BuildPhysicalSetDeactivatedCommand(void) {
+ int size = kTpmRequestHeaderLength + sizeof(uint8_t);
+ Command* cmd = newCommand(TPM_ORD_PhysicalSetDeactivated, size);
+ cmd->name = "tpm_physicalsetdeactivated_cmd";
+ AddVisibleField(cmd, "deactivated", kTpmRequestHeaderLength);
+ return cmd;
+}
+
+Command* BuildGetCapabilityCommand(void) {
+ int size = (kTpmRequestHeaderLength +
+ sizeof(TPM_CAPABILITY_AREA) + /* capArea */
+ sizeof(uint32_t) + /* subCapSize */
+ sizeof(uint32_t)); /* subCap */
+
+ Command* cmd = newCommand(TPM_ORD_GetCapability, size);
+ cmd->name = "tpm_getcapability_cmd";
+ AddInitializedField(cmd, kTpmRequestHeaderLength,
+ sizeof(TPM_CAPABILITY_AREA), TPM_CAP_FLAG);
+ AddInitializedField(cmd, kTpmRequestHeaderLength +
+ sizeof(TPM_CAPABILITY_AREA),
+ sizeof(uint32_t), sizeof(uint32_t));
+ AddInitializedField(cmd, kTpmRequestHeaderLength +
+ sizeof(TPM_CAPABILITY_AREA) + sizeof(uint32_t),
+ sizeof(uint32_t), TPM_CAP_FLAG_PERMANENT);
+ return cmd;
+}
+
/* Output the fields of a structure.
*/
void OutputFields(Field* fld) {
@@ -307,6 +348,10 @@ Command* (*builders[])(void) = {
BuildStartupCommand,
BuildSelftestfullCommand,
BuildReadPubekCommand,
+ BuildForceClearCommand,
+ BuildPhysicalEnableCommand,
+ BuildPhysicalSetDeactivatedCommand,
+ BuildGetCapabilityCommand,
};
static void FreeFields(Field* fld) {
« no previous file with comments | « src/platform/tpm_lite/src/testsuite/writelimit.c ('k') | src/platform/tpm_lite/src/tlcl/tlcl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698