1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00
Commit Graph

1453 Commits

Author SHA1 Message Date
Sean Parkinson
823283d609 RSA/ECC: no software builds
SE050 and CryptoCell are supported with this.
WOLFSSL_NO_RSA_SW to disable the RSA software implementation.
WOLFSSL_NO_ECC_SW to disable the ECC software implementation.
2026-10-12 11:47:02 +10:00
philljj
22b60ae1cc Merge pull request #11668 from kaleb-himes/PQ-FS-2026-Part3-SecurityReview-nofallback-U
3x compliance items (CBC, ECDH, DSA)
2026-10-09 18:15:53 -05:00
Sean Parkinson
97a91501a5 Merge pull request #11683 from dgarske/cm_typed
Replace `void*` with `WOLFSSL_CERT_MANAGER*` in ASN/CA Lookups
2026-10-09 10:26:43 +10:00
philljj
b81d604cbd Merge pull request #11679 from miyazakh/f13116_tsipzero
Accept zero-length ciphertext in TSIP AES-GCM decrypt
2026-10-08 10:21:18 -05:00
Hideki Miyazaki
4ae1d4e77f Add AES-256 zero-length coverage to TSIP GCM unit test 2026-10-08 14:29:25 +09:00
kaleb-himes
7f6d4daa96 mldsa: reject a HashML-DSA pre-hash weaker than the parameter set 2026-10-07 19:10:08 -06:00
David Garske
546961477a asn: type the certificate manager parameter instead of void* 2026-10-07 16:17:31 -07:00
philljj
e09a10ecd5 Merge pull request #11625 from dgarske/cryptonly_nomalloc
wolfCrypt: support zero-malloc cert encoding and clean up CMake/platform defines
2026-10-07 08:38:22 -05:00
Hideki Miyazaki
f32984761c Accept zero-length ciphertext in TSIP AES-GCM decrypt
- Add zero-length decrypt cases to the RX72N TSIP unit test.
2026-10-07 11:25:01 +09:00
Aidan Garske
3fee3b3e1e Free newly claimed QNX CAAM partitions on mapping failure 2026-10-05 11:58:50 -07:00
Aidan Garske
b47b771563 Fix QNX CAAM partition ownership tracking 2026-10-05 11:18:59 -07:00
Aidan Garske
10df338fa6 Fix QNX CAAM review findings 2026-10-05 11:18:34 -07:00
Aidan Garske
592d69cbc9 F-12311 - Validate QNX partition access ranges 2026-10-05 11:18:34 -07:00
Aidan Garske
ec4ac91775 F-12310 - Enforce QNX partition ownership 2026-10-05 11:18:34 -07:00
Aidan Garske
f838ec1ff1 F-12312 - Reject short QNX AES requests 2026-10-05 11:18:34 -07:00
Aidan Garske
85bc038536 F-12309 - Validate QNX secure-memory partition indices 2026-10-05 11:18:33 -07:00
David Garske
84c4b409cb Provide XATOI under STRING_USER and in the platform templates 2026-10-05 00:09:44 -07:00
JacobBarthelmeh
0ea2866041 Merge pull request #11563 from miyazakh/f10033_FSPSMgcm
Fixes and tooling for the RA6M4 (Renesas SCE/FSPSM) port
2026-10-02 08:31:46 -06:00
Hideki Miyazaki
ea80b9d84d Addressed review comments
- fsp.ld  Removed
 - README  additional description to place the RTT control block at a fixed
 - renesas_fspsm_aes.c : WOLFSSL_MAX_32BIT use, fixes indent
 - .gitignore Added fsp.ld in RA6M4 projects
