Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,7 @@ ifeq ($(ARCH), AURIX_TC3)
ifeq ($(WOLFHSM_SERVER),1)
USE_GCC_HEADLESS=0

CFLAGS += -I$(WOLFHSM_INFINEON_TC3XX)/tchsm-server/cfg \
-I$(WOLFHSM_INFINEON_TC3XX)/port/server
CFLAGS += -I$(WOLFHSM_INFINEON_TC3XX)/port/server

OBJS += $(WOLFHSM_INFINEON_TC3XX)/port/server/port_halflash_df1.o \
$(WOLFHSM_INFINEON_TC3XX)/port/server/io.o \
Expand Down Expand Up @@ -1292,8 +1291,9 @@ ifeq ($(ARCH), AURIX_TC3)

ifeq ($(WOLFHSM_CLIENT),1)
CFLAGS += -I$(WOLFHSM_INFINEON_TC3XX)/port/client
# All source files in port/client but listed as *.o files
OBJS += $(patsubst %.c,%.o,$(wildcard $(WOLFHSM_INFINEON_TC3XX)/port/client/*.c))
OBJS += $(WOLFHSM_INFINEON_TC3XX)/port/client/hsm_ipc.o \
$(WOLFHSM_INFINEON_TC3XX)/port/client/io.o \
$(WOLFHSM_INFINEON_TC3XX)/port/client/tchsm_hh_host.o
endif

endif # !AURIX_TC3_HSM
Expand Down
9 changes: 0 additions & 9 deletions hal/aurix_tc3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
/* wolfHSM client context and configuration */
#if defined(WOLFBOOT_ENABLE_WOLFHSM_CLIENT)

static int _cancelCb(uint16_t cancelSeq);
static int _connectCb(void* context, whCommConnected connect);

/* Client configuration/contexts */
Expand Down Expand Up @@ -702,13 +701,6 @@ void ext_flash_unlock(void)

#ifdef WOLFBOOT_ENABLE_WOLFHSM_CLIENT

static int _cancelCb(uint16_t cancelSeq)
{
HSM_SHM_CORE0_CANCEL_SEQ = cancelSeq;
(void)tchsmHhHost2Hsm_Notify(TCHSM_HOST2HSM_NOTIFY_CANCEL);
return 0;
}

static int _connectCb(void* context, whCommConnected connect)
{
int ret;
Expand Down Expand Up @@ -756,7 +748,6 @@ int hal_hsm_init_connect(void)

whClientConfig c_conf[1] = {{
.comm = cc_conf,
.cancelCb = _cancelCb,
}};

rc = hsm_ipc_init();
Expand Down
2 changes: 2 additions & 0 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,9 @@ ifeq ($(WOLFHSM_CLIENT),1)
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_client_nvm.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_client_cryptocb.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_client_crypto.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_client_dma.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_crypto.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_dma.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_utils.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_comm.o \
$(WOLFBOOT_LIB_WOLFHSM)/src/wh_message_comm.o \
Expand Down
7 changes: 5 additions & 2 deletions src/update_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
uint16_t update_type;
uint32_t fw_size;
uint32_t size;
#if defined(DELTA_UPDATES)
int inverse = 0;
#endif
int fallback_image = 0;
#if defined(DISABLE_BACKUP) && defined(EXT_ENCRYPTED)
uint8_t key[ENCRYPT_KEY_SIZE];
Expand Down Expand Up @@ -713,7 +715,7 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
wolfBoot_open_image(&boot, PART_BOOT);
wolfBoot_open_image(&swap, PART_SWAP);

#ifdef EXT_ENCRYPTED
#if defined(EXT_ENCRYPTED) && defined(DELTA_UPDATES)
wolfBoot_printf("Update partition fallback image: %d\n", fallback_image);
if (fallback_image)
inverse = 1;
Expand Down Expand Up @@ -783,10 +785,11 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
}
#endif
}

#ifdef DELTA_UPDATES
if (cur_ver > upd_ver)
inverse = 1;

#ifdef DELTA_UPDATES
if ((update_type & 0x00F0) == HDR_IMG_TYPE_DIFF) {
/* if magic isn't set stateRet will be -1 but that means we're on a
* fresh partition and aren't resuming */
Expand Down