boot: Make boot_enc_valid take slot instead of image index
There is no point for boot_enc_valid to take image index and
flash area and use these to figure out slot number.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
diff --git a/boot/bootutil/src/encrypted.c b/boot/bootutil/src/encrypted.c
index f6f40f9..d094ea7 100644
--- a/boot/bootutil/src/encrypted.c
+++ b/boot/bootutil/src/encrypted.c
@@ -682,19 +682,9 @@
}
bool
-boot_enc_valid(struct enc_key_data *enc_state, int image_index,
- const struct flash_area *fap)
+boot_enc_valid(struct enc_key_data *enc_state, int slot)
{
- int rc;
-
- rc = flash_area_id_to_multi_image_slot(image_index, flash_area_get_id(fap));
- if (rc < 0) {
- /* can't get proper slot number - skip encryption, */
- /* postpone the error for a upper layer */
- return false;
- }
-
- return enc_state[rc].valid;
+ return enc_state[slot].valid;
}
void