Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for building TPM keystore with arch x86_64 #353

Merged
merged 1 commit into from
Aug 24, 2023
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
5 changes: 5 additions & 0 deletions include/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/wolfTPM
Submodule wolfTPM updated 2 files
+0 −1 src/tpm2.c
+1 −1 src/tpm2_wrap.c
2 changes: 1 addition & 1 deletion src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
15 changes: 11 additions & 4 deletions stage1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions tools/tpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ CFLAGS+=$(OPTIMIZE)

ifeq ($(TARGET),sim)
CFLAGS+=-D"WOLFTPM_SWTPM"
else
CFLAGS+=-D"WOLFTPM_EXAMPLE_HAL"
endif

# Sources
Expand Down
Loading