BL2: Support 9 boot keys
To support platforms which would require to load up to 9 images,
add boot util keys for MCUBOOT_IMAGE_NUMBER up to 9.
Signed-off-by: Arnold Gabriel Benedict <arnoldgabriel.benedict@arm.com>
Change-Id: Icf18b12be3a9834d77dd4c4a50c58bb787da214f
diff --git a/bl2/ext/mcuboot/keys.c b/bl2/ext/mcuboot/keys.c
index 1964ae8..6325b1e 100644
--- a/bl2/ext/mcuboot/keys.c
+++ b/bl2/ext/mcuboot/keys.c
@@ -21,7 +21,7 @@
* Original code taken from mcuboot project at:
* https://github.com/mcu-tools/mcuboot
* Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a
- * Modifications are Copyright (c) 2019-2022 Arm Limited.
+ * Modifications are Copyright (c) 2019-2023 Arm Limited.
*/
#include <stddef.h>
@@ -361,6 +361,44 @@
.len = &rsa_pub_key_len,
},
#endif /* MCUBOOT_IMAGE_NUMBER > 3 */
+#if (MCUBOOT_IMAGE_NUMBER > 4)
+ {
+ /* FIXME assuming the image 0 key is reused here */
+ .key = rsa_pub_key,
+ .len = &rsa_pub_key_len,
+ },
+#endif /* MCUBOOT_IMAGE_NUMBER > 4 */
+#if (MCUBOOT_IMAGE_NUMBER > 5)
+ {
+ /* FIXME assuming the image 0 key is reused here */
+ .key = rsa_pub_key,
+ .len = &rsa_pub_key_len,
+ },
+#endif /* MCUBOOT_IMAGE_NUMBER > 5 */
+#if (MCUBOOT_IMAGE_NUMBER > 6)
+ {
+ /* FIXME assuming the image 0 key is reused here */
+ .key = rsa_pub_key,
+ .len = &rsa_pub_key_len,
+ },
+#endif /* MCUBOOT_IMAGE_NUMBER > 6 */
+#if (MCUBOOT_IMAGE_NUMBER > 7)
+ {
+ /* FIXME assuming the image 0 key is reused here */
+ .key = rsa_pub_key,
+ .len = &rsa_pub_key_len,
+ },
+#endif /* MCUBOOT_IMAGE_NUMBER > 7 */
+#if (MCUBOOT_IMAGE_NUMBER > 8)
+ {
+ /* FIXME assuming the image 0 key is reused here */
+ .key = rsa_pub_key,
+ .len = &rsa_pub_key_len,
+ },
+#endif /* MCUBOOT_IMAGE_NUMBER > 8 */
+#if (MCUBOOT_IMAGE_NUMBER > 9)
+#error "MCUBOOT_IMAGE_NUMBER Unsupported!"
+#endif /* MCUBOOT_IMAGE_NUMBER > 9 */
};
const int bootutil_key_cnt = MCUBOOT_IMAGE_NUMBER;
#endif /* HAVE_KEYS */