aboutsummaryrefslogtreecommitdiff
path: root/bl2
diff options
context:
space:
mode:
authorDavid Vincze <david.vincze@arm.com>2020-06-05 09:18:35 +0200
committerDavid Vincze <david.vincze@linaro.org>2020-06-08 11:21:33 +0200
commit9d96328126f3e27998402fd02dac794edf722358 (patch)
tree92685ce9e00fb1ac7d7f790fcb94a0aedc19dc93 /bl2
parentdf12de06919afe48ab353469dfeccc63c11799fc (diff)
downloadtrusted-firmware-m-9d96328126f3e27998402fd02dac794edf722358.tar.gz
Boot: Replace hard-coded image index
Fix1: replace hard-coded value with the image index variable. It remained from when only 1 image was supported by the rollback protection mechanism. Fix2: typo in NV counter identifier. Change-Id: Iaa275d02ad34ca6e95a01a0d3f85fd190d44bc3d Signed-off-by: David Vincze <david.vincze@linaro.org>
Diffstat (limited to 'bl2')
-rw-r--r--bl2/ext/mcuboot/bootutil/src/image_validate.c2
-rw-r--r--bl2/src/security_cnt.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/bl2/ext/mcuboot/bootutil/src/image_validate.c b/bl2/ext/mcuboot/bootutil/src/image_validate.c
index 938996b09a..efcf12322e 100644
--- a/bl2/ext/mcuboot/bootutil/src/image_validate.c
+++ b/bl2/ext/mcuboot/bootutil/src/image_validate.c
@@ -381,7 +381,7 @@ bootutil_img_validate(int image_index,
return rc;
}
- rc = boot_nv_security_counter_get(0, &security_cnt);
+ rc = boot_nv_security_counter_get(image_index, &security_cnt);
if (rc) {
return rc;
}
diff --git a/bl2/src/security_cnt.c b/bl2/src/security_cnt.c
index 825a2d67d0..88366bae4f 100644
--- a/bl2/src/security_cnt.c
+++ b/bl2/src/security_cnt.c
@@ -11,7 +11,7 @@
#include <stdint.h>
#define TFM_BOOT_NV_COUNTER_0 PLAT_NV_COUNTER_3 /* NV counter of Image 0 */
-#define TFM_BOOT_NV_COUNTER_1 PLAT_NV_COUNTER 4 /* NV counter of Image 1 */
+#define TFM_BOOT_NV_COUNTER_1 PLAT_NV_COUNTER_4 /* NV counter of Image 1 */
#define TFM_BOOT_NV_COUNTER_MAX PLAT_NV_COUNTER_MAX
static enum tfm_nv_counter_t get_nv_counter_from_image_id(uint32_t image_id)