Skip to content

Commit 4027943

Browse files
committed
rimage: clarify resign mode and disallow mixed verify
Update command-line handling and help text to make resign usage clearer. Reject mutually exclusive mode combinations (resign with verify) early, so users get deterministic behavior and clearer error reporting. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent fd3e8e4 commit 4027943

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tools/rimage/src/rimage.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void usage(char *name)
3333
fprintf(stdout, "\t -e build extended manifest\n");
3434
fprintf(stdout, "\t -l build loadable modules image (don't treat the first module as a bootloader)\n");
3535
fprintf(stdout, "\t -y verify signed file\n");
36-
fprintf(stdout, "\t -q resign binary\n");
36+
fprintf(stdout, "\t -q resign binary from infile and validate the output signature\n");
3737
fprintf(stdout, "\t -p set PV bit\n");
3838
fprintf(stdout, "\t -d ignore detached sections\n");
3939
fprintf(stdout, "\t -Q, --quiet suppress informational stdout logs\n");
@@ -144,6 +144,11 @@ int main(int argc, char *argv[])
144144
return -EINVAL;
145145
}
146146

147+
if (image.in_file && image.verify_file) {
148+
fprintf(stderr, "error: resign and verify modes are mutually exclusive\n");
149+
return -EINVAL;
150+
}
151+
147152
/* firmware version: major.minor.micro */
148153
if (image.fw_ver_string) {
149154
ret = sscanf(image.fw_ver_string, "%hu.%hu.%hu",

0 commit comments

Comments
 (0)