diff --git a/include/user_settings.h b/include/user_settings.h index 9d7bd1e7a..6ea02d8ec 100644 --- a/include/user_settings.h +++ b/include/user_settings.h @@ -239,6 +239,11 @@ extern int tolower(int c); /* Get access to mp_* math API's for ECC encrypt */ #define WOLFSSL_PUBLIC_MP + + /* Configure RNG seed */ + #define CUSTOM_RAND_GENERATE_SEED(buf, sz) 0 /* stub, not used */ + #define WC_RNG_SEED_CB + #define HAVE_HASHDRBG #endif #ifdef WOLFTPM_MMIO diff --git a/lib/wolfTPM b/lib/wolfTPM index bbbafd68d..5b7e50a19 160000 --- a/lib/wolfTPM +++ b/lib/wolfTPM @@ -1 +1 @@ -Subproject commit bbbafd68d09c6d453a5ef93214c9296dd7bc93b3 +Subproject commit 5b7e50a19c79ef51530df6f32912c60490336fb4 diff --git a/src/image.c b/src/image.c index 4b1a59078..291565c5f 100644 --- a/src/image.c +++ b/src/image.c @@ -962,7 +962,7 @@ static int TPM2_IoCb(TPM2_CTX* ctx, const byte* txBuf, byte* rxBuf, return ret; } -#endif /* !ARCH_SIM */ +#endif /* !ARCH_SIM && !WOLFTPM_MMIO */ #ifdef WOLFBOOT_MEASURED_BOOT #define measure_boot(hash) wolfBoot_tpm2_extend((hash), __LINE__) diff --git a/stage1/Makefile b/stage1/Makefile index 54af56b7c..fe99eeee4 100644 --- a/stage1/Makefile +++ b/stage1/Makefile @@ -32,8 +32,11 @@ WOLFCRYPT_OBJS:= PUBLIC_KEY_OBJS:= # make mk scripts aware that we are building stage1 STAGE1=1 -# Forcefully disable TPM support in first stage loader -WOLFTPM=0 +# Forcefully disable TPM support in first stage loader for PPC +ifeq ($(ARCH),PPC) + WOLFTPM=0 + WOLFBOOT_TPM_KEYSTORE=0 +endif ELF=0 MULTIBOOT2=0 LINUX_PAYLOAD=0 @@ -45,10 +48,13 @@ include ../arch.mk include ../options.mk CFLAGS+= \ - -I".." -I"../include/" -I"../lib/wolfssl" \ + -I".." -I"../include/" -I"../lib/wolfssl" -I"../lib/wolfTPM" \ -D"WOLFSSL_USER_SETTINGS" \ -D"WOLFTPM_USER_SETTINGS" \ - -D"PLATFORM_$(TARGET)" + -D"PLATFORM_$(TARGET)" \ + +# Do not change platform auth in stage 1 +CFLAGS+=-D"WOLFBOOT_TPM_NO_CHG_PLAT_AUTH" # Setup default optimizations (for GCC) ifeq ($(USE_GCC_HEADLESS),1) @@ -89,6 +95,7 @@ LS1_OBJS=$(addprefix $(BUILD_DIR)/, $(notdir $(OBJS))) vpath %.c ../src vpath %.c ../hal vpath %.c ../lib/wolfssl/wolfcrypt/src +vpath %.c ../lib/wolfTPM/src vpath %.c ../src/x86 vpath %.S ../src diff --git a/tools/tpm/Makefile b/tools/tpm/Makefile index c150d64a2..482f58fff 100644 --- a/tools/tpm/Makefile +++ b/tools/tpm/Makefile @@ -27,6 +27,8 @@ CFLAGS+=$(OPTIMIZE) ifeq ($(TARGET),sim) CFLAGS+=-D"WOLFTPM_SWTPM" +else + CFLAGS+=-D"WOLFTPM_EXAMPLE_HAL" endif # Sources