#define FIT_UBOOT_COMP "none"
#endif
+/*
+ * SHA256 should be enabled in SPL when signature validation is involved,
+ * CRC32 should only be used for basic checksum validation of FIT images.
+ */
+#if defined(CONFIG_SPL_FIT_SIGNATURE)
+#if defined(CONFIG_SPL_SHA256)
+#define FIT_HASH_ALGO "sha256"
+#elif defined(CONFIG_SPL_CRC32)
+#define FIT_HASH_ALGO "crc32"
+#endif
+#endif
+
#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
#define HAS_FIT
#endif
u-boot-nodtb {
compress = FIT_UBOOT_COMP;
};
-#ifdef CONFIG_SPL_FIT_SIGNATURE
+#ifdef FIT_HASH_ALGO
hash {
- algo = "sha256";
+ algo = FIT_HASH_ALGO;
};
#endif
};
atf-bl31 {
};
-#ifdef CONFIG_SPL_FIT_SIGNATURE
+#ifdef FIT_HASH_ALGO
hash {
- algo = "sha256";
+ algo = FIT_HASH_ALGO;
};
#endif
};
tee-os {
optional;
};
-#ifdef CONFIG_SPL_FIT_SIGNATURE
+#ifdef FIT_HASH_ALGO
hash {
- algo = "sha256";
+ algo = FIT_HASH_ALGO;
};
#endif
};
tee-os {
};
-#ifdef CONFIG_SPL_FIT_SIGNATURE
+#ifdef FIT_HASH_ALGO
hash {
- algo = "sha256";
+ algo = FIT_HASH_ALGO;
};
#endif
};
description = "fdt-NAME";
compression = "none";
type = "flat_dt";
-#ifdef CONFIG_SPL_FIT_SIGNATURE
+#ifdef FIT_HASH_ALGO
hash {
- algo = "sha256";
+ algo = FIT_HASH_ALGO;
};
#endif
};