Skip to content

Commit 37326c4

Browse files
committed
Fix unit test + compile warning (CI)
1 parent 5684525 commit 37326c4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libwolfboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static uint8_t encrypt_iv_nonce[ENCRYPT_NONCE_SIZE] XALIGNED(4);
7575
#define XMEMCMP memcmp
7676
#endif
7777

78-
#ifdef __WOLFBOOT
78+
#if defined (__WOLFBOOT) || defined (UNIT_TEST)
7979
int wolfBoot_initialize_encryption(void)
8080
{
8181
if (!encrypt_initialized) {

src/update_flash.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ static int RAMFUNCTION wolfBoot_backup_last_boot_sector(uint32_t sector)
227227
sector, src->part, dst->part);
228228

229229
wolfBoot_get_encrypt_key(key, nonce);
230-
wolfBoot_printf("In function wolfBoot_backup_last_boot_sector (sector # %lu)\n", sector);
230+
wolfBoot_printf("In function wolfBoot_backup_last_boot_sector (sector # %u)\n",
231+
sector);
231232

232233
iv_counter = src_sector_offset;
233234
iv_counter /= ENCRYPT_BLOCK_SIZE;
@@ -240,7 +241,8 @@ static int RAMFUNCTION wolfBoot_backup_last_boot_sector(uint32_t sector)
240241
if (PART_IS_EXT(dst)) {
241242
uint32_t sz = 0;
242243
uint32_t step = 0;
243-
uint8_t *orig = (uint8_t *)(WOLFBOOT_PARTITION_BOOT_ADDRESS) + src_sector_offset;
244+
uint8_t *orig = (uint8_t *)(WOLFBOOT_PARTITION_BOOT_ADDRESS) +
245+
src_sector_offset;
244246
while (pos < WOLFBOOT_SECTOR_SIZE) {
245247
uint32_t len = ENCRYPT_BLOCK_SIZE;
246248
XMEMCPY(block, orig + pos, ENCRYPT_BLOCK_SIZE);

0 commit comments

Comments
 (0)