]> git.sur5r.net Git - u-boot/blobdiff - common/image-sig.c
spi: zynqmp_gqspi: Add support for ZynqMP qspi driver
[u-boot] / common / image-sig.c
index f65d883994be42e81b12e4f8c2921f90346e943f..5a269d3289bfcf72d7ad0fd5aeff7862f4badf11 100644 (file)
@@ -156,6 +156,11 @@ static int fit_image_setup_verify(struct image_sign_info *info,
 {
        char *algo_name;
 
+       if (fdt_totalsize(fit) > CONFIG_FIT_SIGNATURE_MAX_SIZE) {
+               *err_msgp = "Total size too large";
+               return 1;
+       }
+
        if (fit_image_hash_get_algo(fit, noffset, &algo_name)) {
                *err_msgp = "Can't get hash algo property";
                return -1;
@@ -372,8 +377,11 @@ int fit_config_check_sig(const void *fit, int noffset, int required_keynode,
        /* Add the strings */
        strings = fdt_getprop(fit, noffset, "hashed-strings", NULL);
        if (strings) {
-               fdt_regions[count].offset = fdt_off_dt_strings(fit) +
-                               fdt32_to_cpu(strings[0]);
+               /*
+                * The strings region offset must be a static 0x0.
+                * This is set in tool/image-host.c
+                */
+               fdt_regions[count].offset = fdt_off_dt_strings(fit);
                fdt_regions[count].size = fdt32_to_cpu(strings[1]);
                count++;
        }