]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
image: Rename fit_image_check_hashes() to fit_image_verify()
authorSimon Glass <sjg@chromium.org>
Tue, 7 May 2013 06:11:57 +0000 (06:11 +0000)
committerTom Rini <trini@ti.com>
Tue, 14 May 2013 19:37:25 +0000 (15:37 -0400)
This is the main entry point to the FIT image verification code. We will
be using it to handle image verification with signatures, so rename the
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
common/cmd_bootm.c
common/cmd_fpga.c
common/cmd_source.c
common/cmd_ximg.c
common/image-fit.c
common/image.c
common/update.c
include/image.h

index 7438469d091721a6dcba15ec2263ef7b086dc743..aa717bf49accb67faacb0973e18ccdfe04b3a482 100644 (file)
@@ -815,7 +815,7 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify)
 
        if (verify) {
                puts("   Verifying Hash Integrity ... ");
-               if (!fit_image_check_hashes(fit, os_noffset)) {
+               if (!fit_image_verify(fit, os_noffset)) {
                        puts("Bad Data Hash\n");
                        bootstage_error(BOOTSTAGE_ID_FIT_CHECK_HASH);
                        return 0;
@@ -1169,7 +1169,7 @@ static int image_info(ulong addr)
 
                fit_print_contents(hdr);
 
-               if (!fit_all_image_check_hashes(hdr)) {
+               if (!fit_all_image_verify(hdr)) {
                        puts("Bad hash in FIT image!\n");
                        return 1;
                }
index 1834246f3081dda474271f7ea98d5291f73d8b3b..1341604c5c2a70f226d3dde63db85c5476b354b9 100644 (file)
@@ -306,7 +306,7 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
                                }
 
                                /* verify integrity */
-                               if (!fit_image_check_hashes (fit_hdr, noffset)) {
+                               if (!fit_image_verify(fit_hdr, noffset)) {
                                        puts ("Bad Data Hash\n");
                                        return 1;
                                }
index f0d7f52bcec0643f5e7ce89fe23b9dba6df96605..a4406143244beabca205c490ba370793980331f6 100644 (file)
@@ -127,7 +127,7 @@ source (ulong addr, const char *fit_uname)
 
                /* verify integrity */
                if (verify) {
-                       if (!fit_image_check_hashes (fit_hdr, noffset)) {
+                       if (!fit_image_verify(fit_hdr, noffset)) {
                                puts ("Bad Data Hash\n");
                                return 1;
                        }
index 02084b0204008b57f0ba2b96664a1a281f159c41..270e8030992c3c4d2d4283b8957f07d82e34d252 100644 (file)
@@ -162,7 +162,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
                /* verify integrity */
                if (verify) {
-                       if (!fit_image_check_hashes(fit_hdr, noffset)) {
+                       if (!fit_image_verify(fit_hdr, noffset)) {
                                puts("Bad Data Hash\n");
                                return 1;
                        }
index 3e72da0a724c9ca65afe68762ea55f9202dad790..9360af2f8a281f637e16845b7f7d5bd3675cf778 100644 (file)
@@ -850,11 +850,11 @@ int calculate_hash(const void *data, int data_len, const char *algo,
 }
 
 /**
- * fit_image_check_hashes - verify data intergity
+ * fit_image_verify - verify data intergity
  * @fit: pointer to the FIT format image header
  * @image_noffset: component image node offset
  *
- * fit_image_check_hashes() goes over component image hash nodes,
+ * fit_image_verify() goes over component image hash nodes,
  * re-calculates each data hash and compares with the value stored in hash
  * node.
  *
@@ -862,7 +862,7 @@ int calculate_hash(const void *data, int data_len, const char *algo,
  *     1, if all hashes are valid
  *     0, otherwise (or on error)
  */
-int fit_image_check_hashes(const void *fit, int image_noffset)
+int fit_image_verify(const void *fit, int image_noffset)
 {
        const void      *data;
        size_t          size;
@@ -955,17 +955,17 @@ error:
 }
 
 /**
- * fit_all_image_check_hashes - verify data intergity for all images
+ * fit_all_image_verify - verify data intergity for all images
  * @fit: pointer to the FIT format image header
  *
- * fit_all_image_check_hashes() goes over all images in the FIT and
+ * fit_all_image_verify() goes over all images in the FIT and
  * for every images checks if all it's hashes are valid.
  *
  * returns:
  *     1, if all hashes of all images are valid
  *     0, otherwise (or on error)
  */
-int fit_all_image_check_hashes(const void *fit)
+int fit_all_image_verify(const void *fit)
 {
        int images_noffset;
        int noffset;
@@ -995,7 +995,7 @@ int fit_all_image_check_hashes(const void *fit)
                        printf("   Hash(es) for Image %u (%s): ", count++,
                               fit_get_name(fit, noffset, NULL));
 
-                       if (!fit_image_check_hashes(fit, noffset))
+                       if (!fit_image_verify(fit, noffset))
                                return 0;
                        printf("\n");
                }
@@ -1443,7 +1443,7 @@ int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,
 
        if (verify) {
                puts("   Verifying Hash Integrity ... ");
-               if (!fit_image_check_hashes(fit, rd_noffset)) {
+               if (!fit_image_verify(fit, rd_noffset)) {
                        puts("Bad Data Hash\n");
                        bootstage_error(BOOTSTAGE_ID_FIT_RD_HASH);
                        return 0;
index 3aefd2af160b1ff9d8d64628af8f00af153175a7..7412a0ef48938dc2d32d7c95447395bdbe50341e 100644 (file)
@@ -1210,7 +1210,7 @@ static int fit_check_fdt(const void *fit, int fdt_noffset, int verify)
 
        if (verify) {
                puts("   Verifying Hash Integrity ... ");
-               if (!fit_image_check_hashes(fit, fdt_noffset)) {
+               if (!fit_image_verify(fit, fdt_noffset)) {
                        fdt_error("Bad Data Hash");
                        return 0;
                }
index 94d6a82aeb1b19478c07706419334815ac15d8e5..87941ec8a881e0b254ec7ae528685f3b1918f42c 100644 (file)
@@ -297,7 +297,7 @@ got_update_file:
                printf("Processing update '%s' :",
                        fit_get_name(fit, noffset, NULL));
 
-               if (!fit_image_check_hashes(fit, noffset)) {
+               if (!fit_image_verify(fit, noffset)) {
                        printf("Error: invalid update hash, aborting\n");
                        ret = 1;
                        goto next_node;
index dc8f8b10c4900f3593ac08e77b4bdd981907dd53..59e8064f975b7587cc8e72d4036bbe7d8517b018 100644 (file)
@@ -615,8 +615,8 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
 int fit_set_hashes(void *fit);
 int fit_image_set_hashes(void *fit, int image_noffset);
 
-int fit_image_check_hashes(const void *fit, int noffset);
-int fit_all_image_check_hashes(const void *fit);
+int fit_image_verify(const void *fit, int noffset);
+int fit_all_image_verify(const void *fit);
 int fit_image_check_os(const void *fit, int noffset, uint8_t os);
 int fit_image_check_arch(const void *fit, int noffset, uint8_t arch);
 int fit_image_check_type(const void *fit, int noffset, uint8_t type);