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:
parent
e1bc2b23f1
commit
aebe31c375
70 changed files with 292 additions and 221 deletions
|
@ -1457,7 +1457,7 @@ grub_bsd_load (int argc, char *argv[])
|
|||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_BSD_KERNEL);
|
||||
if (!file)
|
||||
goto fail;
|
||||
|
||||
|
@ -1534,7 +1534,7 @@ grub_cmd_freebsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_BSD_KERNEL);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
@ -1693,7 +1693,7 @@ grub_cmd_netbsd (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
{
|
||||
grub_file_t file;
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_BSD_KERNEL);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
@ -1802,7 +1802,7 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_FREEBSD_ENV);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -1907,7 +1907,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
|||
return 0;
|
||||
}
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_FREEBSD_MODULE);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -1958,7 +1958,7 @@ grub_netbsd_module_load (char *filename, grub_uint32_t type)
|
|||
void *src;
|
||||
grub_err_t err;
|
||||
|
||||
file = grub_file_open (filename);
|
||||
file = grub_file_open (filename, GRUB_FILE_TYPE_NETBSD_MODULE);
|
||||
if ((!file) || (!file->size))
|
||||
goto fail;
|
||||
|
||||
|
@ -2048,7 +2048,7 @@ grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)),
|
|||
return 0;
|
||||
}
|
||||
|
||||
file = grub_file_open (argv[0]);
|
||||
file = grub_file_open (argv[0], GRUB_FILE_TYPE_FREEBSD_MODULE_ELF);
|
||||
if (!file)
|
||||
return grub_errno;
|
||||
if (!file->size)
|
||||
|
@ -2088,7 +2088,7 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (!openbsd_ramdisk.max_size)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "your kOpenBSD doesn't support ramdisk");
|
||||
|
||||
file = grub_file_open (args[0]);
|
||||
file = grub_file_open (args[0], GRUB_FILE_TYPE_OPENBSD_RAMDISK);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue