Blame SOURCES/0001-tpm2_policycountertimer-Fix-an-issue-where-operandB-.patch

5b830c
From cab7b3edcc6a44aece0642c0c2621a4bb70d449b Mon Sep 17 00:00:00 2001
5b830c
From: Imran Desai <imran.desai@intel.com>
5b830c
Date: Tue, 10 Mar 2020 18:19:04 -0700
5b830c
Subject: [PATCH] tpm2_policycountertimer: Fix an issue where operandB array
5b830c
 was reversed
5b830c
5b830c
Signed-off-by: Imran Desai <imran.desai@intel.com>
5b830c
---
5b830c
 tools/tpm2_policycountertimer.c | 5 ++++-
5b830c
 1 file changed, 4 insertions(+), 1 deletion(-)
5b830c
5b830c
diff --git a/tools/tpm2_policycountertimer.c b/tools/tpm2_policycountertimer.c
5b830c
index 1c72d525dab7..170a544f2203 100644
5b830c
--- a/tools/tpm2_policycountertimer.c
5b830c
+++ b/tools/tpm2_policycountertimer.c
5b830c
@@ -81,7 +81,10 @@ static bool convert_keyvalue_to_operand_buffer(const char *value,
5b830c
     }
5b830c
 
5b830c
     ctx.operand_b.size = size;
5b830c
-    memcpy(ctx.operand_b.buffer, &data.b, size);
5b830c
+    size_t i = 0;
5b830c
+    for (i = 0; i < size; i++) {
5b830c
+        ctx.operand_b.buffer[i] = *(&data.b + size - i - 1);
5b830c
+    }
5b830c
 
5b830c
     return true;
5b830c
 }
5b830c
-- 
5b830c
2.31.0
5b830c