Skip to content

Commit

Permalink
Fixes for building TPM keystore with arch x86_64.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske authored and danielinux committed Aug 24, 2023
1 parent b8fc5da commit 95b0d90
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
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

0 comments on commit 95b0d90

Please sign in to comment.