2013-07-23 04:44:22 +00:00
|
|
|
From 37b8af226ea8e3af467944b3b6253218ba13838c Mon Sep 17 00:00:00 2001
|
2013-03-08 08:06:19 +00:00
|
|
|
From: Gary Ching-Pang Lin <glin@suse.com>
|
|
|
|
Date: Fri, 8 Mar 2013 14:44:50 +0800
|
|
|
|
Subject: [PATCH] Correct the certificate count of the signature list
|
|
|
|
|
|
|
|
---
|
2013-07-23 04:44:22 +00:00
|
|
|
shim.c | 4 ++--
|
2013-03-08 08:06:19 +00:00
|
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/shim.c b/shim.c
|
2013-07-23 04:44:22 +00:00
|
|
|
index 806f065..7219d53 100644
|
2013-03-08 08:06:19 +00:00
|
|
|
--- a/shim.c
|
|
|
|
+++ b/shim.c
|
2013-07-23 04:44:22 +00:00
|
|
|
@@ -230,7 +230,7 @@ static CHECK_STATUS check_db_cert_in_ram(EFI_SIGNATURE_LIST *CertList,
|
2013-03-08 08:06:19 +00:00
|
|
|
|
|
|
|
while ((dbsize > 0) && (dbsize >= CertList->SignatureListSize)) {
|
|
|
|
if (CompareGuid (&CertList->SignatureType, &CertType) == 0) {
|
|
|
|
- CertCount = (CertList->SignatureListSize - CertList->SignatureHeaderSize) / CertList->SignatureSize;
|
|
|
|
+ CertCount = (CertList->SignatureListSize - sizeof (EFI_SIGNATURE_LIST) - CertList->SignatureHeaderSize) / CertList->SignatureSize;
|
|
|
|
Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) CertList + sizeof (EFI_SIGNATURE_LIST) + CertList->SignatureHeaderSize);
|
|
|
|
for (Index = 0; Index < CertCount; Index++) {
|
|
|
|
IsFound = AuthenticodeVerify (data->CertData,
|
2013-07-23 04:44:22 +00:00
|
|
|
@@ -295,7 +295,7 @@ static CHECK_STATUS check_db_hash_in_ram(EFI_SIGNATURE_LIST *CertList,
|
2013-03-08 08:06:19 +00:00
|
|
|
BOOLEAN IsFound = FALSE;
|
|
|
|
|
|
|
|
while ((dbsize > 0) && (dbsize >= CertList->SignatureListSize)) {
|
|
|
|
- CertCount = (CertList->SignatureListSize - CertList->SignatureHeaderSize) / CertList->SignatureSize;
|
|
|
|
+ CertCount = (CertList->SignatureListSize -sizeof (EFI_SIGNATURE_LIST) - CertList->SignatureHeaderSize) / CertList->SignatureSize;
|
|
|
|
Cert = (EFI_SIGNATURE_DATA *) ((UINT8 *) CertList + sizeof (EFI_SIGNATURE_LIST) + CertList->SignatureHeaderSize);
|
|
|
|
if (CompareGuid(&CertList->SignatureType, &CertType) == 0) {
|
|
|
|
for (Index = 0; Index < CertCount; Index++) {
|
|
|
|
--
|
2013-07-23 04:44:22 +00:00
|
|
|
1.8.1.4
|
2013-03-08 08:06:19 +00:00
|
|
|
|