summaryrefslogtreecommitdiff
path: root/sysutils/shim/files/patch-MokManager.c
diff options
context:
space:
mode:
authorVinícius Zavam <egypcio@FreeBSD.org>2019-06-25 13:32:34 +0000
committerVinícius Zavam <egypcio@FreeBSD.org>2019-06-25 13:32:34 +0000
commit6d32de5baaecea7b9b4a70293954ac2f81ebb90d (patch)
treebd02cb4014256efd8671521537946504c2ee9b99 /sysutils/shim/files/patch-MokManager.c
parentsysutils/pot: Update to 0.6.1 (diff)
sysutils/shim: unbreak build with GCC 9
PR: 238654 Submitted by: tobik Approved by: mentors (implicit) Obtained from: https://github.com/rhboot/shim/pull/170
Notes
Notes: svn path=/head/; revision=505089
Diffstat (limited to 'sysutils/shim/files/patch-MokManager.c')
-rw-r--r--sysutils/shim/files/patch-MokManager.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/sysutils/shim/files/patch-MokManager.c b/sysutils/shim/files/patch-MokManager.c
index 316572c76815..bcbf832031c6 100644
--- a/sysutils/shim/files/patch-MokManager.c
+++ b/sysutils/shim/files/patch-MokManager.c
@@ -1,6 +1,6 @@
--- MokManager.c.orig 2015-06-30 18:20:12 UTC
+++ MokManager.c
-@@ -588,11 +588,11 @@ static void show_mok_info (EFI_GUID Type
+@@ -588,11 +588,11 @@ static void show_mok_info (EFI_GUID Type, void *Mok, U
static EFI_STATUS list_keys (void *KeyList, UINTN KeyListSize, CHAR16 *title)
{
@@ -14,3 +14,52 @@
if (KeyListSize < (sizeof(EFI_SIGNATURE_LIST) +
sizeof(EFI_SIGNATURE_DATA))) {
+@@ -1037,7 +1037,8 @@ static EFI_STATUS write_back_mok_list (MokListNode *li
+ continue;
+
+ DataSize += sizeof(EFI_SIGNATURE_LIST);
+- if (CompareGuid(&(list[i].Type), &CertType) == 0)
++ if (CompareMem(&(list[i].Type), &CertType,
++ sizeof(EFI_GUID)) == 0)
+ DataSize += sizeof(EFI_GUID);
+ DataSize += list[i].MokSize;
+ }
+@@ -1059,7 +1060,8 @@ static EFI_STATUS write_back_mok_list (MokListNode *li
+ CertList->SignatureType = list[i].Type;
+ CertList->SignatureHeaderSize = 0;
+
+- if (CompareGuid(&(list[i].Type), &CertType) == 0) {
++ if (CompareMem(&(list[i].Type), &CertType,
++ sizeof(EFI_GUID)) == 0) {
+ CertList->SignatureListSize = list[i].MokSize +
+ sizeof(EFI_SIGNATURE_LIST) +
+ sizeof(EFI_GUID);
+@@ -1100,7 +1102,8 @@ static void delete_cert (void *key, UINT32 key_size,
+ int i;
+
+ for (i = 0; i < mok_num; i++) {
+- if (CompareGuid(&(mok[i].Type), &CertType) != 0)
++ if (CompareMem(&(mok[i].Type), &CertType,
++ sizeof(EFI_GUID)) != 0)
+ continue;
+
+ if (mok[i].MokSize == key_size &&
+@@ -1151,7 +1154,7 @@ static void delete_hash_in_list (EFI_GUID Type, UINT8
+ sig_size = hash_size + sizeof(EFI_GUID);
+
+ for (i = 0; i < mok_num; i++) {
+- if ((CompareGuid(&(mok[i].Type), &Type) != 0) ||
++ if ((CompareMem(&(mok[i].Type), &Type, sizeof(EFI_GUID)) != 0) ||
+ (mok[i].MokSize < sig_size))
+ continue;
+
+@@ -1322,7 +1325,8 @@ static EFI_STATUS delete_keys (void *MokDel, UINTN Mok
+
+ /* Search and destroy */
+ for (i = 0; i < del_num; i++) {
+- if (CompareGuid(&(del_key[i].Type), &CertType) == 0) {
++ if (CompareMem(&(del_key[i].Type), &CertType,
++ sizeof(EFI_GUID)) == 0) {
+ delete_cert(del_key[i].Mok, del_key[i].MokSize,
+ mok, mok_num);
+ } else if (is_sha2_hash(del_key[i].Type)) {