Blame SOURCES/0001-tpm2_policy.c-restrict-policy-digest-size.patch

cecfa4
From e556da0a2099573f82391c16477fba08584a7a12 Mon Sep 17 00:00:00 2001
cecfa4
From: Imran Desai <imran.desai@intel.com>
cecfa4
Date: Tue, 10 Mar 2020 09:15:55 -0700
cecfa4
Subject: [PATCH] tpm2_policy.c: restrict policy digest size
cecfa4
cecfa4
Fixes #1916
cecfa4
cecfa4
Signed-off-by: Imran Desai <imran.desai@intel.com>
cecfa4
---
cecfa4
 lib/tpm2_policy.c | 2 +-
cecfa4
 1 file changed, 1 insertion(+), 1 deletion(-)
cecfa4
cecfa4
diff --git a/lib/tpm2_policy.c b/lib/tpm2_policy.c
cecfa4
index 6c352b2b41ae..01387ba01645 100644
cecfa4
--- a/lib/tpm2_policy.c
cecfa4
+++ b/lib/tpm2_policy.c
cecfa4
@@ -163,7 +163,7 @@ tool_rc tpm2_policy_build_policyauthorize(ESYS_CONTEXT *ectx,
cecfa4
     bool result = true;
cecfa4
     TPM2B_DIGEST approved_policy = { .size = 0 };
cecfa4
     if (policy_digest_path) {
cecfa4
-        approved_policy.size = UINT16_MAX;
cecfa4
+        approved_policy.size = sizeof(TPMU_HA);
cecfa4
         result = files_load_bytes_from_path(policy_digest_path,
cecfa4
             approved_policy.buffer, &approved_policy.size);
cecfa4
     }
cecfa4
-- 
cecfa4
2.31.0
cecfa4