Skip to content

Commit cab04ad

Browse files
committed
Update wolfssl submodule to latest master
* file level rename for ML-DSA * Add missing source file to build system * Update some macros * Other minor fixes * Update size limitations for some slight increases
1 parent c3d255d commit cab04ad

12 files changed

Lines changed: 45 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ list(
12311231
lib/wolfssl/wolfcrypt/src/tfm.c
12321232
lib/wolfssl/wolfcrypt/src/wc_port.c
12331233
lib/wolfssl/wolfcrypt/src/wolfmath.c
1234-
lib/wolfssl/wolfcrypt/src/dilithium.c
1234+
lib/wolfssl/wolfcrypt/src/wc_mldsa.c
12351235
lib/wolfssl/wolfcrypt/src/wc_lms.c
12361236
lib/wolfssl/wolfcrypt/src/wc_lms_impl.c
12371237
lib/wolfssl/wolfcrypt/src/wc_xmss.c

include/user_settings.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,19 @@ extern int tolower(int c);
230230
defined(WOLFBOOT_SIGN_SECONDARY_RSAPSS4096) || \
231231
(defined(WOLFCRYPT_SECURE_MODE) && (!defined(PKCS11_SMALL)))
232232

233-
# define WC_RSA_BLINDING
233+
/* RSA blinding protects RSA private-key operations against timing
234+
* side-channels and requires the wolfCrypt RNG. wolfssl's settings.h
235+
* rejects the combination WC_RSA_BLINDING + WC_NO_RNG, so only enable
236+
* blinding in configurations where RNG is available. wolfBoot itself
237+
* never invokes a wolfCrypt RSA private-key op (any signing happens
238+
* inside the TPM/HSM), so blinding has nothing to protect at runtime
239+
* here; this define mainly silences wolfssl's harden-mode warning in
240+
* builds where wolfCrypt does have an RNG and could in principle sign. */
241+
# if defined(WOLFCRYPT_SECURE_MODE) || defined(WOLFBOOT_TPM_PARMENC) || \
242+
defined(WOLFCRYPT_TEST) || defined(WOLFCRYPT_BENCHMARK) || \
243+
defined(WOLFBOOT_ENABLE_WOLFHSM_SERVER)
244+
# define WC_RSA_BLINDING
245+
# endif
234246
# define WC_RSA_DIRECT
235247
# define RSA_LOW_MEM
236248
# define WC_ASN_HASH_SHA256

lib/wolfssl

Submodule wolfssl updated 769 files

options.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ XMSS_EXTRA=\
187187
-D"WOLFSSL_XMSS_VERIFY_ONLY" -D"WOLFSSL_XMSS_MAX_HEIGHT=32"
188188

189189
ML_DSA_OBJS=\
190-
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/dilithium.o
190+
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/wc_mldsa.o
191191

192192
ML_DSA_EXTRA=\
193193
-D"ML_DSA_IMAGE_SIGNATURE_SIZE"=$(IMAGE_SIGNATURE_SIZE) \

src/xmalloc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct xmalloc_slot {
5353
# define HASH_BLOCK_SIZE WC_SHA256_BLOCK_SIZE
5454
#elif defined WOLFBOOT_HASH_SHA384
5555
# include <wolfssl/wolfcrypt/sha512.h>
56-
# define HASH_BLOCK_SIZE (WC_SHA384_BLOCK_SIZE / sizeof(uint32_t))
56+
# define HASH_BLOCK_SIZE WC_SHA384_BLOCK_SIZE
5757
#elif defined WOLFBOOT_HASH_SHA3_384
5858
# include <wolfssl/wolfcrypt/sha3.h>
5959
# define HASH_BLOCK_SIZE WC_SHA3_384_BLOCK_SIZE
@@ -301,9 +301,7 @@ static uint32_t sha_block[HASH_BLOCK_SIZE];
301301
static uint32_t sha512_block[sizeof(word64) * 16];
302302

303303
static struct xmalloc_slot xmalloc_pool[] = {
304-
#if defined(WOLFBOOT_HASH_SHA256) || defined(WOLFBOOT_HASH_SHA384)
305-
{ (uint8_t *)sha_block, HASH_BLOCK_SIZE * sizeof(uint32_t), 0 },
306-
#endif
304+
{ (uint8_t *)sha_block, sizeof(sha_block), 0 },
307305
{ (uint8_t *)sha512_block, sizeof(word64) * 16, 0 },
308306
{ NULL, 0, 0}
309307
};

test-app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ if(BUILD_TEST_APPS)
225225
../lib/wolfssl/wolfcrypt/src/aes.c
226226
../lib/wolfssl/wolfcrypt/src/hmac.c
227227
../lib/wolfssl/wolfcrypt/src/pwdbased.c
228+
../lib/wolfssl/wolfcrypt/src/pkcs12.c
228229
../lib/wolfssl/wolfcrypt/src/hash.c
229230
../lib/wolfssl/wolfcrypt/src/sha256.c
230231
../lib/wolfssl/wolfcrypt/src/sha512.c

test-app/Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ ifeq ($(WOLFCRYPT_SUPPORT),1)
223223
ifeq ($(PPC64),1) # requires wolfssl PR 9852
224224
# AES
225225
APP_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/port/ppc64/ppc64-aes-asm_c.o
226-
CFLAGS+=-DWOLFSSL_PPC64_ASM
226+
CFLAGS+=-DWOLFSSL_PPC64_ASM
227227
CFLAGS+=-DWOLFSSL_PPC64_ASM_INLINE
228228
CFLAGS+=-DWOLFSSL_PPC64_ASM_SMALL
229229
CFLAGS+=-DWOLFSSL_PPC64_ASM_AES_NO_HARDEN
@@ -282,6 +282,7 @@ ifeq ($(TZEN),1)
282282
APP_OBJS+=./wcs/aes.o
283283
APP_OBJS+=./wcs/hmac.o
284284
APP_OBJS+=./wcs/pwdbased.o
285+
APP_OBJS+=./wcs/pkcs12.o
285286
APP_OBJS+=./wcs/hash.o
286287
APP_OBJS+=./wcs/sha256.o
287288
APP_OBJS+=./wcs/sha512.o
@@ -299,6 +300,17 @@ ifeq ($(TZEN),1)
299300
APP_OBJS+=./wcs/coding.o
300301
APP_OBJS+=./wcs/wc_encrypt.o
301302
APP_OBJS+=./wcs/wc_port.o
303+
ifeq ($(SIGN),LMS)
304+
APP_OBJS+=./wcs/wc_lms.o
305+
APP_OBJS+=./wcs/wc_lms_impl.o
306+
endif
307+
ifeq ($(SIGN),XMSS)
308+
APP_OBJS+=./wcs/wc_xmss.o
309+
APP_OBJS+=./wcs/wc_xmss_impl.o
310+
endif
311+
ifeq ($(SIGN),ML_DSA)
312+
APP_OBJS+=./wcs/wc_mldsa.o
313+
endif
302314

303315
ifeq ($(SPMATH),1)
304316
CFLAGS+=-DWOLFSSL_HAVE_SP_RSA -DWOLFSSL_HAVE_SP_ECC

tools/keytools/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ OBJS_REAL+=\
108108
OBJS_REAL+=\
109109
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/wc_xmss.o \
110110
$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/wc_xmss_impl.o
111-
OBJS_REAL+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/dilithium.o
111+
OBJS_REAL+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/wc_mldsa.o
112112

113113
OBJS_VIRT=$(addprefix $(OBJDIR), $(notdir $(OBJS_REAL)))
114114
DEPS=$(OBJS_VIRT:.o=.d) sign.d keygen.d

tools/keytools/wolfBootKeygenTool.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\asn.c" />
158158
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\chacha.c" />
159159
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\coding.c" />
160-
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\dilithium.c" />
160+
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\wc_mldsa.c" />
161161
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ecc.c" />
162162
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ed25519.c" />
163163
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ed448.c" />

tools/keytools/wolfBootSignTool.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\asn.c" />
159159
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\chacha.c" />
160160
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\coding.c" />
161-
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\dilithium.c" />
161+
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\wc_mldsa.c" />
162162
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ecc.c" />
163163
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ed25519.c" />
164164
<ClCompile Include="..\..\lib\wolfssl\wolfcrypt\src\ed448.c" />

0 commit comments

Comments
 (0)