diff --git a/tools/fit_check_sign.c b/tools/fit_check_sign.c index 3d1d33fdab..a5827af976 100644 --- a/tools/fit_check_sign.c +++ b/tools/fit_check_sign.c @@ -37,6 +37,7 @@ int main(int argc, char **argv) { int ffd = -1; int kfd = -1; + int offset, next_offset; struct stat fsbuf; struct stat ksbuf; void *fit_blob; @@ -83,7 +84,23 @@ int main(int argc, char **argv) return EXIT_FAILURE; image_set_host_blob(key_blob); - ret = fit_check_sign(fit_blob, key_blob, config_name); + if (config_name) { + ret = fit_check_sign(fit_blob, key_blob, config_name); + } else { + offset = fdt_path_offset(fit_blob, FIT_CONFS_PATH); + if (offset < 0) { + return EXIT_FAILURE; + } + for (next_offset = fdt_first_subnode(fit_blob, offset); + next_offset >= 0; + next_offset = fdt_next_subnode(fit_blob, next_offset)) { + config_name = (char *)fdt_get_name(fit_blob, next_offset, NULL); + ret = fit_check_sign(fit_blob, key_blob, config_name); + if (ret) { + break; + } + } + } if (!ret) { ret = EXIT_SUCCESS; fprintf(stderr, "Signature check OK\n");