diff options
| author | Gary Ching-Pang Lin <glin@suse.com> | 2014-04-10 15:55:35 +0800 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2015-06-16 11:46:14 -0400 |
| commit | efa9c47690a45f74db8918c9838e0e6f07ba103f (patch) | |
| tree | 37a7c90fd3d56bcd29ed60d6896d9651ba77b724 | |
| parent | 439f03171197d0e71c6553b58da3d43f0c362e98 (diff) | |
| download | efi-boot-shim-efa9c47690a45f74db8918c9838e0e6f07ba103f.tar.gz efi-boot-shim-efa9c47690a45f74db8918c9838e0e6f07ba103f.zip | |
MokManager: Discard the list contains an invalid signature
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
| -rw-r--r-- | MokManager.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/MokManager.c b/MokManager.c index ef0536c3..b9475be1 100644 --- a/MokManager.c +++ b/MokManager.c @@ -183,10 +183,8 @@ static UINT32 count_keys(void *Data, UINTN DataSize) } if (!is_valid_siglist(CertList->SignatureType, CertList->SignatureSize)) { - dbsize -= CertList->SignatureListSize; - CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList + - CertList->SignatureListSize); - continue; + console_errorbox(L"Invalid signature list found"); + return 0; } MokNum++; @@ -220,12 +218,9 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) { FreePool(list); return NULL; } - if (!is_valid_siglist(CertList->SignatureType, CertList->SignatureSize)) { - dbsize -= CertList->SignatureListSize; - CertList = (EFI_SIGNATURE_LIST *)((UINT8 *) CertList + - CertList->SignatureListSize); - continue; - } + + /* Omit the signature check here since we already did it + in count_keys() */ Cert = (EFI_SIGNATURE_DATA *) (((UINT8 *) CertList) + sizeof (EFI_SIGNATURE_LIST) + CertList->SignatureHeaderSize); |
