From 607d370c2fb0b776be9c860cf3f16be1dcab32a9 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 16 Jun 2015 11:41:32 -0400 Subject: MokManager: calculate the variable size correctly MokSize of the hash signature list includes the owner GUID, so we should not add the 16bytes compensation. Signed-off-by: Gary Ching-Pang Lin --- MokManager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MokManager.c') diff --git a/MokManager.c b/MokManager.c index 6992a7d9..12a91e92 100644 --- a/MokManager.c +++ b/MokManager.c @@ -972,7 +972,9 @@ static EFI_STATUS write_back_mok_list (MokListNode *list, INTN key_num, if (list[i].Mok == NULL) continue; - DataSize += sizeof(EFI_SIGNATURE_LIST) + sizeof(EFI_GUID); + DataSize += sizeof(EFI_SIGNATURE_LIST); + if (CompareGuid(&(list[i].Type), &CertType) == 0) + DataSize += sizeof(EFI_GUID); DataSize += list[i].MokSize; } -- cgit v1.2.3