diff options
author | James Bottomley <JBottomley@Parallels.com> | 2012-12-20 11:39:03 +0000 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-12-20 11:39:03 +0000 |
commit | eb91bf11988729933288545c7cd74b59def30a2e (patch) | |
tree | 684c8f5749408c9570cf93632816f11b5703a633 | |
parent | 3456d0e7f0466ac71356036488e1140879389c1a (diff) | |
download | efitools-eb91bf11988729933288545c7cd74b59def30a2e.tar.gz |
Update with changes required by Microsoft
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | HashTool.c | 7 | ||||
-rw-r--r-- | KeyTool.c | 25 | ||||
-rw-r--r-- | Makefile | 2 |
3 files changed, 24 insertions, 10 deletions
@@ -157,12 +157,19 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab) if (indications & EFI_OS_INDICATIONS_BOOT_TO_FW_UI) reboot_to_uefi_menu = 1; +#if 0 + /* + * Microsoft objects to this code. What it does is test to see + * if the platform key is removable and offer a menu item to + * transition to setup mode + */ if (!variable_is_setupmode()) { if (change_setup_mode(0) == EFI_SUCCESS) { transition_to_setup = 1; change_setup_mode(1); } } +#endif for (;;) { @@ -250,18 +250,25 @@ show_key(int key, int offset, void *Data, int DataSize) title[++c] = tmpbuf1[i]; } title[++c] = NULL; - options[0] = L"Delete"; - options[1] = L"Save to File"; + + int o = 0; + int option_delete = -1, option_delete_w_auth = -1, option_save = -1; + + if (variable_is_setupmode()) { + option_delete = o; + options[o++] = L"Delete"; + } + option_save = o; + options[o++] = L"Save to File"; if (key == KEY_PK) { - options[2] = L"Delete with .auth File"; - options[3] = NULL; - } else { - options[2] = NULL; + option_delete_w_auth = o; + options[o++] = L"Delete with .auth File"; } + options[o++] = NULL; option = console_select(title, options, option); if (option == -1) return; - if (option == 0) { + if (option == option_delete) { EFI_STATUS status; if (offs == 0) { @@ -290,7 +297,7 @@ show_key(int key, int offset, void *Data, int DataSize) if (status != EFI_SUCCESS) console_error(L"Failed to delete key", status); - } else if (option == 1) { + } else if (option == option_save) { CHAR16 *filename; EFI_FILE *file; EFI_STATUS status; @@ -344,7 +351,7 @@ show_key(int key, int offset, void *Data, int DataSize) }); } FreePool(filename); - } else if (option == 2) { + } else if (option == option_delete_w_auth) { title[0] = L"Select authority bundle to remove PK"; title[1] = NULL; select_and_apply(title, L".auth", key, 0); @@ -51,7 +51,7 @@ noPK.esl: noPK.auth: noPK.esl PK.crt sign-efi-sig-list ./sign-efi-sig-list -c PK.crt -k PK.key PK $< $@ -hashlist.h: KeyTool.hash HashTool.hash Loader.hash +hashlist.h: HashTool.hash KeyTool.hash cat $^ > /tmp/tmp.hash xxd -i /tmp/tmp.hash > $@ rm -f /tmp/tmp.hash |