spl: spl_fit.c: enable check of signature for config node in spl/tpl
PATCH 1/1 spl: spl_fit.c: enable check of signature for config node in spl/tpl
This commit add the support of signature check for config node in spl/tpl when the function spl_load_simple_fit is used.
Signed-off-by Philippe Reynes <[email protected]>
--- common/spl/spl_fit.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
common/spl/spl_fit.c +10 -0
@@ -551,6 +551,16 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,if (spl_load_simple_fit_skip_processing ())return 0 ; +if (IS_ENABLED (CONFIG_SPL_FIT_SIGNATURE )) { +int conf_offset =fit_find_config_node (fit); + +printf ("## Checking hash(es) for config %s ... " , +fit_get_name (fit, conf_offset,NULL )); +if (fit_config_verify (fit, conf_offset)) +return -EPERM ; +puts ("OK\n" ); + } +/* find the node holding the images information */ images =fdt_path_offset (fit,FIT_IMAGES_PATH );if (images <0 ) {
Signature · 1 line
2.17.1
PATCH 1/1 spl: spl_fit.c: enable check of signature for config node in spl/tpl
Quoted 8 lines · Philippe Reynes
This commit add the support of signature check for config node in spl/tpl when the function
spl_load_simple_fitis used.Signed-off-by Philippe Reynes <[email protected]>--- common/spl/spl_fit.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Reviewed-by Simon Glass <[email protected]>
We have sandbox SPL tests available now so it should be possible to write a test of FIT loading in SPL.
Quoted 25 lines
common/spl/spl_fit.c +10
-1@@ -551,6 +551,16 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,if (spl_load_simple_fit_skip_processing ())return 0 ; +if (IS_ENABLED (CONFIG_SPL_FIT_SIGNATURE )) { +int conf_offset =fit_find_config_node (fit); + +printf ("## Checking hash(es) for config %s ... " , +fit_get_name (fit, conf_offset,NULL )); +if (fit_config_verify (fit, conf_offset)) +return -EPERM ; +puts ("OK\n" ); + } +/* find the node holding the images information */ images =fdt_path_offset (fit,FIT_IMAGES_PATH );if (images <0 ) { --2.17.1
PATCH 1/1 spl: spl_fit.c: enable check of signature for config node in spl/tpl
In reply to Philippe ReynesQuoted 5 lines · Philippe Reynes
This commit add the support of signature check for config node in spl/tpl when the function
spl_load_simple_fitis used.Signed-off-by Philippe Reynes <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/next, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201202/991f95a5/attachment.sig>