image-fit-sig: bind required image keys and honour required-mode
v3 cover image-fit-sig: bind required image keys and honour required-mode
A key marked required = "image" in the control FDT is never bound to its own verification. fit_image_verify_required_sigs() passes each required key's node offset to fit_image_verify_sig(), which ignores it and calls fit_image_check_sig() with required_keynode set to -1, documented in tree as "any signature will do". Every required key iteration is then satisfied by any signature verifying under any key in the FDT, so two keys marked required = "image" collapse to one.
Patch 1 binds the key. Patch 2 adds required-mode on the image gate so the two gates behave the same way, defaulting to "all". Patch 3 adds the fixture and the regression test.
Changes in v3:
- add required-mode support on the image gate, default "all" (Simon Glass)
- add a regression test plus the prod hinted image fixture (Simon Glass)
- rebase from next onto main, which carries the ecdsa test rework
Changes in v2:
- add a Fixes tag (Yao Zi)
- move coordination context below the line and trim the commit message (Yao Zi)
---
On the anonymity question from the v2 review: pseudonymous rather than anonymous. anon87111 is a stable identity and reachable at this address.
Verification, against main at 32eb8bb43b:
38 passed, 0 failed in the vboot suite. sha256-required-image passes with patch 1 applied.
With patch 1 reverted and patches 2 and 3 kept, it fails on the run_bootm(boots=False) oracle, so the test does catch the defect:
AssertionError: assert 'sandbox: continuing, as we cannot run' not in
sha256-pss-required and sha256-pss-pad-required still pass, so the configuration gate is unchanged by patch 2.
Why patch 3 adds a fixture rather than reusing the existing ones. All nine in tree sign-images-*.its hint "dev", and sign-configs-sha256-rsa2048-pss-prod.its is the only prod hinted file in the tree. mkimage -g cannot redirect a hint the node already carries:tools/image-host.c reads FIT_KEY_HINT from the node at four sites and the -g fallback fires only when the node has no hint. So two keys both marked required = "image" cannot be produced from the existing fixtures by any flag.
Based on main rather than next. next is an ancestor of main and 316 commits behind it, so it is not the development tip.
Separate from "[PATCH 0/2] image-fit-sig: close the image-signature fail-open gate", which is a control FDT with no /signature node at all. Neither fix covers the other. Also separate from "[PATCH v10 0/7] Improve FIT signature handling" [1], which is the configuration gate and is not landed anywhere as of today.
[1] https://lore.kernel.org/u-boot/[email protected]/
anon87111 (3):
image-fit-sig: bind a required image key to its own verification
image-fit-sig: honour required-mode on the image gate
test: vboot: cover required image keys
boot/image-fit-sig.c | 35 ++++++- doc/usage/fit/signature.rst | 13 +-- test/py/tests/test_vboot.py | 98 ++++++++++++++----- .../vboot/sign-images-sha256-rsa2048-prod.its | 42 ++++++++ 4 files changed, 154 insertions(+), 34 deletions(-) create mode 100644 test/py/tests/vboot/sign-images-sha256-rsa2048-prod.its
Signature · 1 line
2.53.0
Hi anon87111,
Quoted 2 lines · On 2026-10-22T18:38:39, anon87111 <[email protected]> wrote:
Patch 1 binds the key. Patch 2 adds required-mode on the image gate so the two gates behave the same way, defaulting to "all".
Patch 1 changes behaviour for any board with more than one key marked required = 'image'. Today those boards boot with a signature from just one of the keys, and after this series they will not. That is the right fix, but please can you say so in the cover letter and in signature.rst, and tell people to use required-mode 'any' if they want to keep the old behaviour. That also gives patch 2 a clear reason to be in the series.
We should consider people migrating existing infrastructure and give specific instructions there.
Quoted 1 line
Patch 3 adds the fixture and the regression test.
Patch 1 has a Fixes tag, so it may be picked up on its own. Its regression test, though, is in the same commit as the required-mode checks, which depend on patch 2. Please can you split it so the 'all' case (two required keys, one signature, refused) goes in with patch 1 or straight after it, and the 'any'/'all' toggling goes with patch 2? Then each fix carries its own test and the series can be bisected cleanly.
Regards,
Simon
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 1/3 image-fit-sig: bind a required image key to its own verification
fit_image_verify_required_sigs() passes each required key's node offset to fit_image_verify_sig() as key_offset. That function never uses it: it calls fit_image_check_sig() with required_keynode hardcoded to -1, which both boot/image-fit-sig.c and include/image.h document as "any signature will do". rsa_verify() then tries the key named by the FIT's own key-name-hint and falls through to "try each of the keys in turn", so every required-key iteration is satisfied by any signature that verifies under any key in the control FDT.
With two or more keys marked required = "image", one signature from any one of them satisfies the whole policy and the others contribute nothing. doc/usage/fit/signature.rst says of "required": "this indicates that the key must be verified for the image / configuration to be considered valid."
The configuration path is correct: fit_config_verify_key() passes key_offset through to fit_config_check_sig().
On sandbox, with key-dev and key-prod both required = "image" and a FIT carrying only a dev signature:
Verifying Hash Integrity ... sha256,rsa2048:dev+ sha256,rsa2048:dev+ OK
sandbox: continuing, as we cannot run Linux
The doubled "dev+" is one signature satisfying both iterations, including the one for key-prod. The same case against the configuration gate refuses:
Verifying Hash Integrity ... sha256,rsa2048:dev+ sha256,rsa2048:dev- error! Failed to verify required signature 'key-prod'
Nothing exercises this path: there is no required = "image" anywhere in the tree, and test_required_key() builds only sign-configs-* fixtures.
--- boot/image-fit-sig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
boot/image-fit-sig.c +2 -1
@@ -159,7 +159,8 @@ static int fit_image_verify_sig(const void *fit, int image_noffset,if (!strncmp (name,FIT_SIG_NODENAME ,strlen (FIT_SIG_NODENAME ))) { ret =fit_image_check_sig (fit, noffset, data, size, - key_blob,-1 , &err_msg); + key_blob, key_offset, + &err_msg);if (ret) {puts ("- " ); }else {
Signature · 1 line
2.53.0
Re: [PATCH v3 1/3] image-fit-sig: bind a required image key to its own verification
Quoted 31 lines · On 2026-10-22T18:38:39, anon87111 <[email protected]> wrote:
image-fit-sig: bind a required image key to its own verification
fit_image_verify_required_sigs()passes each required key's node offset tofit_image_verify_sig()askey_offset. That function never uses it: it callsfit_image_check_sig()withrequired_keynodehardcoded to -1, which bothboot/image-fit-sig.candinclude/image.hdocument as "any signature will do".rsa_verify()then tries the key named by the FIT's own key-name-hint and falls through to "try each of the keys in turn", so every required-key iteration is satisfied by any signature that verifies under any key in the control FDT.With two or more keys marked required = "image", one signature from any one of them satisfies the whole policy and the others contribute nothing.
doc/usage/fit/signature.rstsays of "required": "this indicates that the key must be verified for the image / configuration to be considered valid."The configuration path is correct:
fit_config_verify_key()passeskey_offsetthrough tofit_config_check_sig().On sandbox, with key-dev and key-prod both required = "image" and a FIT carrying only a dev signature:
Verifying Hash Integrity ... sha256,rsa2048:dev+ sha256,rsa2048:dev+ OK
sandbox: continuing, as we cannot run LinuxThe doubled "dev+" is one signature satisfying both iterations, including the one for key-prod. The same case against the configuration gate refuses:
Verifying Hash Integrity ... sha256,rsa2048:dev+ sha256,rsa2048:dev- error! Failed to verify required signature 'key-prod'
Quoted 8 lines
Nothing exercises this path: there is no required = "image" anywhere in the tree, and
test_required_key()builds only sign-configs-* fixtures.Fixes 56518e71041f ("image: Support signing of images")Signed-off-by anon87111 <[email protected]>boot/image-fit-sig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
PATCH v3 2/3 image-fit-sig: honour required-mode on the image gate
In reply to a message not in the archivefit_config_verify_required_keys() reads the required-mode property from the /signature node and accepts either all or any of the required keys. fit_image_verify_required_sigs() has no such policy: every key marked required = "image" must verify.
Mirror the configuration gate so both behave the same way. The default stays "all", so this changes nothing unless required-mode is set to "any".
no_sigsp keeps its meaning. It reports that the image carried no verified signature at all, which is a separate question from the policy outcome, so it is still driven by the success count and not by the number of keys marked required.
Update the documentation, which scoped required-mode to signed configurations.
--- boot/image-fit-sig.c | 32 ++++++++++++++++++++++++++++---- doc/usage/fit/signature.rst | 13 +++++++------ 2 files changed, 35 insertions(+), 10 deletions(-)
boot/image-fit-sig.c +28 -4
@@ -190,6 +190,9 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset, const void *key_blob, int *no_sigsp) { int verify_count = 0; +int reqd_sigs =0 ; +bool reqd_policy_all = true; +const char *reqd_mode;int noffset;int key_node;
@@ -207,6 +210,14 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset,return 0 ; } +/* Get required-mode policy property from DTB */ + reqd_mode =fdt_getprop (key_blob, key_node,"required-mode" ,NULL ); +if (reqd_mode && !strcmp (reqd_mode,"any" )) + reqd_policy_all = false; + +debug ("%s: required-mode policy set to '%s'\n" , __func__, + reqd_policy_all ?"all" :"any" ); +fdt_for_each_subnode (noffset, key_blob, key_node) {const char *required;int ret;
@@ -215,14 +226,27 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset, NULL);if (!required ||strcmp (required,"image" ))continue ; + + reqd_sigs++; + ret =fit_image_verify_sig (fit, image_noffset, data, size, key_blob, noffset);if (ret) { -printf ("Failed to verify required signature '%s'\n" , -fit_get_name (key_blob, noffset,NULL )); -return ret; +if (reqd_policy_all) { +printf ("Failed to verify required signature '%s'\n" , +fit_get_name (key_blob, noffset,NULL )); +return ret; + } + }else { + verify_count++; +if (!reqd_policy_all) +break ; } - verify_count++; + } + +if (reqd_sigs && !verify_count) { +printf ("Failed to verify 'any' of the required signature(s)\n" ); +return -EPERM ; }if (verify_count)
doc/usage/fit/signature.rst +7 -6
@@ -404,14 +404,15 @@ that might be used by the target needs to be signed with 'required' keys. This happens automatically as part of a bootm command when FITs are used. -For Signed Configurations, the default verification behavior can be changed by -the following optional property in /signature node in U-Boot's control FDT. +The default verification behavior can be changed by the following optional +property in the /signature node in U-Boot's control FDT. It applies to both +the configuration gate and the image gate. required-mode - Valid values are "any" to allow verified boot to succeed if - the selected configuration is signed by any of the 'required' keys, and "all" - to allow verified boot to succeed if the selected configuration is signed by - all of the 'required' keys. + Valid values are "any" to allow verified boot to succeed if the selected + configuration or image is signed by any of the 'required' keys, and "all" + to allow verified boot to succeed only if it is signed by all of the + 'required' keys. The default is "all". This property can be added to a binary device tree using fdtput as shown in below examples::
Signature · 1 line
2.53.0
Re: [PATCH v3 2/3] image-fit-sig: honour required-mode on the image gate
Hi,
Quoted 10 lines · On 2026-10-22T18:38:39, anon87111 <[email protected]> wrote:
image-fit-sig: honour required-mode on the image gate
fit_config_verify_required_keys()reads the required-mode property from the /signature node and accepts either all or any of the required keys.fit_image_verify_required_sigs()has no such policy: every key marked required = "image" must verify.Mirror the configuration gate so both behave the same way. The default stays "all", so this changes nothing unless required-mode is set to "any".
Just to check, take a board that already sets required-mode = 'any' for its configuration keys and has more than one key marked required = 'image'. With this patch it will accept an image signed by just one of those image keys, where before every image key had to verify. That is the intent, but it loosens the policy on existing control FDTs without any change to them. Please can you mention it in the commit message (and perhaps in the docs)?
Quoted 17 lines
no_sigspkeeps its meaning. It reports that the image carried no verified signature at all, which is a separate question from the policy outcome, so it is still driven by the success count and not by the number of keys marked required.Update the documentation, which scoped required-mode to signed configurations.
Signed-off-by anon87111 <[email protected]>boot/image-fit-sig.c | 32 ++++++++++++++++++++++++++++---- doc/usage/fit/signature.rst | 13 +++++++------ 2 files changed, 35 insertions(+), 10 deletions(-)
boot/image-fit-sig.c int fit_image_verify_required_sigs(const void *fit, int image_noffset, · line 216
Quoted 7 lines
boot/image-fit-sig.c +7
-0@@ -207,6 +210,14 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset, +/* Get required-mode policy property from DTB */ + reqd_mode =fdt_getprop (key_blob, key_node,"required-mode" ,NULL ); +if (reqd_mode && !strcmp (reqd_mode,"any" )) + reqd_policy_all = false; + +debug ("%s: required-mode policy set to '%s'\n" , __func__, + reqd_policy_all ?"all" :"any" );
This copies code from fit_config_verify_required_keys(), so it should be in a helper. The loop that follows is also nearly the same as the one there, apart from the 'required' string and the verify function it calls. It would be worth sharing that too, e.g. with a helper that takes the 'required' value and a function pointer. Then the two gates cannot drift apart again, which is how this bug came about. What do you think?
Regards,
Simon
PATCH v3 3/3 test: vboot: cover required image keys
In reply to a message not in the archiveAdd a test for two keys marked required = "image" where the FIT carries a signature from only one of them. Without the binding fix the single signature satisfies both required keys and the image boots.
The default policy refuses it, required-mode "any" accepts it, and required-mode "all" refuses it again.
All nine in tree sign-images-*.its hint "dev", and mkimage -g does not redirect a hint the node already carries, so a prod hinted fixture is needed to get two keys marked required on the image gate. sign-images-sha256-rsa2048-prod.its is the in tree sign-images-sha256-rsa2048.its with its two key-name-hint values changed.
--- test/py/tests/test_vboot.py | 98 ++++++++++++++----- .../vboot/sign-images-sha256-rsa2048-prod.its | 42 ++++++++ 2 files changed, 117 insertions(+), 23 deletions(-) create mode 100644 test/py/tests/vboot/sign-images-sha256-rsa2048-prod.its
test/py/tests/test_vboot.py +75 -23
@@ -84,27 +84,28 @@ def make_fit(its, ubman, mkimage, dtc_args, datadir, fit): # Only run the full suite on a few combinations, since it doesn't add any more # test coverage. TESTDATA_IN = [ - ['sha1-basic', 'sha1', '-rsa2048', '', None, False, True, False, False], - ['sha1-pad', 'sha1', '-rsa2048', '', '-E -p 0x10000', False, False, False, False], - ['sha1-pss', 'sha1', '-rsa2048', '-pss', None, False, False, False, False], - ['sha1-pss-pad', 'sha1', '-rsa2048', '-pss', '-E -p 0x10000', False, False, False, False], - ['sha256-basic', 'sha256', '-rsa2048', '', None, False, False, False, False], - ['sha256-pad', 'sha256', '-rsa2048', '', '-E -p 0x10000', False, False, False, False], - ['sha256-pss', 'sha256', '-rsa2048', '-pss', None, False, False, False, False], - ['sha256-pss-pad', 'sha256', '-rsa2048', '-pss', '-E -p 0x10000', False, False, False, False], - ['sha256-pss-required', 'sha256', '-rsa2048', '-pss', None, True, False, False, False], - ['sha256-pss-pad-required', 'sha256', '-rsa2048', '-pss', '-E -p 0x10000', True, True, False, False], - ['sha256-basic-ecdsa256', 'sha256', '-ecdsa256', '', None, False, False, False, False], - ['sha256-basic-ecdsa384', 'sha256', '-ecdsa384', '', None, False, False, False, False], - ['sha256-basic-ecdsa521', 'sha256', '-ecdsa521', '', None, False, False, False, False], - ['sha384-basic', 'sha384', '-rsa3072', '', None, False, False, False, False], - ['sha384-pad', 'sha384', '-rsa3072', '', '-E -p 0x10000', False, False, False, False], - ['algo-arg', 'algo-arg', '', '', '-o sha256,rsa2048', False, False, True, False], - ['sha256-global-sign', 'sha256', '-rsa2048', '', '', False, False, False, True], - ['sha256-global-sign-pss', 'sha256', '-rsa2048', '-pss', '', False, False, False, True], - ['sha256-global-sign-ecdsa256', 'sha256', '-ecdsa256', '', '', False, False, False, True], - ['sha256-global-sign-ecdsa384', 'sha256', '-ecdsa384', '', '', False, False, False, True], - ['sha256-global-sign-ecdsa521', 'sha256', '-ecdsa521', '', '', False, False, False, True], + ['sha1-basic', 'sha1', '-rsa2048', '', None, False, True, False, False, False], + ['sha1-pad', 'sha1', '-rsa2048', '', '-E -p 0x10000', False, False, False, False, False], + ['sha1-pss', 'sha1', '-rsa2048', '-pss', None, False, False, False, False, False], + ['sha1-pss-pad', 'sha1', '-rsa2048', '-pss', '-E -p 0x10000', False, False, False, False, False], + ['sha256-basic', 'sha256', '-rsa2048', '', None, False, False, False, False, False], + ['sha256-pad', 'sha256', '-rsa2048', '', '-E -p 0x10000', False, False, False, False, False], + ['sha256-pss', 'sha256', '-rsa2048', '-pss', None, False, False, False, False, False], + ['sha256-pss-pad', 'sha256', '-rsa2048', '-pss', '-E -p 0x10000', False, False, False, False, False], + ['sha256-pss-required', 'sha256', '-rsa2048', '-pss', None, True, False, False, False, False], + ['sha256-pss-pad-required', 'sha256', '-rsa2048', '-pss', '-E -p 0x10000', True, True, False, False, False], + ['sha256-basic-ecdsa256', 'sha256', '-ecdsa256', '', None, False, False, False, False, False], + ['sha256-basic-ecdsa384', 'sha256', '-ecdsa384', '', None, False, False, False, False, False], + ['sha256-basic-ecdsa521', 'sha256', '-ecdsa521', '', None, False, False, False, False, False], + ['sha384-basic', 'sha384', '-rsa3072', '', None, False, False, False, False, False], + ['sha384-pad', 'sha384', '-rsa3072', '', '-E -p 0x10000', False, False, False, False, False], + ['algo-arg', 'algo-arg', '', '', '-o sha256,rsa2048', False, False, True, False, False], + ['sha256-global-sign', 'sha256', '-rsa2048', '', '', False, False, False, True, False], + ['sha256-global-sign-pss', 'sha256', '-rsa2048', '-pss', '', False, False, False, True, False], + ['sha256-global-sign-ecdsa256', 'sha256', '-ecdsa256', '', '', False, False, False, True, False], + ['sha256-global-sign-ecdsa384', 'sha256', '-ecdsa384', '', '', False, False, False, True, False], + ['sha256-global-sign-ecdsa521', 'sha256', '-ecdsa521', '', '', False, False, False, True, False], + ['sha256-required-image', 'sha256', '-rsa2048', '', None, False, False, False, False, True], ] # Mark all but the first test as slow, so they are not run with '-k not slow'
@@ -117,10 +118,10 @@ TESTDATA += [pytest.param(*v, marks=pytest.mark.slow) for v in TESTDATA_IN[1:]] @pytest.mark.requiredtool('fdtget') @pytest.mark.requiredtool('fdtput') @pytest.mark.requiredtool('openssl') [email protected]("name,sha_algo,sig_algo,padding,sign_options,required,full_test,algo_arg,global_sign", [email protected]("name,sha_algo,sig_algo,padding,sign_options,required,full_test,algo_arg,global_sign,required_image", TESTDATA) def test_vboot(ubman, name, sha_algo, sig_algo, padding, sign_options, required, - full_test, algo_arg, global_sign): + full_test, algo_arg, global_sign, required_image): """Test verified boot signing with mkimage and verification with 'bootm'. This works using sandbox only as it needs to update the device tree used
@@ -477,6 +478,55 @@ def test_vboot(ubman, name, sha_algo, sig_algo, padding, sign_options, required, 'Bad Data Hash', False) ubman.log.action('%s: Check in-bounds hashed-strings size' % sha_algo) + def test_required_image_key(sha_algo, sig_algo, padding, sign_options): + """Test that a required image key must verify its own signature. + + Two keys are marked required = "image" and the FIT carries a signature + from only one of them. Under the default policy the image must be + refused. Under required-mode "any" it must boot. + + Args: + sha_algo: Either 'sha1' or 'sha256', to select the algorithm to use + sig_algo: Signature algorithm to use, e.g. '-rsa2048'. + padding: Either '' or '-pss', to select the padding to use for the + rsa signature algorithm. + sign_options: Options to mkimage when signing a fit image. + """ + # Compile our device tree files for kernel and U-Boot. These are + # regenerated here since mkimage will modify them (by adding a + # public key) below. + dtc('sandbox-kernel.dts', ubman, dtc_args, datadir, tmpdir, dtb) + dtc('sandbox-u-boot.dts', ubman, dtc_args, datadir, tmpdir, dtb) + + ubman.log.action('%s: Test FIT with required images' % sha_algo) + + # Sign the images with the prod key and mark it required. This puts the + # prod public key into sandbox-u-boot.dtb marked required = "image". + make_fit('sign-images-%s%s%s-prod.its' % (sha_algo, sig_algo, padding), + ubman, mkimage, dtc_args, datadir, fit) + sign_fit(sha_algo, sign_options) + + # Sign the images with the dev key and mark it required too. This adds + # the dev key to the control dtb and overwrites the FIT, which now + # carries a dev signature only. + make_fit('sign-images-%s%s%s.its' % (sha_algo, sig_algo, padding), + ubman, mkimage, dtc_args, datadir, fit) + sign_fit(sha_algo, sign_options) + + # Both keys are now marked required = "image" and the FIT has no prod + # signature. The default policy is "all", so this must be refused. + run_bootm(sha_algo, 'required image key', '', False) + + # With required-mode "any" the dev signature alone is enough. + utils.run_and_log(ubman, 'fdtput -t s %s /signature required-mode any' % + dtb) + run_bootm(sha_algo, 'required image key any', 'dev+', True) + + # Back to "all" and the missing prod signature must fail again. + utils.run_and_log(ubman, 'fdtput -t s %s /signature required-mode all' % + dtb) + run_bootm(sha_algo, 'required image key all', '', False) + def test_required_key(sha_algo, sig_algo, padding, sign_options): """Test verified boot with the given hash algorithm.
@@ -619,6 +669,8 @@ def test_vboot(ubman, name, sha_algo, sig_algo, padding, sign_options, required, ubman.config.dtb = dtb if global_sign: test_global_sign(sha_algo, sig_algo, padding, sign_options) + elif required_image: + test_required_image_key(sha_algo, sig_algo, padding, sign_options) elif required: test_required_key(sha_algo, sig_algo, padding, sign_options) else:
test/py/tests/vboot/sign-images-sha256-rsa2048-prod.its new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PATCH v3 3/3] test: vboot: cover required image keys
Hi,
Quoted 23 lines · On 2026-10-22T18:38:39, anon87111 <[email protected]> wrote:
test: vboot: cover required image keys
Add a test for two keys marked required = "image" where the FIT carries a signature from only one of them. Without the binding fix the single signature satisfies both required keys and the image boots.
The default policy refuses it, required-mode "any" accepts it, and required-mode "all" refuses it again.
All nine in tree sign-images-*.its hint "dev", and mkimage -g does not redirect a hint the node already carries, so a prod hinted fixture is needed to get two keys marked required on the image gate. sign-images-sha256-rsa2048-prod.its is the in tree sign-images-sha256-rsa2048.its with its two key-name-hint values changed.
Signed-off-by anon87111 <[email protected]>test/py/tests/test_vboot.py | 98 +++++++++++++++++----- .../vboot/sign-images-sha256-rsa2048-prod.its | 42 ++++++++++ 2 files changed, 117 insertions(+), 23 deletions(-)
test/py/tests/test_vboot.py def test_vboot(ubman, name, sha_algo, sig_algo, padding, sign_options, required, · line 480
Quoted 3 lines
test/py/tests/test_vboot.py +3
-0@@ -477,6 +478,55 @@ def test_vboot(ubman, name, sha_algo, sig_algo, padding, sign_options, required, + # Both keys are now marked required = "image" and the FIT has no prod + # signature. The default policy is "all", so this must be refused. + run_bootm(sha_algo, 'required image key', '', False)
With an empty expect_string this only checks that the image does not boot, so it would also pass if bootm failed for some unrelated reason. Since this is the regression test for patch 1, please can you check for the message showing that the prod key failed, e.g. "Failed to verify required signature 'key-prod'"? Please do the same in the final 'all' case.
test/py/tests/vboot/sign-images-sha256-rsa2048-prod.its line 4
Quoted 6 lines
test/py/tests/vboot/sign-images-sha256-rsa2048-prod.its +4
-0@@ -0,0 +1,42 @@ + signature { + algo = "sha256,rsa2048"; + key-name-hint = "prod"; + };
This is a copy of sign-images-sha256-rsa2048.its with only the two hints changed. Instead, you could build the FIT from the existing .its and run 'fdtput -t s <fit> /images/kernel/signature key-name-hint prod' (and the same for fdt-1) before sign_fit(), since mkimage -F re-signs an existing FIT. The test already uses fdtput on the FIT elsewhere, and this avoids the duplicate fixture. What do you think?
Regards,
Simon