Age | Commit message (Collapse) | Author | |
---|---|---|---|
2018-03-12 | console: Add console_print and console_print_at helpers | Hans de Goede | |
This is a preparation commit for removing the setup_console(1) calls from MokManager and shim so that we don't force the EFI console to switch to text-mode. This commit replaces all direct calls to Print / PrintAt with calls to the new helpers (no functional changes) so that we can delay calling setup_console(1) till the first Print call in a follow-up patch. Signed-off-by: Hans de Goede <hdegoede@redhat.com> | |||
2018-03-12 | Don't use uefi_call_wrapper(), ever. | Peter Jones | |
I'm pretty done with typing uefi_call_wrapper() and counting arguments every time. Instead, just make the compiler error if we don't have ms_abi. Also, make it so nothing can use uefi_call_wrapper() directly. Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | lib: Use EFI_ERROR() instead of comparing to EFI_SUCCESS everywhere. | Peter Jones | |
Also consistently name our status variable "efi_status" unless there's a good reason not to, such as already having another one of those. Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | lib: find_in_variable_esl(): Fix a tiny nitpick clang-analyze has. | Peter Jones | |
clang-analyze believes the following: 311 EFI_STATUS 312 variable_enroll_hash(CHAR16 *var, EFI_GUID owner, 313 UINT8 hash[SHA256_DIGEST_SIZE]) 314 { 315 EFI_STATUS efi_status; 316 317 efi_status = find_in_variable_esl(var, owner, hash, SHA256_DIGEST_SIZE); > Calling 'find_in_variable_esl' → 260 EFI_STATUS 261 find_in_variable_esl(CHAR16* var, EFI_GUID owner, UINT8 *key, UINTN keylen) 262 { 263 UINTN DataSize; 264 UINT8 *Data; > ← 'Data' declared without an initial value → 265 EFI_STATUS efi_status; 266 267 efi_status = get_variable(var, &Data, &DataSize, owner); > ← Calling 'get_variable' → 237 EFI_STATUS 238 get_variable(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner) 239 { 240 return get_variable_attr(var, data, len, owner, NULL); > ← Calling 'get_variable_attr' → 213 EFI_STATUS 214 get_variable_attr(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner, 215 UINT32 *attributes) 216 { 217 EFI_STATUS efi_status; 218 219 *len = 0; 220 221 efi_status = GetVariable(var, &owner, NULL, len, NULL); > ← Calling 'GetVariable' → > ← Returning from 'GetVariable' → 222 if (efi_status != EFI_BUFFER_TOO_SMALL) > ← Assuming the condition is true → > ← Taking true branch → 223 return efi_status; 224 225 *data = AllocateZeroPool(*len); 226 if (!*data) 227 return EFI_OUT_OF_RESOURCES; 228 229 efi_status = GetVariable(var, &owner, attributes, len, *data); 230 if (EFI_ERROR(efi_status)) { 231 FreePool(*data); 232 *data = NULL; 233 } 234 return efi_status; 235 } And it can't figure out that the first GetVariable() call will, in fact, always return EFI_BUFFER_TOO_SMALL, and that AllocateZeroPool() will then *correctly* clobber the two variables we never assigned the value from. It also then believes that efi_status might have been returned /without/ being an error, and thinks that means we'll use the uninitialized pointer. This won't happen, but hey, let's make the code better express to the checker what is intended. Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | Use gcc's offsetof() instead of hacking out our own. | Peter Jones | |
Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | Don't have tons of local guid definitions for no reason at all. | Peter Jones | |
Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | lib/variables.c: reformat CreateTimeBasedPayload() | Peter Jones | |
Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2018-03-12 | Move includes around to clean the source tree up a bit. | Peter Jones | |
Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2014-06-25 | Make sure we default to assuming we're locked down. | Peter Jones | |
If "SecureBoot" exists but "SetupMode" does not, assume "SetupMode" says we're not in Setup Mode. Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2014-06-25 | Check the secure variables with the lib functions | Gary Ching-Pang Lin | |
There are functions defined in lib to check the secure variables. Use the functions to shun the duplicate code. Signed-off-by: Gary Ching-Pang Lin <glin@suse.com> Conflicts: shim.c | |||
2013-11-21 | Error check the right thing in get_variable_attr() when allocating. | Peter Jones | |
Signed-off-by: Peter Jones <pjones@redhat.com> | |||
2013-09-26 | Merge variable retrieving functions | Gary Ching-Pang Lin | |
2013-09-26 | Port MokManager to Linux Foundation loader UI code | Matthew Garrett | |
This is the first stage of porting the MokManager UI to the UI code used by the Linux Foundation UEFI loader. |