File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff 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 )
7979int wolfBoot_initialize_encryption (void )
8080{
8181 if (!encrypt_initialized ) {
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments