encryption: changed boot_enc_valid() return value to bool
boot_enc_valid() is supposed to return boolena so
changed it return type in order to reflect this.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/bootutil/include/bootutil/enc_key.h b/boot/bootutil/include/bootutil/enc_key.h
index d2477ca..0f4ab57 100644
--- a/boot/bootutil/include/bootutil/enc_key.h
+++ b/boot/bootutil/include/bootutil/enc_key.h
@@ -20,6 +20,7 @@
#ifndef BOOTUTIL_ENC_KEY_H
#define BOOTUTIL_ENC_KEY_H
+#include <stdbool.h>
#include <flash_map_backend/flash_map_backend.h>
#include "mcuboot_config/mcuboot_config.h"
#include "bootutil/image.h"
@@ -51,7 +52,7 @@
int boot_enc_set_key(uint8_t slot, uint8_t *enckey);
int boot_enc_load(const struct image_header *hdr, const struct flash_area *fap,
uint8_t *enckey);
-int boot_enc_valid(const struct flash_area *fap);
+bool boot_enc_valid(const struct flash_area *fap);
void boot_encrypt(const struct flash_area *fap, uint32_t off, uint32_t sz,
uint32_t blk_off, uint8_t *buf);
void boot_enc_zeroize(void);
diff --git a/boot/bootutil/src/encrypted.c b/boot/bootutil/src/encrypted.c
index 13ba2f4..6ac10d6 100644
--- a/boot/bootutil/src/encrypted.c
+++ b/boot/bootutil/src/encrypted.c
@@ -306,7 +306,7 @@
return rc;
}
-int
+bool
boot_enc_valid(const struct flash_area *fap)
{
int rc;
@@ -315,7 +315,7 @@
if (rc < 0) {
/* can't get proper slot number - skip encryption, */
/* postpone the erro for a upper layer */
- return 0;
+ return false;
}
return enc_state[rc].valid;