summaryrefslogtreecommitdiff
path: root/utility/tpmc.c
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@google.com>2010-08-25 07:16:03 -0700
committerLuigi Semenzato <semenzato@google.com>2010-08-25 07:16:03 -0700
commit5896b9664d088699e246de964a7c374af663a34e (patch)
tree6e2ccfa2c5c9e8d897ea7dc7f70d4fd37f4f0c49 /utility/tpmc.c
parent41656c082dac41132d6e9577a069c4f2360d1eca (diff)
downloadvboot-5896b9664d088699e246de964a7c374af663a34e.tar.gz
Added new commands and reactivated full rebuild after fixing for ARM ebuild.
Review URL: http://codereview.chromium.org/3116025 Change-Id: Ideb82562f6b1c3ce5cd9e0b79de250d0a7bd976e
Diffstat (limited to 'utility/tpmc.c')
-rw-r--r--utility/tpmc.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/utility/tpmc.c b/utility/tpmc.c
index b74bf1c4..0213b4b4 100644
--- a/utility/tpmc.c
+++ b/utility/tpmc.c
@@ -200,6 +200,52 @@ static uint32_t HandlerGetPermissions(void) {
return result;
}
+static uint32_t HandlerGetPermanentFlags(void) {
+ TPM_PERMANENT_FLAGS pflags;
+ uint32_t result = TlclGetPermanentFlags(&pflags);
+ if (result == 0) {
+#define P(name) printf("%s %d\n", #name, pflags.name)
+ P(disable);
+ P(ownership);
+ P(deactivated);
+ P(readPubek);
+ P(disableOwnerClear);
+ P(allowMaintenance);
+ P(physicalPresenceLifetimeLock);
+ P(physicalPresenceHWEnable);
+ P(physicalPresenceCMDEnable);
+ P(CEKPUsed);
+ P(TPMpost);
+ P(TPMpostLock);
+ P(FIPS);
+ P(Operator);
+ P(enableRevokeEK);
+ P(nvLocked);
+ P(readSRKPub);
+ P(tpmEstablished);
+ P(maintenanceDone);
+ P(disableFullDALogicInfo);
+#undef P
+ }
+ return result;
+}
+
+static uint32_t HandlerGetSTClearFlags(void) {
+ TPM_STCLEAR_FLAGS vflags;
+ uint32_t result = TlclGetSTClearFlags(&vflags);
+ if (result == 0) {
+#define P(name) printf("%s %d\n", #name, vflags.name)
+ P(deactivated);
+ P(disableForceClear);
+ P(physicalPresence);
+ P(physicalPresenceLock);
+ P(bGlobalLock);
+#undef P
+ }
+ return result;
+}
+
+
/* Table of TPM commands.
*/
command_record command_table[] = {
@@ -232,6 +278,10 @@ command_record command_table[] = {
HandlerRead },
{ "getpermissions", "getp", "print space permissions (getp <index>)",
HandlerGetPermissions },
+ { "getpermanentflags", "getpf", "print all permanent flags",
+ HandlerGetPermanentFlags },
+ { "getstclearflags", "getvf", "print all volatile (ST_CLEAR) flags",
+ HandlerGetSTClearFlags },
};
static int n_commands = sizeof(command_table) / sizeof(command_table[0]);