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

959 Commits

Author SHA1 Message Date
Paul Adelsbach
44e523ce48 CI: extend trackmemory timeouts based on recent runtimes 2026-10-23 14:26:03 -07:00
philljj
06d4408d87 Merge pull request #11799 from padelsbach/swdev-falcon
Tests: add Falcon to swdev for crypto cb testing
2026-10-22 22:30:20 -05:00
philljj
ad48539fde Merge pull request #11688 from dgarske/mpfs_athena
Add Microchip PolarFire SoC Athena F5200 (TeraFire) crypto callback port
2026-10-22 10:27:36 -05:00
Tobias Frauenschläger
58dacab52a Merge pull request #11841 from MarkAtwood/ci/socat-expect-fail-flakes
ci(socat): expect-fail 4 flaky non-TLS tests.

Jenkins failure is unrelated.
2026-10-22 08:25:53 +02:00
kaleb-himes
18c76cb584 Build the AMD APERF wolfEntropy timer in the trackmemory CI job 2026-10-21 22:21:07 -07:00
Paul Adelsbach
94b375ec9d Tests: add Falcon to swdev for crypto cb testing 2026-10-21 17:13:12 -07:00
Mark Atwood
6674166407 ci(socat): expect-fail 4 flaky non-TLS tests 2026-10-21 09:55:10 -07:00
David Garske
41d6398556 Add Microchip PolarFire SoC Athena F5200 crypto callback port 2026-10-21 09:37:55 -07:00
philljj
b0afe82085 Merge pull request #11238 from padelsbach/crypto-cb-frodo
Add crypto callback for Frodo-kem
2026-10-21 10:31:26 -05:00
philljj
4b4e21ad23 Merge pull request #11812 from douzzer/20261019-kernel-cryptonly-default
20261019-kernel-cryptonly-default
2026-10-21 08:23:22 -05:00
Andrew Hutchings
9d28f4e99c Turn off objtool for linuxkm PIE CI builds
On the ubuntu-24.04 runner image with kernel 7.0.0-1017-azure, every
--enable-linuxkm-pie build fails with:

  libwolfssl.o: error: objtool: wc_HmacSizeByType+0x55: unannotated
  intra-function call

PIE builds use -mindirect-branch=thunk-inline, whose inline retpolines
are calls to a label inside the same function. On 7.0 objtool checks
the linked libwolfssl.o, which ignores OBJECT_FILES_NON_STANDARD, and
rejects them. The same builds pass on the older 6.17 runner kernel, so
the failure depends on which image a job lands on.

Pass KBUILD_EXTRA_FLAGS=FORCE_GLOBAL_OBJTOOL_OFF=1 for the PIE builds
in the Membrowse linuxkm-pie target and the Kernel Module Build
workflow. linuxkm/Kbuild then undefines CONFIG_OBJTOOL, which disables
all objtool passes since the kernel's objtool rules are gated on it.
Non-PIE builds keep objtool.
2026-10-20 18:18:36 +01:00
Andrew Hutchings
0a7dda2e9b Pin membrowse-action to v1.2.15 in Membrowse workflows
membrowse-action v1.2.16 moved the floating v1 tag to a release whose
action.yml has "${{ github.workspace }}" in an input description. The
runner rejects the github context there, so every Membrowse analyze job
fails in "Set up job" with "Unrecognized named-value: 'github'". The
onboard action has the same problem, and the comment workflow then
fails because no report was uploaded.

Pin the report, onboard and comment workflows to the v1.2.15 commit SHA,
the last release that worked, as the Zephyr workflow already does.
2026-10-20 17:59:34 +01:00
Daniel Pouzzner
30d3d425cf .github/membrowse-targets.json, .github/workflows/linuxkm.yml: add a couple missing --disable-cryptonlys. 2026-10-19 15:49:53 -05:00
Daniel Pouzzner
00dc4c1317 configure.ac: change default ENABLED_CRYPTONLY to follow $KERNEL_MODE_DEFAULTS
-- i.e., by default, disable the TLS/DTLS layer when KERNEL_MODE_DEFAULTS;

