Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix key database parsing

The pointer to the certificate needs to be incremented by the size of the
entire certificate, not just the certificate data.
  • Loading branch information...
commit 59f2e0a28915e5a615bdde0b8c2465b7688a7e5b 1 parent cdde659
Matthew Garrett authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 MokManager.c
View
12 MokManager.c
@@ -108,7 +108,7 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
(CompareGuid (&CertList->SignatureType, &HashType) != 0)) {
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *)((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
continue;
}
@@ -116,7 +116,7 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
(CertList->SignatureSize != 48)) {
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *)((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
continue;
}
@@ -129,7 +129,7 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
count++;
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
}
return list;
@@ -414,7 +414,7 @@ static UINT8 list_keys (void *MokNew, UINTN MokNewSize)
Print(L"Doesn't look like a key or hash\n");
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
continue;
}
@@ -423,14 +423,14 @@ static UINT8 list_keys (void *MokNew, UINTN MokNewSize)
Print(L"Doesn't look like a valid hash\n");
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
continue;
}
MokNum++;
dbsize -= CertList->SignatureListSize;
CertList = (EFI_SIGNATURE_LIST *) ((UINT8 *) CertList +
- CertList->SignatureSize);
+ CertList->SignatureListSize);
}
keys = build_mok_list(MokNum, MokNew, MokNewSize);
Please sign in to comment.
Something went wrong with that request. Please try again.