]> git.baikalelectronics.ru Git - uboot.git/commit
image: Adjust the workings of fit_check_format()
authorSimon Glass <sjg@chromium.org>
Tue, 16 Feb 2021 00:08:09 +0000 (17:08 -0700)
committerTom Rini <trini@konsulko.com>
Tue, 16 Feb 2021 03:31:52 +0000 (22:31 -0500)
commitb0daf64a0470825c3efb361d9d1873236ef19250
tree2d78afc29b784d5477102dabfc94215781126ae0
parentf81adc4872673fc5c004941b8f4cf2d5146549d8
image: Adjust the workings of fit_check_format()

At present this function does not accept a size for the FIT. This means
that it must be read from the FIT itself, introducing potential security
risk. Update the function to include a size parameter, which can be
invalid, in which case fit_check_format() calculates it.

For now no callers pass the size, but this can be updated later.

Also adjust the return value to an error code so that all the different
types of problems can be distinguished by the user.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Bruce Monroe <bruce.monroe@intel.com>
Reported-by: Arie Haenel <arie.haenel@intel.com>
Reported-by: Julien Lenoir <julien.lenoir@intel.com>
19 files changed:
arch/arm/cpu/armv8/sec_firmware.c
cmd/bootefi.c
cmd/bootm.c
cmd/disk.c
cmd/fpga.c
cmd/nand.c
cmd/source.c
cmd/ximg.c
common/image-fdt.c
common/image-fit.c
common/splash_source.c
common/update.c
drivers/fpga/socfpga_arria10.c
drivers/net/fsl-mc/mc.c
drivers/net/pfe_eth/pfe_firmware.c
include/image.h
tools/fit_common.c
tools/fit_image.c
tools/mkimage.h