CMakeLists.txt: add WOLFSSL_KERNEL_SETTINGS and make existing
  WOLFSSL_LINUXKM_DEFAULTS an alias for it, and make WOLFSSL_CRYPT_ONLY default
  follow WOLFSSL_KERNEL_SETTINGS via new internal variable
  WOLFSSL_CRYPT_ONLY_DEFAULT;

.github/workflows/linuxkm.yml: explicitly --disable-cryptonly in the
  --enable-all scenario;

.github/workflows/fips-dev-no-post.yml: explicitly --disable-cryptonly in the
  kernel-settings* scenarios.
2026-10-19 15:04:08 -05:00
Paul Adelsbach
4729b8994c PR feedback: add Frodo coverage in swdev, allow separate make/encapsulate/decapsulate testing individually 2026-10-16 16:03:31 -07:00
Paul Adelsbach
57b999a588 Add crypto callback for Frodo-kem 2026-10-16 16:03:31 -07:00
Tobias Frauenschläger
bc9c079025 Generate wolfIP test certificates before the parallel build
wolfIP releases up to v1.1.0 have three Makefile rules that each run
tools/certs/mkcerts.sh, one per generated cert source. Under make -j
they run concurrently and clobber each other's files, leaving
server_cert.c without server_der, so build/test-wolfssl intermittently
fails to link. On the latest-release leg the job then asks for a
breaks-wolfip= token although wolfSSL broke nothing.

Run mkcerts.sh once before make so the cert sources already exist.
This stays harmless once wolfIP serializes the rule itself, and keeps
the released tags, which will never get that fix, building reliably.
The script is only run when present so a later wolfIP layout change
cannot fail the job here.
2026-10-16 13:25:53 +02:00
philljj
eb113cac67 Merge pull request #11547 from padelsbach/cbonly-lmsxmss
Add CB_ONLY mode for LMS+XMSS, add swdev
2026-10-15 17:01:48 -05:00
Emma Stensland
50491a51b4 Build ML-DSA small-mem under fault hardening in the stack-size run 2026-10-14 13:48:09 -07:00
Emma Stensland
aa6c5b7e69 Fix ML-DSA small-mem scratch alignment 2026-10-14 13:48:09 -07:00
Tobias Frauenschläger
3699b3fbd0 Falcon: run the white-box with the 32-bit fpr shift helpers
The fpr shift helpers have a separate implementation for targets
without WC_64BIT_CPU, which no CI job built. Add a smallest-mem leg with
-DWC_32BIT_CPU so the white-box exercises it.
2026-10-14 09:15:37 +02:00
Tobias Frauenschläger
f60510d63b Falcon: keep the verify buffer off the stack
falcon_native_verify_msg placed its 2*n word16 working buffer on the stack
unless WOLFSSL_SMALL_STACK was set. That buffer is sized for the highest
enabled level, so a Falcon-512 verify used 4 KB of stack for it whenever
Falcon-1024 was built in, and verify reached about 5.7 KB of stack on a
Cortex-M33/M7 while keygen and sign stay near 1.2-1.4 KB.

Verify now allocates the buffer per call, sized for the key's own level
(2 KB for Falcon-512, 4 KB for Falcon-1024), so it can return MEMORY_E;
the wc_falcon_verify_msg documentation says so. WOLFSSL_NO_MALLOC builds
keep the buffer on the stack. To keep it off the stack without an
allocator, WOLFSSL_FALCON_VERIFY_NO_MALLOC
(--enable-falcon=verify-no-malloc) holds the buffer in falcon_key
instead, sized for the highest enabled level, the same approach as
WOLFSSL_MLDSA_VERIFY_NO_MALLOC. With it, a key verifies one signature at
a time and falcon_key grows by 4*FALCON_MAX_N bytes.

