summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2014-02-13 15:05:45 +0800
committerPeter Jones <pjones@redhat.com>2015-06-16 11:41:32 -0400
commit8449925662f563fbef1b00e79b312052d72690db (patch)
tree8cd4b7fc7837bc84ebe55a203f2a2479090e3638 /MokManager.c
parent7cb3ee921352ecd1cc6e4ca3e68945ea1a9dfc71 (diff)
downloadefi-boot-shim-8449925662f563fbef1b00e79b312052d72690db.tar.gz
efi-boot-shim-8449925662f563fbef1b00e79b312052d72690db.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;
}