Skip to content

Commit 6d469e0

Browse files
committed
rimage: propagate verification result to the exit code
Verify mode logged signature failures and a missing header but returned success, so callers using the exit code as a gate would accept a tampered image. Return an error when no header is found and propagate the verification result. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 3a4c1cf commit 6d469e0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/rimage/src/manifest.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,9 +1688,13 @@ int verify_image(struct image *image)
16881688
/* no header found */
16891689
fprintf(stderr, "error: could not find valid CSE header $CPD in %s\n",
16901690
image->verify_file);
1691+
ret = -EINVAL;
16911692
out:
16921693
fclose(in_file);
1693-
return 0;
1694+
/* propagate verification result so callers (and the exit code) can
1695+
* detect a failed/missing verification instead of always seeing success
1696+
*/
1697+
return ret;
16941698
}
16951699

16961700

0 commit comments

Comments
 (0)