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 <benjamin.doron00@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88424 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
3058464263
commit
2181b02765
2 changed files with 4 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue