diff --git a/Makefile b/Makefile index a5a81c18b5..0acddd3252 100644 --- a/Makefile +++ b/Makefile @@ -261,6 +261,8 @@ ifeq ($(TARGET),raspi3) endif ifeq ($(TARGET),sim) + CFLAGS+=-fno-pie + LDFLAGS+=-no-pie MAIN_TARGET:=wolfboot.bin tools/bin-assemble/bin-assemble test-app/image_v1_signed.bin internal_flash.dd endif diff --git a/lib/wolfPKCS11 b/lib/wolfPKCS11 index a1c62599d2..8fec69592d 160000 --- a/lib/wolfPKCS11 +++ b/lib/wolfPKCS11 @@ -1 +1 @@ -Subproject commit a1c62599d24f40cbdb3e90bf4ef00023be3b4fe9 +Subproject commit 8fec69592d99bf4d8f01e36acd16f7d27b4639f4 diff --git a/lib/wolfPSA b/lib/wolfPSA index bb36f76632..f289a6f127 160000 --- a/lib/wolfPSA +++ b/lib/wolfPSA @@ -1 +1 @@ -Subproject commit bb36f766321230c516af1b50e3264ed290fe5955 +Subproject commit f289a6f12788237224f26635f8586b1f63c817e4 diff --git a/lib/wolfTPM b/lib/wolfTPM index d1756f96c2..efaab4afe6 160000 --- a/lib/wolfTPM +++ b/lib/wolfTPM @@ -1 +1 @@ -Subproject commit d1756f96c2da425b56cbfac164c7226fb8d00e52 +Subproject commit efaab4afe67fbe8616a08d46b721cb0cbd375894 diff --git a/lib/wolfssl b/lib/wolfssl index 63f6f0511b..b5874a6d9e 160000 --- a/lib/wolfssl +++ b/lib/wolfssl @@ -1 +1 @@ -Subproject commit 63f6f0511b76c78f4266d5bee3114506d890cfcc +Subproject commit b5874a6d9ef95bb6ddde416c720e1f195d0c1b43 diff --git a/src/xmalloc.c b/src/xmalloc.c index 69962d6aec..a484ecd866 100644 --- a/src/xmalloc.c +++ b/src/xmalloc.c @@ -171,9 +171,10 @@ struct xmalloc_slot { #define MP_CURVE_FIELD_COUNT_SIZE (380) #ifndef _LP64 #define ECC_POINT_SIZE (232) + #define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6) #else #define ECC_POINT_SIZE (320) - #define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 5) + #define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6) #endif #define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6) #define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1)) @@ -187,7 +188,7 @@ struct xmalloc_slot { #else #define ECC_POINT_SIZE (512) #endif - #define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5) + #define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6) #define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6) #define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1)) #endif @@ -200,7 +201,7 @@ struct xmalloc_slot { #else #define ECC_POINT_SIZE (608) #endif - #define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 5) + #define MP_INT_BUFFER_SIZE (MP_INT_TYPE_SIZE * 6) #define MP_INT_BUFFER_SIZE_1 (MP_INT_TYPE_SIZE * 6) #define MP_DIGIT_BUFFER_MONT_SIZE (sizeof(fp_digit)*(FP_SIZE + 1)) #endif diff --git a/test-app/Makefile b/test-app/Makefile index 3a58795173..a2e54effa9 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -53,7 +53,10 @@ ifeq ($(HASH),SHA3_384) CFLAGS+=-D"WOLFBOOT_HASH_SHA3_384" endif - +STACK_USAGE_LIMIT:=1024 +ifeq ($(TARGET),sim) + STACK_USAGE_LIMIT:=4608 +endif ifeq ($(TARGET),ti_hercules) APP_OBJS:=app_$(TARGET).o ../test-app/libwolfboot.o @@ -63,7 +66,7 @@ else # Stack usage computation not supported on TriCore ifneq ($(ARCH),AURIX_TC3) ifneq ($(USE_CLANG),1) - CFLAGS+=-Wstack-usage=1024 + CFLAGS+=-Wstack-usage=$(STACK_USAGE_LIMIT) endif endif CFLAGS+=-DTARGET_$(TARGET) -I../include @@ -509,6 +512,8 @@ ifeq ($(TARGET),sim) # LD on MacOS does not support "-Map=" LDMAPSUPPORTED=$(shell $(CC) -Wl,-Map=image.map 2>&1 | grep 'unknown option') LDFLAGS= + CFLAGS+=-fno-pie + LDFLAGS+=-no-pie ifeq ($(FORCE_32BIT),1) LDFLAGS+=-m32 CFLAGS+=-m32 diff --git a/tools/keytools/Makefile b/tools/keytools/Makefile index a746beb914..7029295ba6 100644 --- a/tools/keytools/Makefile +++ b/tools/keytools/Makefile @@ -1,7 +1,5 @@ # wolfBoot KeyGen and Signing Tool --include ../../.config - V?=0 ifeq ($(V),0) Q=@ @@ -18,6 +16,7 @@ LD = gcc WOLFBOOTDIR = ../.. CFLAGS = -Wall -Wextra -Werror CFLAGS += -I. -DWOLFSSL_USER_SETTINGS -I$(WOLFBOOT_LIB_WOLFSSL) -I$(WOLFBOOTDIR)/include +DEPFLAGS = -MMD -MP LDFLAGS = OBJDIR = ./ LIBS = @@ -112,6 +111,7 @@ OBJS_REAL+=\ OBJS_REAL+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/dilithium.o OBJS_VIRT=$(addprefix $(OBJDIR), $(notdir $(OBJS_REAL))) +DEPS=$(OBJS_VIRT:.o=.d) sign.d keygen.d vpath %.c $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/ vpath %.c $(WOLFBOOTDIR)/src/ vpath %.c ./ @@ -125,11 +125,11 @@ debug: all # build objects $(OBJDIR)/%.o: %.c - $(Q)$(CC) $(CFLAGS) -c -o $@ $< + $(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $< $(OBJDIR)/%.o: $(WOLFBOOTDIR)/src/%.c - $(Q)$(CC) $(CFLAGS) -c -o $@ $< + $(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $< $(OBJDIR)/%.o: $(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/%.c - $(Q)$(CC) $(CFLAGS) -c -o $@ $< + $(Q)$(CC) $(CFLAGS) $(DEPFLAGS) -c -o $@ $< # build templates sign: $(OBJS_VIRT) $(LIBS) sign.o @@ -141,5 +141,6 @@ keygen: $(OBJS_VIRT) $(LIBS) keygen.o $(Q)$(LD) -o $@ $@.o $(OBJS_VIRT) $(LIBS) $(LDFLAGS) clean: - rm -f sign keygen *.o + rm -f sign keygen *.o *.d +-include $(DEPS)