On an STM32H743 a Falcon-512 verify goes from 5648 B of stack and no heap
to 1568 B of stack and 2048 B of heap, at the same speed. The peak stack
of a TLS 1.3 handshake that verifies a Falcon-512 chain drops from 6.3 KB
to 3.7 KB.

The falcon-interop backend matrix gains verify-no-malloc and
level1+dynamic-keys+verify-no-malloc legs running the full unit suite.
2026-10-14 09:15:37 +02:00
Paul Adelsbach
122d7ecc5d PR feedback: block GetKid when privKey is not set, add test case and entry for CI 2026-10-13 10:35:14 -07:00
Paul Adelsbach
aaf8741097 PR feedback: add tests for unavailable callback 2026-10-13 10:35:14 -07:00
Paul Adelsbach
01fe1f94ff Add CB_ONLY mode for LMS+XMSS, add swdev 2026-10-13 10:35:14 -07:00
Tobias Frauenschläger
46e7f0f661 Isolate the FIPS dev-no-POST make check runs with bwrap
fips-dev-no-post.yml runs seven configs through parallel-make-check.py,
four at a time, but never installed bubblewrap. The test scripts only
re-exec under bwrap --unshare-net when it is present, so every unit.test
shared the runner's network namespace.

test.h binds its listeners with SO_REUSEADDR and SO_REUSEPORT. With
those set, a Linux UDP bind to port 0 can return a port another process
already holds, and the DTLS server rebinds its port for each resumption.
A client's ClientHello can then reach another config's DTLS server,
which answers with a fatal alert, e.g. a DTLS 1.2 -r pair failing with
"wolfSSL_connect resume error -313" while every API test passed.

Install bubblewrap and lift the AppArmor userns restriction, as the
other parallel make check workflows already do. The job installs from
the ubuntu-24.04-linuxkm bundle, so add bubblewrap to its package set
too; until that bundle is rebuilt the job falls back to the apt mirror.
2026-10-13 12:35:50 +02:00
David Garske
f99453320f Merge pull request #11042 from aidangarske/agilex5-fcs-port
Add Altera Agilex 5 SDM crypto offload port
2026-10-12 08:25:33 -07:00
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
Mattia Moffa
df41dfa4cd Merge pull request #11349 from aidangarske/downstream-wolfcose-wolfip-ci
Add wolfCOSE and wolfIP compatibility checks
2026-10-08 19:26:32 +02:00
Sean Parkinson
39331d5c51 Configuration options: add --enable-enterprise
Add an enterprise option that includes all items that would be required.

Update CMake build to match autotools. Added enterprise option.

Added CI loops for configuration options.

Add document that maps the OpenSSL configuration options to wolfSSL's.
Checked against various versions of OpenSSL.
2026-10-08 18:22:27 +10:00
Sean Parkinson
a09c2ee1cc Merge pull request #11667 from padelsbach/ci-hostap-key-len
CI: address flaky path in hostap workflow
2026-10-08 08:35:24 +10: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
Sean Parkinson
913adefc1f Merge pull request #11624 from padelsbach/ci-pkg-download
CI: drop NetXDuo install.sh from the ThreadX build for performance
2026-10-07 11:12:51 +10:00
Sean Parkinson
dc49262d5e Merge pull request #11498 from julek-wolfssl/openresty-1.31.1.1
Add OpenResty 1.31.1.1 support and CI
2026-10-07 10:52:05 +10:00
Sean Parkinson
ec9f14bc4e Merge pull request #11569 from Frauschi/mldsa_mem
Reduce ML-DSA small memory RAM use and add WOLFSSL_MLDSA_SIGN_SMALLEST_MEM
2026-10-07 10:15:14 +10:00
Paul Adelsbach
15e449f580 CI: address flaky path in hostap workflow 2026-10-06 12:49:04 -07:00
Tobias Frauenschläger
198b09a093 Transform each polynomial of y once when signing with small memory
Small memory signing walked matrix A a row at a time and copied and
transformed the polynomial of y it needed for every element of the row.
Each polynomial of y was therefore transformed k times with an identical
result: 156 transforms per ML-DSA-65 signature where 31 are needed.

