1010 */
1111
1212#include <stdint.h>
13- #include <nrf_ironside/counter .h>
13+ #include <ironside/se/api .h>
1414#include "bootutil/fault_injection_hardening.h"
1515#include "bootutil/bootutil_public.h"
1616
@@ -30,15 +30,15 @@ fih_int boot_nv_security_counter_get(uint32_t image_id, fih_int *security_cnt)
3030 FIH_RET (FIH_FAILURE );
3131 }
3232
33- if (image_id > IRONSIDE_COUNTER_NUM ) {
33+ if (image_id > IRONSIDE_SE_COUNTER_NUM ) {
3434 FIH_RET (FIH_FAILURE );
3535 }
3636
3737 /* Since the IronSide service is not protected against fault injection,
3838 * read the counter multiple times and compare the results.
3939 */
4040 for (i = 0 ; i < IRONSIDE_COUNTER_READ_RETRIES ; i ++ ) {
41- if (ironside_counter_get (image_id , & cur_sec_cnt [i ]) != 0 ) {
41+ if (ironside_se_counter_get (image_id , & cur_sec_cnt [i ]) != 0 ) {
4242 FIH_RET (FIH_FAILURE );
4343 }
4444 }
@@ -49,7 +49,7 @@ fih_int boot_nv_security_counter_get(uint32_t image_id, fih_int *security_cnt)
4949 }
5050 }
5151
52- if (cur_sec_cnt [0 ] <= IRONSIDE_COUNTER_MAX_VALUE ) {
52+ if (cur_sec_cnt [0 ] <= IRONSIDE_SE_COUNTER_MAX_VALUE ) {
5353 * security_cnt = fih_int_encode (cur_sec_cnt [0 ]);
5454 FIH_RET (FIH_SUCCESS );
5555 }
@@ -59,11 +59,12 @@ fih_int boot_nv_security_counter_get(uint32_t image_id, fih_int *security_cnt)
5959
6060int32_t boot_nv_security_counter_update (uint32_t image_id , uint32_t img_security_cnt )
6161{
62- if ((img_security_cnt > IRONSIDE_COUNTER_MAX_VALUE ) || (image_id > IRONSIDE_COUNTER_NUM )) {
62+ if ((img_security_cnt > IRONSIDE_SE_COUNTER_MAX_VALUE ) ||
63+ (image_id > IRONSIDE_SE_COUNTER_NUM )) {
6364 return - BOOT_EBADARGS ;
6465 }
6566
66- if (ironside_counter_set (image_id , img_security_cnt ) != 0 ) {
67+ if (ironside_se_counter_set (image_id , img_security_cnt ) != 0 ) {
6768 return - BOOT_EBADSTATUS ;
6869 }
6970
@@ -79,7 +80,7 @@ fih_int boot_nv_security_counter_is_update_possible(uint32_t image_id, uint32_t
7980 if (FIH_EQ (fih_err , FIH_SUCCESS )) {
8081 int cnt = fih_int_decode (security_cnt );
8182
82- if ((cnt <= IRONSIDE_COUNTER_MAX_VALUE ) && (cnt <= img_security_cnt )) {
83+ if ((cnt <= IRONSIDE_SE_COUNTER_MAX_VALUE ) && (cnt <= img_security_cnt )) {
8384 FIH_RET (FIH_SUCCESS );
8485 }
8586 }
@@ -89,11 +90,11 @@ fih_int boot_nv_security_counter_is_update_possible(uint32_t image_id, uint32_t
8990
9091int32_t boot_nv_security_counter_lock (uint32_t image_id )
9192{
92- if (image_id > IRONSIDE_COUNTER_NUM ) {
93+ if (image_id > IRONSIDE_SE_COUNTER_NUM ) {
9394 return - BOOT_EBADARGS ;
9495 }
9596
96- if (ironside_counter_lock (image_id ) != 0 ) {
97+ if (ironside_se_counter_lock (image_id ) != 0 ) {
9798 return - BOOT_EBADSTATUS ;
9899 }
99100
0 commit comments