summaryrefslogtreecommitdiff
path: root/MokManager.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-09-16 16:46:55 -0400
committerPeter Jones <pjones@redhat.com>2021-10-12 10:40:13 -0400
commit35ca373d20fbeeb80aff2202077d614bc89575c0 (patch)
tree5745d9e36cc713fe06577180fadf154ec9896f8b /MokManager.c
parent1872c929cc3a466c75336307901e67917bcc46bc (diff)
downloadefi-boot-shim-35ca373d20fbeeb80aff2202077d614bc89575c0.tar.gz
efi-boot-shim-35ca373d20fbeeb80aff2202077d614bc89575c0.zip
console: add a clear_screen() primitive
Several places in e.g. MokManager and our console library use ST->ConOut->ClearScreen directly, without checking for the existence of a console output device. This patch adds function to our console library to do that correctly, instead of using the bug-prone ad hoc implementation everywhere. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'MokManager.c')
-rw-r--r--MokManager.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/MokManager.c b/MokManager.c
index 4b6ee146..08b15d6d 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -1005,7 +1005,7 @@ static EFI_STATUS mok_reset_prompt(BOOLEAN MokX)
EFI_STATUS efi_status;
CHAR16 *prompt[] = { NULL, NULL };
- ST->ConOut->ClearScreen(ST->ConOut);
+ clear_screen();
if (MokX)
prompt[0] = L"Erase all stored keys in MokListX?";
@@ -1468,7 +1468,7 @@ static EFI_STATUS mok_sb_prompt(void *MokSB, UINTN MokSBSize)
return EFI_INVALID_PARAMETER;
}
- ST->ConOut->ClearScreen(ST->ConOut);
+ clear_screen();
message[0] = L"Change Secure Boot state";
message[1] = NULL;
@@ -1583,7 +1583,7 @@ static EFI_STATUS mok_db_prompt(void *MokDB, UINTN MokDBSize)
return EFI_INVALID_PARAMETER;
}
- ST->ConOut->ClearScreen(ST->ConOut);
+ clear_screen();
message[0] = L"Change DB state";
message[1] = NULL;
@@ -1691,7 +1691,7 @@ static EFI_STATUS mok_pw_prompt(void *MokPW, UINTN MokPWSize)
return EFI_INVALID_PARAMETER;
}
- ST->ConOut->ClearScreen(ST->ConOut);
+ clear_screen();
SetMem(hash, PASSWORD_CRYPT_SIZE, 0);
@@ -2008,7 +2008,7 @@ static BOOLEAN verify_pw(BOOLEAN * protected)
if (attributes & EFI_VARIABLE_RUNTIME_ACCESS)
return TRUE;
- ST->ConOut->ClearScreen(ST->ConOut);
+ clear_screen();
/* Draw the background */
console_save_and_set_mode(&SavedMode);