Skip to content

Commit e43cdd7

Browse files
committed
update: keep zeroize helper available
Make wolfBoot_zeroize unconditional in update_flash.c so the common final-swap scrub compiles in non-encrypted builds. F/CI
1 parent 498453e commit e43cdd7

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

src/update_flash.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,18 @@
3333

3434
#include "delta.h"
3535
#include "printf.h"
36+
static void wolfBoot_zeroize(void *ptr, size_t len)
37+
{
38+
volatile uint8_t *p = (volatile uint8_t *)ptr;
39+
40+
while (len-- > 0) {
41+
*p++ = 0;
42+
}
43+
}
44+
3645
#ifdef EXT_ENCRYPTED
3746
int wolfBoot_force_fallback_iv(int enable);
47+
#include "encrypt.h"
3848
#endif
3949
#ifdef WOLFBOOT_TPM
4050
#include "tpm.h"
@@ -43,19 +53,6 @@ int wolfBoot_force_fallback_iv(int enable);
4353
int WP11_Library_Init(void);
4454
#endif
4555

46-
#ifdef EXT_ENCRYPTED
47-
#include "encrypt.h"
48-
49-
static void wolfBoot_zeroize(void *ptr, size_t len)
50-
{
51-
volatile uint8_t *p = (volatile uint8_t *)ptr;
52-
53-
while (len-- > 0) {
54-
*p++ = 0;
55-
}
56-
}
57-
#endif /* EXT_ENCRYPTED */
58-
5956
#ifdef MMU
6057
#error "MMU is not yet supported for update_flash.c, please consider update_ram.c instead"
6158
#endif

0 commit comments

Comments
 (0)