summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2015-06-16 11:41:32 -0400
committerPeter Jones <pjones@redhat.com>2015-06-16 11:41:32 -0400
commit607d370c2fb0b776be9c860cf3f16be1dcab32a9 (patch)
tree8cd4b7fc7837bc84ebe55a203f2a2479090e3638 /MokManager.c
parentc9b0c3520c806b967750037fa8f68dbc5d23f6bb (diff)
downloadefi-boot-shim-607d370c2fb0b776be9c860cf3f16be1dcab32a9.tar.gz
efi-boot-shim-607d370c2fb0b776be9c860cf3f16be1dcab32a9.zip
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 <glin@suse.com>
Diffstat (limited to 'MokManager.c')
-rw-r--r--MokManager.c4
1 files changed, 3 insertions, 1 deletions
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;
}