Skip to content

Commit

Permalink
Fixes for simulator malloc/free. Fix for RSA encrypt missing `wc_RsaP…
Browse files Browse the repository at this point in the history
…ublicEncrypt_ex`.
  • Loading branch information
dgarske authored and danielinux committed Aug 17, 2023
1 parent 9ca5824 commit 0ee918f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ extern int tolower(int c);
# define WOLFSSL_RSA_VERIFY_INLINE
# define WOLFSSL_RSA_VERIFY_ONLY
# endif
# define WC_NO_RSA_OAEP
# ifndef WOLFBOOT_TPM_KEYSTORE
# define WC_NO_RSA_OAEP
# endif
# define FP_MAX_BITS (2048 * 2)
/* sp math */
# if !defined(USE_FAST_MATH) && !defined(WOLFSSL_SP_MATH_ALL)
Expand Down Expand Up @@ -229,6 +231,9 @@ extern int tolower(int c);
#endif

#ifdef WOLFBOOT_TPM
/* Do not use heap */
#define WOLFTPM2_NO_HEAP

#ifdef WOLFBOOT_TPM_KEYSTORE
/* Enable AES CFB (parameter encryption) and HMAC (for KDF) */
#define WOLFSSL_AES_CFB
Expand Down Expand Up @@ -319,7 +324,9 @@ extern int tolower(int c);
# define WOLFSSL_SP_NO_MALLOC
# define WOLFSSL_SP_NO_DYN_STACK
# endif
# define WOLFSSL_NO_MALLOC
# ifndef ARCH_SIM
# define WOLFSSL_NO_MALLOC
# endif
#else
# if defined(WOLFBOOT_HUGE_STACK)
# error "Cannot use SMALL_STACK=1 with HUGE_STACK=1"
Expand Down
3 changes: 3 additions & 0 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ ifeq ($(SIGN),RSA2048)
./lib/wolfssl/wolfcrypt/src/rsa.o \
./lib/wolfssl/wolfcrypt/src/asn.o \
./lib/wolfssl/wolfcrypt/src/hash.o \
./lib/wolfssl/wolfcrypt/src/memory.o \
./lib/wolfssl/wolfcrypt/src/wolfmath.o \
./lib/wolfssl/wolfcrypt/src/wc_port.o
CFLAGS+=-D"WOLFBOOT_SIGN_RSA2048" $(RSA_EXTRA_CFLAGS)
Expand Down Expand Up @@ -221,6 +222,7 @@ ifeq ($(SIGN),RSA3072)
./lib/wolfssl/wolfcrypt/src/rsa.o \
./lib/wolfssl/wolfcrypt/src/asn.o \
./lib/wolfssl/wolfcrypt/src/hash.o \
./lib/wolfssl/wolfcrypt/src/memory.o \
./lib/wolfssl/wolfcrypt/src/wolfmath.o \
./lib/wolfssl/wolfcrypt/src/wc_port.o
CFLAGS+=-D"WOLFBOOT_SIGN_RSA3072" $(RSA_EXTRA_CFLAGS)
Expand Down Expand Up @@ -258,6 +260,7 @@ ifeq ($(SIGN),RSA4096)
./lib/wolfssl/wolfcrypt/src/rsa.o \
./lib/wolfssl/wolfcrypt/src/asn.o \
./lib/wolfssl/wolfcrypt/src/hash.o \
./lib/wolfssl/wolfcrypt/src/memory.o \
./lib/wolfssl/wolfcrypt/src/wolfmath.o \
./lib/wolfssl/wolfcrypt/src/wc_port.o
CFLAGS+=-D"WOLFBOOT_SIGN_RSA4096" $(RSA_EXTRA_CFLAGS)
Expand Down

0 comments on commit 0ee918f

Please sign in to comment.