tests: FIT: Add "clone" image attack image test
PATCH 1/1 tests: FIT: Add "clone" image attack image test
Related to the problem resolved with commit 2092322b31cc ("boot: Add fit_config_get_hash_list() to build signed node list"), add a testcase for the problem as well.
Reported-by Apple Security Engineering and Architecture (SEAR)
Signed-off-by Tom Rini <[email protected]>
---
Apple has confirmed that we can include the test case now, rather than waiting.
--- test/py/tests/test_vboot.py | 10 ++++++ test/py/tests/vboot_evil.py | 65 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+)
test/py/tests/test_vboot.py +10 -0
@@ -372,6 +372,16 @@ def test_vboot(ubman, name, sha_algo, padding, sign_options, required, msg = 'Signature checking prevents use of unit addresses (@) in nodes' run_bootm(sha_algo, 'evil kernel@', msg, False, efit) + # Try doing a clone of the images + efit = '%stest.evilclone.fit' % tmpdir + shutil.copyfile(fit, efit) + vboot_evil.add_evil_node(fit, efit, evil_kernel, 'clone') + + utils.run_and_log_expect_exception( + ubman, [fit_check_sign, '-f', efit, '-k', dtb], + 1, 'Failed to verify required signature') + run_bootm(sha_algo, 'evil clone', 'Bad Data Hash', False, efit) + # Create a new properly signed fit and replace header bytes make_fit('sign-configs-%s%s.its' % (sha_algo, padding), ubman, mkimage, dtc_args, datadir, fit) sign_fit(sha_algo, sign_options)
test/py/tests/vboot_evil.py +65 -0
89 lines not on this page · raw message
Signature · 1 line
2.43.0
Quoted 5 lines · Tom Rini
Related to the problem resolved with commit
2092322b31cc("boot: Addfit_config_get_hash_list()to build signed node list"), add a testcase for the problem as well.
Applied to u-boot/master, thanks!
[1/1] tests: FIT: Add "clone" image attack image test
commit: a22e9e1b8ec7c96664072d7e629e811c318fb92a
Signature · 1 line
Tom