|
|
d5d7cb |
From 334b4c739fa575fb4ea58f92df6de87c38e59e15 Mon Sep 17 00:00:00 2001
|
|
|
d5d7cb |
From: Imran Desai <imran.desai@intel.com>
|
|
|
d5d7cb |
Date: Thu, 23 Jan 2020 08:06:56 -0700
|
|
|
d5d7cb |
Subject: [PATCH] tpm2_hierarchycontrol: Fixed bug where hierarchycontrol
|
|
|
d5d7cb |
operation failed silently
|
|
|
d5d7cb |
|
|
|
d5d7cb |
Fixes #1841
|
|
|
d5d7cb |
|
|
|
d5d7cb |
Signed-off-by: Imran Desai <imran.desai@intel.com>
|
|
|
d5d7cb |
---
|
|
|
d5d7cb |
tools/tpm2_hierarchycontrol.c | 10 ++++++++--
|
|
|
d5d7cb |
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
d5d7cb |
|
|
|
d5d7cb |
diff --git a/tools/tpm2_hierarchycontrol.c b/tools/tpm2_hierarchycontrol.c
|
|
|
d5d7cb |
index 0baf2ca487d3..7e9e2c657544 100644
|
|
|
d5d7cb |
--- a/tools/tpm2_hierarchycontrol.c
|
|
|
d5d7cb |
+++ b/tools/tpm2_hierarchycontrol.c
|
|
|
d5d7cb |
@@ -32,8 +32,14 @@ static tool_rc hierarchycontrol(ESYS_CONTEXT *ectx) {
|
|
|
d5d7cb |
ctx.enable == TPM2_RH_ENDORSEMENT ? "ehEnable" : "phEnableNV",
|
|
|
d5d7cb |
ctx.state ? "SET" : "CLEAR");
|
|
|
d5d7cb |
|
|
|
d5d7cb |
- return tpm2_hierarchycontrol(ectx, &ctx.auth_hierarchy.object, ctx.enable,
|
|
|
d5d7cb |
- ctx.state);
|
|
|
d5d7cb |
+ tool_rc rc = tpm2_hierarchycontrol(ectx, &ctx.auth_hierarchy.object,
|
|
|
d5d7cb |
+ ctx.enable, ctx.state);
|
|
|
d5d7cb |
+
|
|
|
d5d7cb |
+ if (rc != tool_rc_success) {
|
|
|
d5d7cb |
+ LOG_ERR("Failed hierarchycontrol operation.");
|
|
|
d5d7cb |
+ }
|
|
|
d5d7cb |
+
|
|
|
d5d7cb |
+ return rc;
|
|
|
d5d7cb |
}
|
|
|
d5d7cb |
|
|
|
d5d7cb |
bool on_arg(int argc, char **argv) {
|
|
|
d5d7cb |
--
|
|
|
d5d7cb |
2.27.0
|
|
|
d5d7cb |
|