From 2181b027650e169e1b25a67b2bca038cfb4db50b Mon Sep 17 00:00:00 2001 From: Benjamin Doron Date: Fri, 11 Jul 2025 17:11:40 -0400 Subject: [PATCH] util/smmstoretool: Properly initialise the authenticated variable header MonotonicCount is required, or UEFITool fails to parse the store. TimeStamp is required for variables with authenticated attributes. Change-Id: Iea933c9943ec18ea773700cdf1e3bede0e8ef292 Signed-off-by: Benjamin Doron Reviewed-on: https://review.coreboot.org/c/coreboot/+/88424 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- util/smmstoretool/fv.c | 1 - util/smmstoretool/vs.c | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/util/smmstoretool/fv.c b/util/smmstoretool/fv.c index 8ac8646d92..2744292761 100644 --- a/util/smmstoretool/fv.c +++ b/util/smmstoretool/fv.c @@ -73,7 +73,6 @@ bool fv_init(struct mem_range_t fv) ++vol_hdr_dst->Checksum; const VARIABLE_STORE_HEADER var_store_hdr = { - // Authentication-related fields will be filled with 0xff. .Signature = EfiAuthenticatedVariableGuid, // Actual size of the storage is block size, the rest is // Fault Tolerant Write (FTW) space and the FTW spare space. diff --git a/util/smmstoretool/vs.c b/util/smmstoretool/vs.c index 0060e69b02..f78ed0aad2 100644 --- a/util/smmstoretool/vs.c +++ b/util/smmstoretool/vs.c @@ -110,6 +110,10 @@ static void store_var(const struct var_t *var, bool is_auth_var_store, uint8_t * hdr.NameSize = var->name_size; hdr.DataSize = var->data_size; + hdr.MonotonicCount = 0; + memset(&hdr.TimeStamp, 0, sizeof(hdr.TimeStamp)); + //hdr.PubKeyIndex = 0; + memcpy(data, &hdr, sizeof(hdr)); data += sizeof(hdr); } else {