summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/console.c1
-rw-r--r--lib/guid.c2
-rw-r--r--lib/simple_file.c27
-rw-r--r--lib/variables.c2
4 files changed, 20 insertions, 12 deletions
diff --git a/lib/console.c b/lib/console.c
index a751f79d..f6038320 100644
--- a/lib/console.c
+++ b/lib/console.c
@@ -651,6 +651,7 @@ static struct {
{ EFI_PROTOCOL_ERROR, L"Protocol Error"},
{ EFI_INCOMPATIBLE_VERSION, L"Incompatible Version"},
{ EFI_SECURITY_VIOLATION, L"Security Violation"},
+ { EFI_HTTP_ERROR, L"HTTP Error"},
// warnings
{ EFI_WARN_UNKNOWN_GLYPH, L"Warning Unknown Glyph"},
diff --git a/lib/guid.c b/lib/guid.c
index 6e92cea3..1dc90ca9 100644
--- a/lib/guid.c
+++ b/lib/guid.c
@@ -35,5 +35,7 @@ EFI_GUID SECURITY_PROTOCOL_GUID = { 0xA46423E3, 0x4617, 0x49f1, {0xB9, 0xFF, 0xD
EFI_GUID SECURITY2_PROTOCOL_GUID = { 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68 } };
EFI_GUID EFI_MEMORY_ATTRIBUTE_PROTOCOL_GUID = { 0xf4560cf6, 0x40ec, 0x4b4a, {0xa1, 0x92, 0xbf, 0x1d, 0x57, 0xd0, 0xb1, 0x89} };
EFI_GUID SHIM_LOCK_GUID = {0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } };
+EFI_GUID SHIM_IMAGE_LOADER_GUID = {0x1f492041, 0xfadb, 0x4e59, {0x9e, 0x57, 0x7c, 0xaf, 0xe7, 0x3a, 0x55, 0xab } };
+EFI_GUID SHIM_LOADED_IMAGE_GUID = {0x6e6baeb8, 0x7108, 0x4179, {0x94, 0x9d, 0xa3, 0x49, 0x34, 0x15, 0xec, 0x97 } };
EFI_GUID MOK_VARIABLE_STORE = {0xc451ed2b, 0x9694, 0x45d3, {0xba, 0xba, 0xed, 0x9f, 0x89, 0x88, 0xa3, 0x89} };
EFI_GUID SECUREBOOT_EFI_NAMESPACE_GUID = {0x77fa9abd, 0x0359, 0x4d32, {0xbd, 0x60, 0x28, 0xf4, 0xe7, 0x8f, 0x78, 0x4b} };
diff --git a/lib/simple_file.c b/lib/simple_file.c
index f22852d4..abbc4975 100644
--- a/lib/simple_file.c
+++ b/lib/simple_file.c
@@ -170,7 +170,7 @@ simple_file_write_all(EFI_FILE *file, UINTN size, void *buffer)
EFI_STATUS
simple_volume_selector(CHAR16 **title, CHAR16 **selected, EFI_HANDLE *h)
{
- UINTN count, i;
+ UINTN count, i, j;
EFI_HANDLE *vol_handles = NULL;
EFI_STATUS efi_status;
CHAR16 **entries;
@@ -184,11 +184,11 @@ simple_volume_selector(CHAR16 **title, CHAR16 **selected, EFI_HANDLE *h)
if (!count || !vol_handles)
return EFI_NOT_FOUND;
- entries = AllocatePool(sizeof(CHAR16 *) * (count+1));
+ entries = AllocateZeroPool(sizeof(CHAR16 *) * (count+1));
if (!entries)
return EFI_OUT_OF_RESOURCES;
- for (i = 0; i < count; i++) {
+ for (i = 0, j = 0; i < count; i++) {
char buf[4096];
UINTN size = sizeof(buf);
EFI_FILE_SYSTEM_INFO *fi = (void *)buf;
@@ -208,19 +208,22 @@ simple_volume_selector(CHAR16 **title, CHAR16 **selected, EFI_HANDLE *h)
efi_status = root->GetInfo(root, &EFI_FILE_SYSTEM_INFO_GUID,
&size, fi);
- if (EFI_ERROR(efi_status))
- continue;
+ /* If GetInfo fails, try to form a name from DevicePath. */
+ if (EFI_ERROR(efi_status)){
+ name = NULL;
+ } else {
+ name = fi->VolumeLabel;
+ }
- name = fi->VolumeLabel;
if (!name || StrLen(name) == 0 || StrCmp(name, L" ") == 0)
name = DevicePathToStr(DevicePathFromHandle(vol_handles[i]));
- entries[i] = AllocatePool((StrLen(name) + 2) * sizeof(CHAR16));
- if (!entries[i])
+ entries[j] = AllocatePool((StrLen(name) + 2) * sizeof(CHAR16));
+ if (!entries[j])
break;
- StrCpy(entries[i], name);
+ StrCpy(entries[j++], name);
}
- entries[i] = NULL;
+ entries[j] = NULL;
val = console_select(title, entries, 0);
@@ -285,7 +288,7 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 *filter,
goto out;
ptr = next = *entries;
- for (i = 0; i < tot; i++) {
+ for (i = 0; next && i < tot; i++) {
int len = StrLen(next->FileName);
for (c = 0; c < filtercount; c++) {
@@ -308,7 +311,7 @@ simple_dir_filter(EFI_HANDLE image, CHAR16 *name, CHAR16 *filter,
*count = 0;
ptr = next = *entries;
- for (i = 0; i < tot; i++) {
+ for (i = 0; next && i < tot; i++) {
int len = StrLen(next->FileName);
if (StrCmp(next->FileName, L".") == 0)
diff --git a/lib/variables.c b/lib/variables.c
index 8e63aa8f..1a2c7d48 100644
--- a/lib/variables.c
+++ b/lib/variables.c
@@ -226,6 +226,8 @@ SetSecureVariable(const CHAR16 * const var, UINT8 *Data, UINTN len,
}
efi_status = CreateTimeBasedPayload(&DataSize, (UINT8 **)&Cert);
if (EFI_ERROR(efi_status)) {
+ if (Cert && Cert != (EFI_SIGNATURE_LIST *)Data)
+ FreePool(Cert);
console_print(L"Failed to create time based payload %d\n",
efi_status);
return efi_status;