summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2013-03-08 14:44:50 +0800
committerPeter Jones <pjones@redhat.com>2013-09-26 11:58:02 -0400
commit19e4fc298c76f94d20ac6675580704f37a3b1f68 (patch)
tree41137a79d8bc09f37681146abd41105122cccbe4
parent8e9124227d18475d3bc634c33518963fc8db7c98 (diff)
downloadefi-boot-shim-19e4fc298c76f94d20ac6675580704f37a3b1f68.tar.gz
efi-boot-shim-19e4fc298c76f94d20ac6675580704f37a3b1f68.zip
Correct the certificate count of the signature list
-rw-r--r--shim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shim.c b/shim.c
index 82270138..36285437 100644
--- a/shim.c
+++ b/shim.c
@@ -232,7 +232,7 @@ static CHECK_STATUS check_db_cert_in_ram(EFI_SIGNATURE_LIST *CertList,
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,
@@ -297,7 +297,7 @@ static CHECK_STATUS check_db_hash_in_ram(EFI_SIGNATURE_LIST *CertList,
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++) {