verifiers: File type for fine-grained signature-verification controlling

Let's provide file type info to the I/O layer. This way verifiers
framework and its users will be able to differentiate files and verify
only required ones.

This is preparatory patch.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
This commit is contained in:
Vladimir Serbinenko 2013-11-20 02:28:29 +01:00 committed by Vincent Batts
parent e1bc2b23f1
commit aebe31c375
70 changed files with 292 additions and 221 deletions

View file

@ -172,8 +172,8 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
grub_dl_ref (my_mod);
grub_file_filter_disable_compression ();
file = grub_file_open (filename);
file = grub_file_open (filename, GRUB_FILE_TYPE_PCCHAINLOADER
| GRUB_FILE_TYPE_NO_DECOMPRESS);
if (! file)
goto fail;

View file

@ -110,7 +110,7 @@ grub_cmd_freedos (grub_command_t cmd __attribute__ ((unused)),
if (!rel)
goto fail;
file = grub_file_open (argv[0]);
file = grub_file_open (argv[0], GRUB_FILE_TYPE_FREEDOS);
if (! file)
goto fail;

View file

@ -141,7 +141,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
file = grub_file_open (argv[0]);
file = grub_file_open (argv[0], GRUB_FILE_TYPE_LINUX_KERNEL);
if (! file)
goto fail;

View file

@ -90,7 +90,7 @@ grub_cmd_ntldr (grub_command_t cmd __attribute__ ((unused)),
if (!rel)
goto fail;
file = grub_file_open (argv[0]);
file = grub_file_open (argv[0], GRUB_FILE_TYPE_NTLDR);
if (! file)
goto fail;

View file

@ -413,7 +413,7 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
if (!rel)
goto fail;
fill_ctx.file = grub_file_open (argv[0]);
fill_ctx.file = grub_file_open (argv[0], GRUB_FILE_TYPE_PLAN9_KERNEL);
if (! fill_ctx.file)
goto fail;

View file

@ -99,7 +99,7 @@ grub_cmd_pxechain (grub_command_t cmd __attribute__ ((unused)),
if (!rel)
goto fail;
file = grub_file_open (argv[0]);
file = grub_file_open (argv[0], GRUB_FILE_TYPE_PXECHAINLOADER);
if (! file)
goto fail;

View file

@ -99,7 +99,7 @@ grub_cmd_truecrypt (grub_command_t cmd __attribute__ ((unused)),
grub_dl_ref (my_mod);
file = grub_file_open (argv[0]);
file = grub_file_open (argv[0], GRUB_FILE_TYPE_TRUECRYPT);
if (! file)
goto fail;