Walk the matrix a column at a time instead. Every row of the matrix uses
the same column of y, so the transform is done once and the products are
accumulated down the column into w0, which is already a vector of k
polynomials. Inverting, decomposing and encoding then run as a second
pass over the rows, with w0 replaced in place and the scratch polynomial
holding w1. w is reduced before the inverse transform on both column
accumulating paths.

Vector y stays resident, so unlike the smallest memory implementation
this does not have to regenerate it, and it keeps generating y as a whole
vector so the assembly generators are still used.

With WOLFSSL_MLDSA_SIGN_SMALL_MEM_PRECALC_A the pre-calculated rows are
multiplied as a vector, and w is sized for all k rows: the ML-DSA-44
decompose kernels take no dimension and touch every row, so the rows above
the pre-calculated ones are cleared, and mldsa_vec_encode_w1() now honours
the dimension it is given. The whole-vector helpers that path drives are
gated on a new MLDSA_SIGN_VEC_HELPERS, which names the set of callers.
Under WC_MLDSA_FAULT_HARDEN the column loop checks that the polynomial of
y it reads, walked independently of the column index, lies inside y.

Memory is unchanged: w0 was already held for the hints and the row
accumulator becomes the scratch the transform runs in.
WOLFSSL_MLDSA_SMALL_MEM_POLY64 no longer applies to signing as a 64-bit
accumulator would now be needed for every row of w, which also returns
the 2KB it was allocating. The option now only affects small memory key
generation and verification; the option list says so.

Signatures are unchanged. Signing is 12 to 29 percent quicker with the C
code and 6 to 12 percent quicker with AVX-512, which makes it faster than
the smallest memory implementation on every target rather than only where
the assembly runs. Add pq-all rows for PRECALC_A split part way, saturated
past k, and on the Intel assembly paths, and a -Wconversion row.
2026-10-06 16:07:38 +02:00
Tobias Frauenschläger
487f673556 Reduce ML-DSA small memory heap use and add a smallest memory signer
Small memory signing kept vector w1 as k full polynomials although it is
only ever consumed in its encoded form, once by the commit hash and once
by MakeHint, which only tests each coefficient for zero. Keep the encoded
w1 and build it a polynomial at a time from a single scratch polynomial
of w. This also removes the separate w1 encode buffer that was allocated
and freed on every rejection attempt.

Add WOLFSSL_MLDSA_SIGN_SMALLEST_MEM. It generates matrix A a column at a
time so that one polynomial of y is held instead of the whole vector and
is transformed once rather than once per row, decomposes w into w0 in
place, and regenerates y for the z calculation. It cannot be combined with
the PRECALC options, and WOLFSSL_MLDSA_SMALL_MEM_POLY64 has no effect on
signing in this mode. The z polynomial, which is not live at either
expansion, serves as the mask expansion scratch, so the signer makes one
allocation per signature.

Because y is derived twice per rejection round, bind the two derivations:
each polynomial of y is checksummed when it is first expanded and checked
when it is regenerated for z, and a mismatch fails with BAD_COND_E rather
than producing z from a different mask than the commitment used. The
checksum is a pair of Fletcher style sums, which catch any change to one
or two coefficients of a y polynomial without multiplying the secret
coefficients, as a multiply chain is not constant time on every core. The
checksums are zeroized on return. The key's SHAKE object, whose last use
regenerates a polynomial of y and would otherwise leave rho'' recoverable
from the key, is re-initialized, which clears its state but keeps the hash
type a crypto callback free needs.

