summaryrefslogtreecommitdiff
path: root/utility/tlcl_generator.c
diff options
context:
space:
mode:
authorMattias Nissler <mnissler@chromium.org>2017-07-10 13:46:20 +0200
committerchrome-bot <chrome-bot@chromium.org>2017-07-18 00:32:48 -0700
commit2a7e9b84ac69c374112a13fd16fbf7cb996b78bf (patch)
tree3a3ddc06183f57bc31262fbc2456142f66cd4dae /utility/tlcl_generator.c
parent68466c6d0a6cf629b77972773f523118b9cbb7be (diff)
downloadvboot-2a7e9b84ac69c374112a13fd16fbf7cb996b78bf.tar.gz
Implement tpmc getversion command.stabilize-9756.B
This command exposes the vendor and TPM firmware version. BRANCH=none BUG=chromium:728130 TEST=Builds and tpmc getversion prints plausible results. Change-Id: Iec556a298e025e10bda00121b40a25d8dc3839d1 Reviewed-on: https://chromium-review.googlesource.com/565287 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'utility/tlcl_generator.c')
-rw-r--r--utility/tlcl_generator.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/utility/tlcl_generator.c b/utility/tlcl_generator.c
index 7ed1d6c3..70ce5fd9 100644
--- a/utility/tlcl_generator.c
+++ b/utility/tlcl_generator.c
@@ -389,6 +389,21 @@ Command* BuildGetRandomCommand(void) {
return cmd;
}
+Command* BuildGetVersionValCommand(void) {
+ int size = (kTpmRequestHeaderLength +
+ sizeof(TPM_CAPABILITY_AREA) + /* capArea */
+ sizeof(uint32_t)); /* subCapSize */
+
+ Command* cmd = newCommand(TPM_ORD_GetCapability, size);
+ cmd->name = "tpm_getversionval_cmd";
+ AddInitializedField(cmd, kTpmRequestHeaderLength,
+ sizeof(TPM_CAPABILITY_AREA), TPM_CAP_GET_VERSION_VAL);
+ AddInitializedField(cmd, kTpmRequestHeaderLength +
+ sizeof(TPM_CAPABILITY_AREA),
+ sizeof(uint32_t), 0);
+ return cmd;
+}
+
/* Output the fields of a structure.
*/
void OutputFields(Field* fld) {
@@ -510,6 +525,7 @@ Command* (*builders[])(void) = {
BuildGetOwnershipCommand,
BuildGetRandomCommand,
BuildExtendCommand,
+ BuildGetVersionValCommand,
};
static void FreeFields(Field* fld) {