cc67a2e864
- Add mokutil-check-corrupted-key-list.patch to check whether the key list is corrupted or not - Add mokutil-no-invalid-x509.patch to avoid importing an invalid x509 certificate OBS-URL: https://build.opensuse.org/request/show/229568 OBS-URL: https://build.opensuse.org/package/show/Base:System/mokutil?expand=0&rev=22
33 lines
1.0 KiB
Diff
33 lines
1.0 KiB
Diff
From e2e549583543bb0d607670b25af75821f55d5538 Mon Sep 17 00:00:00 2001
|
|
From: Gary Ching-Pang Lin <glin@suse.com>
|
|
Date: Thu, 10 Apr 2014 12:36:29 +0800
|
|
Subject: [PATCH] Check corrupted key list
|
|
|
|
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
|
|
---
|
|
src/mokutil.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/src/mokutil.c b/src/mokutil.c
|
|
index eb563ca..6792823 100644
|
|
--- a/src/mokutil.c
|
|
+++ b/src/mokutil.c
|
|
@@ -237,6 +237,14 @@ build_mok_list (void *data, unsigned long data_size, uint32_t *mok_num)
|
|
unsigned long count = 0;
|
|
|
|
while ((dbsize > 0) && (dbsize >= CertList->SignatureListSize)) {
|
|
+ if (CertList->SignatureListSize == 0 ||
|
|
+ CertList->SignatureListSize <= CertList->SignatureSize) {
|
|
+ fprintf (stderr, "Corrupted signature list\n");
|
|
+ if (list)
|
|
+ free (list);
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
if ((efi_guidcmp (CertList->SignatureType, EfiCertX509Guid) != 0) &&
|
|
(efi_guidcmp (CertList->SignatureType, EfiHashSha1Guid) != 0) &&
|
|
(efi_guidcmp (CertList->SignatureType, EfiHashSha224Guid) != 0) &&
|
|
--
|
|
1.8.4.5
|
|
|