We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99ed9fa commit d391e70Copy full SHA for d391e70
boot/bootutil/src/bootutil_misc.c
@@ -647,5 +647,18 @@ const struct image_max_size *boot_get_max_app_size(void)
647
*/
648
void boot_state_clear(struct boot_loader_state *state)
649
{
650
+#if defined(MCUBOOT_ENC_IMAGES)
651
+ int image;
652
+ int slot;
653
+
654
+ for (image = 0; image < BOOT_IMAGE_NUMBER; ++image) {
655
+ for (slot = 0; slot < BOOT_NUM_SLOTS; ++slot) {
656
+ /* Not using boot_enc_zeorize here, as it is redundant
657
+ * to the memset below that clears entire boot_loader_state.
658
+ */
659
+ boot_enc_drop(&state->enc[image][slot]);
660
+ }
661
662
+#endif
663
memset(state, 0, sizeof(struct boot_loader_state));
664
}
0 commit comments