summaryrefslogtreecommitdiff
path: root/tools/fit_check_sign.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-03-18 11:44:03 -0600
committerSimon Glass <sjg@chromium.org>2020-04-01 07:45:09 -0600
commitc3aa81e35cc53fcd825e89510cd648288e0b6b92 (patch)
tree8181f82b6c7a2cb3a35809f1bb7d1caa1da3c649 /tools/fit_check_sign.c
parent8a9d03732e6d0f68107c80919096e7cf956dcb3d (diff)
downloadu-boot-c3aa81e35cc53fcd825e89510cd648288e0b6b92.tar.gz
u-boot-c3aa81e35cc53fcd825e89510cd648288e0b6b92.tar.bz2
u-boot-c3aa81e35cc53fcd825e89510cd648288e0b6b92.zip
fit_check_sign: Allow selecting the configuration to verify
This tool always verifies the default configuration. It is useful to be able to verify a specific one. Add a command-line flag for this and plumb the logic through. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/fit_check_sign.c')
-rw-r--r--tools/fit_check_sign.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/fit_check_sign.c b/tools/fit_check_sign.c
index 4528743792..9375d5cf72 100644
--- a/tools/fit_check_sign.c
+++ b/tools/fit_check_sign.c
@@ -41,6 +41,7 @@ int main(int argc, char **argv)
void *fit_blob;
char *fdtfile = NULL;
char *keyfile = NULL;
+ char *config_name = NULL;
char cmdname[256];
int ret;
void *key_blob;
@@ -48,7 +49,7 @@ int main(int argc, char **argv)
strncpy(cmdname, *argv, sizeof(cmdname) - 1);
cmdname[sizeof(cmdname) - 1] = '\0';
- while ((c = getopt(argc, argv, "f:k:")) != -1)
+ while ((c = getopt(argc, argv, "f:k:c:")) != -1)
switch (c) {
case 'f':
fdtfile = optarg;
@@ -56,6 +57,9 @@ int main(int argc, char **argv)
case 'k':
keyfile = optarg;
break;
+ case 'c':
+ config_name = optarg;
+ break;
default:
usage(cmdname);
break;
@@ -78,7 +82,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
image_set_host_blob(key_blob);
- ret = fit_check_sign(fit_blob, key_blob);
+ ret = fit_check_sign(fit_blob, key_blob, config_name);
if (!ret) {
ret = EXIT_SUCCESS;
fprintf(stderr, "Signature check OK\n");