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

Fix building PKCS11 TrustZone with any authentication algorithm #451

Merged
merged 2 commits into from
May 29, 2024
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
6 changes: 0 additions & 6 deletions include/otp_keystore.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ struct KEYSTORE_HDR_PACKED wolfBoot_otp_hdr {

static const char KEYSTORE_HDR_MAGIC[8] = "WOLFBOOT";

#if !defined(KEYSTORE_ANY) && (KEYSTORE_PUBKEY_SIZE != KEYSTORE_PUBKEY_SIZE_ECC256)
#error Key algorithm mismatch. Remove old keys via 'make keysclean'
#else

#define KEYSTORE_MAX_PUBKEYS ((OTP_SIZE - OTP_HDR_SIZE) / SIZEOF_KEYSTORE_SLOT)

#if (OTP_SIZE == 0)
Expand All @@ -72,8 +68,6 @@ static const char KEYSTORE_HDR_MAGIC[8] = "WOLFBOOT";
#error "No space for any keystores in OTP with current algorithm"
#endif

#endif /* KEYSTORE_ANY */

#endif /* FLASH_OTP_KEYSTORE */

#endif /* OTP_KEYSTORE_H */
2 changes: 1 addition & 1 deletion include/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ extern int tolower(int c);


/* Curve */
# ifdef WOLFBOOT_SIGN_ECC256
# if defined(WOLFBOOT_SIGN_ECC256) || defined(WOLFCRYPT_SECURE_MODE)
# define HAVE_ECC256
# elif defined(WOLFBOOT_SIGN_ECC384)
# define HAVE_ECC384
Expand Down
16 changes: 14 additions & 2 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,6 @@ ifeq ($(WOLFCRYPT_TZ_PKCS11),1)
CFLAGS+=-DWP11_HASH_PIN_COST=3
OBJS+=src/pkcs11_store.o
OBJS+=src/pkcs11_callable.o
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/aes.o
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/rsa.o
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/pwdbased.o
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/hmac.o
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/dh.o
Expand All @@ -656,6 +654,20 @@ ifeq ($(WOLFCRYPT_TZ_PKCS11),1)
./lib/wolfPKCS11/src/slot.o \
./lib/wolfPKCS11/src/wolfpkcs11.o
STACK_USAGE=16688
ifneq ($(ENCRYPT),1)
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/aes.o
endif
ifeq ($(findstring RSA,$(SIGN)),)
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/rsa.o
endif
ifeq ($(findstring ECC,$(SIGN)),)
WOLFCRYPT_OBJS+=./lib/wolfssl/wolfcrypt/src/ecc.o
endif
ifeq ($(findstring RSA,$(SIGN)),)
ifeq ($(findstring ECC,$(SIGN)),)
WOLFCRYPT_OBJS+=$(MATH_OBJS) ./lib/wolfssl/wolfcrypt/src/wolfmath.o
endif
endif
endif

OBJS+=$(PUBLIC_KEY_OBJS)
Expand Down
Loading