Small memory key generation held t as a full vector for one final vector
encode. Encode t a polynomial at a time and overlay t and the single
decoded s2 polynomial on the s2 vector, which is dead once s2 has been
encoded into the private key.

Peak heap, in bytes, measured with a counting allocator:

                  sign before   sign after   smallest   keygen before   after
  ML-DSA-44            16200        13896       9800           14152   10056
  ML-DSA-65            21320        16968      11848           19272   13128
  ML-DSA-87            27464        21320      14152           25416   17224

Signatures are unchanged. Add a signing KAT to testwolfcrypt: signing is
deterministic given the key seed and the signing seed, so every signer must
produce the same bytes, and the test compares a SHAKE-256 digest of the
signature with the default signer's. tests/api holds full signing KATs,
but unit.test is not built in the --enable-cryptonly CI rows that cover
the small and smallest memory signers.

Problems found while making these changes are fixed here too:

- mldsa_vec_expand_mask dispatched to AVX2 generators that only handle
  dimensions 4, 5 and 7, and silently left y untouched for any other
  dimension. Test the dimension before saving the vector registers and
  fall through to the C implementation otherwise.
- WOLFSSL_MLDSA_SIGN_SMALL_MEM_PRECALC_A greater than k indexed A, w0
  and w1 past their allocations, as the loops used the raw macro rather
  than min(macro, k).
- WOLFSSL_MLDSA_SIGN_CHECK_W0 passed two arguments to the three argument
  mldsa_vec_check_low, so the option never compiled with small memory
  signing.
- WOLFSSL_MLDSA_VERIFY_SMALLEST_MEM did not build alongside small memory
  signing, as mldsa_vec_ntt_full and mldsa_vec_check_low were unused.
- WOLFSSL_MLDSA_VERIFY_SMALLEST_MEM sized z at l polynomials while only
  ever using one.

Add pq-all and -Wconversion CI rows for the smallest memory signer, with
and without the y and w0 checks and verification.
2026-10-06 16:07:38 +02:00
Paul Adelsbach
8528f08a30 Address CI failure and note that swdev.c needs updating as a future improvement 2026-10-05 15:34:57 -07:00
Paul Adelsbach
02d796129d Add CB_ONLY mode for ML-DSA 2026-10-05 15:28:26 -07:00
philljj
3136f17a93 Merge pull request #11212 from padelsbach/cbonly-mlkem
Add CB_ONLY mode for ML-KEM
2026-10-05 16:17:33 -05:00
Aidan Garske
e239fb36d6 Merge upstream master into Agilex 5 FCS port 2026-10-05 11:24:14 -07:00
JacobBarthelmeh
a592403878 Merge pull request #11445 from dgarske/nuvoton_m2354_cryptocb
Add wolfCrypt port for the Nuvoton NuMicro M2354
2026-10-05 09:23:32 -06:00
David Garske
cd6acb72ab Encode certificate names and extensions without an allocator 2026-10-04 22:52:10 -07:00
David Garske
1e23853f18 Add a wolfCrypt-only CMake option and fix stray defines in options.h 2026-10-04 22:52:10 -07:00
philljj
8d77c82285 Merge pull request #11618 from padelsbach/ci-reseed-skip
CI: ccache reseed optimization
2026-10-04 21:56:17 -05:00
Paul Adelsbach
44c5d0017a PR feedback: cryptocb find handling, remove TLS requirement, test issue, windows arm64 asm 2026-10-02 20:34:35 -07:00
Paul Adelsbach
4628df01f0 Add CB_ONLY mode for ML-KEM 2026-10-02 20:34:35 -07:00
David Garske
0392f764d8 Add Nuvoton NuMicro M2354 crypto callback port 2026-10-02 15:59:07 -07:00
JacobBarthelmeh
57502e3ded Merge pull request #11199 from dgarske/sec_qoriq
Add NXP QorIQ SEC (CAAM) hardware crypto port for PowerPC T-series
2026-10-02 14:55:35 -06:00