2026-10-02 09:56:11 +09:00
JacobBarthelmeh
93253e6238 Merge pull request #11479 from miyazakh/f10032_tsipgcm
TSIP TLS 1.3 / AES-GCM fixes for the RX72N sample
2026-09-30 16:01:19 -06:00
Hideki Miyazaki
45b8dc2f61 Addressed review comments 2026-09-30 16:58:40 +09:00
Hideki Miyazaki
81741b1939 Switch RA6M4 from fastmath (TFM) to SP math
Replace USE_FAST_MATH/TFM_TIMING_RESISTANT with SP math, sized for the
fixed key sizes this board uses (RSA 2048, ECC P-256, Curve25519,
FFDHE 2048): WOLFSSL_SP_MATH + WOLFSSL_HAVE_SP_RSA/DH/ECC, with
WOLFSSL_SP_ARM_CORTEX_M_ASM for the Cortex-M33 assembly path and
WOLFSSL_SP_SMALL/WOLFSSL_SP_NO_MALLOC/WOLFSSL_SP_NO_DYN_STACK/
WOLFSSL_SP_NO_3072 to keep it small and heap/VLA-free for this
embedded target.
2026-09-30 13:40:30 +09:00
Hideki Miyazaki
de9fd34a81 Make set_demo_mode.ps1's comment normalization whitespace-tolerant
Pass 1 only matched the exact "/*#define X*/" form, but the checked-in
wolfssl_demo.h spells BENCHMARK's line with spaces ("/* #define
BENCHMARK */"). That left -Mode bench unable to enable BENCHMARK, and
any other mode's pass 2 matched "#define BENCHMARK" inside the spaced
comment and produced an invalid nested comment ("/* /*#define
BENCHMARK*/ */"), breaking the header. Use a whitespace-tolerant regex
instead of a literal match.
2026-09-30 09:47:57 +09:00
Hideki Miyazaki
2046d174de Fix batch script bugs: stale errorlevel check, missing JLink sleep
build.bat: %ERRORLEVEL% inside a parenthesized if-block is expanded at
parse time, before the PowerShell call runs, so it silently ignored a
failed set_demo_mode.ps1. Use "if errorlevel 1", matching the same fix
already applied to the clean step below.

debug_run.bat: QC_DELAY_MS was read into a variable and shown in
status messages, but the generated J-Link command file never actually
emitted a "sleep" command between "g" and "qc" -- the probe
disconnected immediately instead of waiting. Emit "sleep !QC_DELAY_MS!"
in both the restart and reload command files.
2026-09-30 09:44:10 +09:00
Hideki Miyazaki
194eb8ee69 Enable GCM_TABLE_4BIT/TLS 1.3 by default; fix guser_PKCbInfo declaration
user_settings.h: enable GCM_TABLE_4BIT (faster software GHASH) and
default to TLS 1.3 instead of requiring a manual edit to try it.

test_main.c: guser_PKCbInfo was only declared in the #else branch of
TLS_MULTITHREAD_TEST, but sce_test()'s CRYPT_TEST/BENCHMARK branches
use it unconditionally -- building with TLS_MULTITHREAD_TEST and
CRYPT_TEST/BENCHMARK together left it undeclared. Declare it
unconditionally; guser_PKCbInfo_taskA/taskB stay under
TLS_MULTITHREAD_TEST since only the TLS_CLIENT branch's per-task
connections use those.
2026-09-26 11:27:11 +09:00
Hideki Miyazaki
70e5eaabf7 Document RTT control block placement and add command-line tooling docs
Rewrite the SEGGER_RTT setup steps in README.md to add the
.txt.rtt_block section to the persistent script/fsp.ld instead of the
auto-generated fsp_gen.ld, which gets overwritten every time the FSP
Configurator regenerates project content. Note that build.bat now
prints the RTT control block address after a build.

Add script/fsp.ld for both the wolfssl and test projects (the
project's linker config looks for fsp.ld under ${ProjName}/script,
which didn't exist there before); test/script/fsp.ld additionally
defines the .txt.rtt_block section.

Add an Appendix section documenting build.bat and debug_run.bat usage.
2026-09-26 11:19:29 +09:00
Hideki Miyazaki
576fb21079 Add SCE hardware regression test for FSPSM AES-GCM AAD alignment fix
The portable aesgcm_misaligned_test() (wolfcrypt/test/test.c) sets a
plaintext key, so it never reaches wc_fspsm_AesGcmEncrypt()/Decrypt()
-- wc_fspsm_AesCipher() only dispatches to the SCE hardware path once
keyflgs_crypt.bits.aes*_installedkey_set is set by SCE_KeyGeneration().

Add sce_aesgcm_misaligned_test(), following the existing
sce_aesgcm128_test()/sce_aesgcm256_test() wrapped-key pattern, to
actually exercise the hardware with misaligned AAD/data at every byte
offset within a block, for both AES-128 and AES-256. Verified passing
on RA6M4 hardware.
2026-09-26 11:00:20 +09:00
Hideki Miyazaki
013314c6ea Regenerate RA6M4 SCE-signed CA signatures, fix ECC sizeof linkage
ca_cert_der_sign and ca_ecc_cert_der_sign are regenerated output of the
SCE-signing tool (tools/example_keys/generate_SignedCA.*) against the
current CA certs, so they no longer match the checked-in bytes.

Also drop the stray `static` on sizeof_ca_ecc_cert_der_sign so its
linkage matches sizeof_ca_cert_der_sign right above it; nothing in
this tree references either symbol from another translation unit yet,
but the RSA/ECC pair should behave the same way once something does.
2026-09-26 08:17:18 +09:00
JacobBarthelmeh
30b462553c prepare for release 5.9.4 2026-09-25 12:35:08 -06:00
Hideki Miyazaki
90cd207e72 Retry FreeRTOS_connect() on ETIMEDOUT/ENOTCONN in the multithread TLS client
The network stack (PHY link, ARP for the gateway) isn't necessarily
ready the instant a connection task starts, so a connect attempt made
too early fails with ETIMEDOUT(-116) or ENOTCONN(-128). The
non-multithreaded caller in test_main.c already retries around its own
wolfSSL_TLS_client_do() call for exactly this; TLS_MULTITHREAD_TEST's
per-task connections had no equivalent, so they'd fail outright instead
of retrying. Close and recreate the socket each attempt, since its
state after a failed connect isn't reusable.
2026-09-25 15:09:21 +09:00
Hideki Miyazaki
99c589233a Fix xTaskCreate() incompatible-pointer-types warning for wolfSSL_TLS_client_do
FreeRTOS's TaskFunction_t is "void (*)(void*)", but wolfSSL_TLS_client_do()
was declared/defined to always return int, and the non-multithread caller
in test_main.c uses that return code. Under TLS_MULTITHREAD_TEST, make it
return void instead (it already ends itself via vTaskDelete(NULL) rather
than returning a value there), matching TaskFunction_t exactly; keep the
int-returning definition for the non-multithread, direct-call path.
2026-09-25 15:04:58 +09:00
Hideki Miyazaki
e6cb565ab8 Avoid hanging on wc_GetTime() when flashed standalone (no debugger attached)
wc_GetTime()/time() resolves to ARM semihosting (_gettimeofday, from
librdimon, via --specs=rdimon.specs) on this board, which has no RTC.
Semihosting blocks forever unless an active debugger is servicing the
call -- fine under an e2studio GUI debug session, but hangs a target
flashed and run standalone (e.g. via debug_run.bat). asn_test()'s
wc_GetTime() call in CRYPT_TEST, and peer certificate date validation
in TLS_CLIENT, both hit this.

Register a wc_SetTimeCb() callback that derives a plausible "now" from
the build date/time (__DATE__/__TIME__), the same approach already
used in IDE/Renesas/e2studio/RX65N/GR-ROSE/common/wolfssl_dummy.c, so
it stays roughly current as the project keeps getting rebuilt instead
of a hand-maintained literal. Replace with a real RTC-backed callback
if wall-clock time is ever needed (e.g. real certificate expiry
checks).
2026-09-25 14:56:04 +09:00
Hideki Miyazaki
333f93cfe2 Add command-line build/flash tooling for RA6M4, and a Windows wrapper for generate_SignedCA.sh
- build.bat / debug_run.bat: build and flash+run the RA6M4 wolfssl/test
  e2studio projects from cmd.exe/PowerShell, mirroring the RX72N
  EnvisionKit Simple demo's existing batch tooling. debug_run.bat drives
  a real SEGGER J-Link via JLink Commander (unlike RX72N's RFP-based
  workaround) and prints the _SEGGER_RTT control block address after a
  successful build to save manually locating it for RTT Viewer.
- set_demo_mode.ps1: switch common/wolfssl_demo.h between CRYPT_TEST /
  BENCHMARK / TLS_CLIENT, matching the RX72N demo's mode switcher.
- tools/example_keys/generate_SignedCA.bat: Windows wrapper for
  generate_SignedCA.sh via Git for Windows' bash, with fixed RSA/ECC
  arguments.
- tools/README.md: document the above and correct a stale script name.
- include.am: list the new files for source distribution.
2026-09-25 14:42:52 +09:00
JacobBarthelmeh
42f6703e7a Merge pull request #11070 from philljj/sanity_session
ssl_sess: sanity test session cache save and restore.
2026-09-22 15:47:13 -06:00
jordan
5e8c85b489 ssl_sess: sanitize session cache save and restore, copy full session row, and add unit tests. 2026-09-21 15:16:48 -05:00
Paul Adelsbach
31a3520639 Address nightly failure in Azure Sphere 2026-09-17 10:43:25 -07:00
Eric Blankenhorn
b19c64b11b Fix from review 2026-09-17 07:27:17 -05:00
Eric Blankenhorn
96410fde25 MSVC: pass SP feature defines to ml64 for sp_x86_64_asm.asm 2026-09-17 07:18:29 -05:00
Hideki Miyazaki
6402269fdd Remove trailing whitespace from key_data.c
Fixes a PR build test (PRB) failure.
2026-09-17 14:52:45 +09:00
Hideki Miyazaki
3c247279d6 Fix silently-ignored failed clean in build.bat's wolfssl mode
Inside the "if defined FORCE_WOLFSSL_REBUILD (...)" block, %ERRORLEVEL%
was expanded once when the block was parsed -- before "%MAKE%" clean had
even run -- so it always read the value from before the block (0),
letting a failed clean go undetected and the build continue from a
partially cleaned tree. Verified by reproducing with a stand-in "make"
that fails on "clean": the old check silently proceeded to build "all"
regardless; "if errorlevel 1" (tested at the current point, not
text-substituted at parse time) plus a literal exit code catch it
correctly.
2026-09-17 14:50:47 +09:00
Hideki Miyazaki
db486694cd Document build.bat/debug_run.bat in README_EN/README_JP
Adds a brief appendix pointing to the command-line build/flash scripts as
an alternative to driving e2studio interactively.
2026-09-17 12:17:39 +09:00
Hideki Miyazaki
5041aabc01 Fix zero-length payload/AAD handling in TSIP AES-GCM
wc_tsip_AesGcmEncrypt() allowed sz == 0 and authInSz == 0 in its own
argument validation, but then unconditionally allocated plainBuf (sized
sz) and aadBuf (sized authInSz) via XMALLOC and treated a NULL result as
an allocation failure. XMALLOC(0, ...) is implementation-defined and may
legitimately return NULL, so a valid empty payload or empty AAD could
fail depending on allocator behavior rather than on the actual inputs.
wc_tsip_AesGcmDecrypt() has the same problem for authInSz == 0 (its
sz == 0 case is already rejected by validation, by design, so it never
reaches a zero-size allocation there).

Skip allocating (and later copying into) plainBuf/aadBuf when their
size is 0, and only require them non-NULL in that case, so the
zero-length case no longer depends on what the platform's allocator
returns for a zero-byte request.

Add tsip_aesgcm_zerolen_test() to wolfssl_tsip_unit_test.c covering
empty payload with non-empty AAD (encrypt-only, since TSIP decrypt
rejects sz == 0 by design), non-empty payload with empty AAD
(full encrypt/decrypt round trip), and both empty together.
2026-09-17 12:09:29 +09:00
Hideki Miyazaki
f08691a5ac Drop the unused OPENSSL_EXTRA define from user_settings.h 2026-09-17 12:05:35 +09:00
Hideki Miyazaki
13df5adeb1 Regenerate cached CA certificate signature arrays in key_data.c 2026-09-17 10:59:15 +09:00
Hideki Miyazaki
f58ffe232e Match demo-mode macros with a regex in set_demo_mode.ps1
Comment whitespace varies between macros (e.g. "/* #define CRYPT_TEST */"
vs "/*#define BENCHMARK*/"), which a literal string replace can't handle.
2026-09-17 10:59:15 +09:00
Hideki Miyazaki
1defce3b5d Add a restart mode to debug_run.bat
Lets the already-flashed target be reset and rerun via rfp-cli without
going through the slower erase/program/verify cycle.
2026-09-17 10:59:15 +09:00
Hideki Miyazaki
7de4a6ef90 Add BusyBox to PATH and a wolfssl-only rebuild mode to build.bat
Generated makefiles call BusyBox sed/rm directly, and edits to shared
headers like user_settings.h don't trigger incremental rebuilds, so
build.bat needed both a fix and a fast path to force-rebuild just the
wolfSSL-dependent sources.
2026-09-17 10:59:14 +09:00
Hideki Miyazaki
100f1a6a67 Link src/x509.c into the wolfssl e2studio project
It was missing from the project's linked resources, so it never got
compiled; wolfssl.rcpc (the e2studio project record) picks up the same
addition plus a couple of unrelated toolchain/build-option updates it
already carried.
2026-09-17 10:59:14 +09:00
David Garske
ba1797509d Key the STM32CubeMX2 configuration off a macro the pack declares 2026-09-15 17:42:11 -07:00
JacobBarthelmeh
fad92fa095 Merge pull request #11399 from night1rider/ecies-dev-id-change
Ecies dev id change
2026-09-15 14:31:49 -06:00