|
|
@@ -1,92 +0,0 @@
|
|
|
-From patchwork Sat Mar 29 03:13:01 2025
|
|
|
-Content-Type: text/plain; charset="utf-8"
|
|
|
-MIME-Version: 1.0
|
|
|
-Content-Transfer-Encoding: 7bit
|
|
|
-X-Patchwork-Submitter: Daniel Golle <[email protected]>
|
|
|
-X-Patchwork-Id: 2066665
|
|
|
-Return-Path: <[email protected]>
|
|
|
-X-Original-To: [email protected]
|
|
|
-Delivered-To: [email protected]
|
|
|
-Date: Sat, 29 Mar 2025 03:13:01 +0000
|
|
|
-From: Daniel Golle <[email protected]>
|
|
|
-To: Tom Rini <[email protected]>, Simon Glass <[email protected]>,
|
|
|
- Chia-Wei Wang <[email protected]>,
|
|
|
- Daniel Golle <[email protected]>, [email protected]
|
|
|
-Cc: Thomas =?iso-8859-1?q?H=FChn?= <[email protected]>
|
|
|
-Subject: [PATCH 2/2] tools/fit_check_sign: make key optional
|
|
|
-Message-ID:
|
|
|
- <1f0c5a1f7e84f638f921278284ff6245d78e730d.1743217745.git.daniel@makrotopia.org>
|
|
|
-References:
|
|
|
- <bf6a90e864b713db41bf788797554649eeaa0732.1743217745.git.daniel@makrotopia.org>
|
|
|
-MIME-Version: 1.0
|
|
|
-Content-Disposition: inline
|
|
|
-In-Reply-To:
|
|
|
- <bf6a90e864b713db41bf788797554649eeaa0732.1743217745.git.daniel@makrotopia.org>
|
|
|
-X-BeenThere: [email protected]
|
|
|
-X-Mailman-Version: 2.1.39
|
|
|
-Precedence: list
|
|
|
-List-Id: U-Boot discussion <u-boot.lists.denx.de>
|
|
|
-List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
|
|
|
- <mailto:[email protected]?subject=unsubscribe>
|
|
|
-List-Archive: <https://lists.denx.de/pipermail/u-boot/>
|
|
|
-List-Post: <mailto:[email protected]>
|
|
|
-List-Help: <mailto:[email protected]?subject=help>
|
|
|
-List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
|
|
|
- <mailto:[email protected]?subject=subscribe>
|
|
|
-Errors-To: [email protected]
|
|
|
-Sender: "U-Boot" <[email protected]>
|
|
|
-
|
|
|
-Allow invoking fit_check_sig without the key parameter, allowing to
|
|
|
-validate only checksums and hashes for unsigned images.
|
|
|
-
|
|
|
-Signed-off-by: Daniel Golle <[email protected]>
|
|
|
----
|
|
|
- tools/fit_check_sign.c | 15 ++++++---------
|
|
|
- 1 file changed, 6 insertions(+), 9 deletions(-)
|
|
|
-
|
|
|
---- a/tools/fit_check_sign.c
|
|
|
-+++ b/tools/fit_check_sign.c
|
|
|
-@@ -45,7 +45,7 @@ int main(int argc, char **argv)
|
|
|
- char *config_name = NULL;
|
|
|
- char cmdname[256];
|
|
|
- int ret;
|
|
|
-- void *key_blob;
|
|
|
-+ void *key_blob = NULL;
|
|
|
- int c;
|
|
|
-
|
|
|
- strncpy(cmdname, *argv, sizeof(cmdname) - 1);
|
|
|
-@@ -70,18 +70,15 @@ int main(int argc, char **argv)
|
|
|
- fprintf(stderr, "%s: Missing fdt file\n", *argv);
|
|
|
- usage(*argv);
|
|
|
- }
|
|
|
-- if (!keyfile) {
|
|
|
-- fprintf(stderr, "%s: Missing key file\n", *argv);
|
|
|
-- usage(*argv);
|
|
|
-- }
|
|
|
-
|
|
|
- ffd = mmap_fdt(cmdname, fdtfile, 0, &fit_blob, &fsbuf, false, true);
|
|
|
- if (ffd < 0)
|
|
|
- return EXIT_FAILURE;
|
|
|
-- kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true);
|
|
|
-- if (kfd < 0)
|
|
|
-- return EXIT_FAILURE;
|
|
|
--
|
|
|
-+ if (keyfile) {
|
|
|
-+ kfd = mmap_fdt(cmdname, keyfile, 0, &key_blob, &ksbuf, false, true);
|
|
|
-+ if (kfd < 0)
|
|
|
-+ return EXIT_FAILURE;
|
|
|
-+ }
|
|
|
- image_set_host_blob(key_blob);
|
|
|
- ret = fit_check_sign(fit_blob, key_blob, config_name);
|
|
|
- if (!ret) {
|
|
|
-@@ -93,7 +90,9 @@ int main(int argc, char **argv)
|
|
|
- }
|
|
|
-
|
|
|
- (void) munmap((void *)fit_blob, fsbuf.st_size);
|
|
|
-- (void) munmap((void *)key_blob, ksbuf.st_size);
|
|
|
-+
|
|
|
-+ if (keyfile)
|
|
|
-+ (void) munmap((void *)key_blob, ksbuf.st_size);
|
|
|
-
|
|
|
- close(ffd);
|
|
|
- close(kfd);
|