Commit Graph

30297 Commits

Author SHA1 Message Date
Sean Parkinson ad85f49926 Thumb2 X25519: Fix to do full reduction
This fix when into ARM32 assembly it is now being added to Thumb2 assembly.
Full reduction to ensure the number is in range at end of work.
2026-06-18 20:34:11 +10:00
JacobBarthelmeh 633784e91b Merge pull request #10714 from Frauschi/zd21992_2
Some more fixes
2026-06-17 17:34:15 -06:00
JacobBarthelmeh 3f9ae22010 Merge pull request #10709 from douzzer/20260616-aes-fixes
20260616-aes-fixes
2026-06-17 15:58:23 -06:00
David Garske 877208c2fb Merge pull request #10701 from julek-wolfssl/ci-drop-apt-deps-cache
CI: install all apt deps from ghcr bundles, drop actions/cache apt-deps layer
2026-06-17 13:29:00 -07:00
JacobBarthelmeh 59295869dc Merge pull request #10715 from lealem47/amdseed_force_fail
configure: avoid entropy fallback for AMD RDSEED in FIPS builds
2026-06-17 13:26:13 -06:00
JacobBarthelmeh aec9b202c9 Merge pull request #10702 from Frauschi/zd21992
Various fixes
2026-06-17 13:22:05 -06:00
Daniel Pouzzner 881fe769a3 wolfcrypt/src/aes.c, wolfcrypt/test/test.c: use WOLFSSL_MAX_32BIT rather than magic 0xffffffff;
wolfcrypt/test/test.c: in aesgcm_stream_test(), implement tests for sSz overflow, and in aesccm_128_badarg_test(), fix line length.
2026-06-17 13:55:10 -05:00
Daniel Pouzzner 9d15bc707c wolfcrypt/src/aes.c, wolfcrypt/src/port/caam/caam_aes.c, wolfcrypt/src/port/riscv/riscv-64-aes.c, wolfcrypt/src/port/silabs/silabs_aes.c, wolfcrypt/src/port/ti/ti-aes.c: implement AES-CCM counter overflow checks for ports;
wolfcrypt/test/test.c: add missing !HAVE_SELFTEST gate around AES-CCM counter overflow test in aesccm_128_badarg_test();

wolfcrypt/src/error.c and wolfssl/wolfcrypt/error-crypt.h: update messages for AES_{GCM,CCM}_OVERFLOW_E.
2026-06-17 13:18:46 -05:00
Tobias Frauenschläger dedba75ad4 Reject duplicate certificatePolicies extension in WOLFSSL_CERT_EXT builds
DecodeExtensionType() guarded the certificatePolicies duplicate check
(VERIFY_AND_SET_OID) under WOLFSSL_SEP only, because the extCertPolicySet
tracking bit was SEP-only. In a WOLFSSL_CERT_EXT-without-WOLFSSL_SEP build a
cert with two certificatePolicies extensions was accepted and the second
silently overwrote the first (RFC 5280 4.2 forbids repeats). Make the bit and
the guard available under WOLFSSL_CERT_EXT too, matching every other
non-repeatable extension.

Add test_DecodeCertExtensions_dup_certpol (DecodeExtensionType now
WOLFSSL_TEST_VIS).
2026-06-17 19:14:21 +02:00
Tobias Frauenschläger 8e5be42a9d Fix !aNULL/!eNULL to drop explicitly-listed anonymous/NULL cipher suites
ParseCipherList() only cleared the InitSuites mask for "!aNULL"/"!eNULL",
which governs generated defaults, so an explicitly listed ADH or NULL-cipher
suite survived (e.g. "ADH-AES128-SHA:!aNULL" still offered an unauthenticated
suite). Scrub the explicit suites after parsing; exclusions are order-
independent and sticky (a later "ALL" cannot re-enable them).

Add test_wolfSSL_set_cipher_list_exclusions.
2026-06-17 19:14:07 +02:00
Lealem Amedie a3ca9e1dfa Fix FORCE_FAILURE_RDSEED case guard 2026-06-17 11:12:55 -06:00
Daniel Pouzzner 1070384034 wolfcrypt/src/aes.c and wolfcrypt/test/test.c: fixes from review, re "catch and error on total length overflow". 2026-06-17 12:01:06 -05:00
Daniel Pouzzner 5def276e07 wolfcrypt/src/aes.c: catch and error on total length overflow in wc_AesGcmEncryptUpdate(), wc_AesGcmDecryptUpdate(), wc_AesCcmEncrypt(), and wc_AesCcmEncrypt(). 2026-06-17 12:01:06 -05:00
JacobBarthelmeh 9d60981071 Merge pull request #10695 from philljj/bsdkm_fixes
Bsdkm driver cleanup
2026-06-17 10:54:32 -06:00
Tobias Frauenschläger 160b3179a1 Add regression tests for various d2i_* methods 2026-06-17 18:44:11 +02:00
JacobBarthelmeh 7aed5ac316 Merge pull request #10698 from Frauschi/slhdsa_fixes
SLH-DSA fixes
2026-06-17 10:36:58 -06:00
Lealem Amedie a593fbe90c configure: avoid entropy fallback for AMD RDSEED in FIPS builds 2026-06-17 09:45:20 -06:00
Juliusz Sosinowicz d3659c74fd CI: move Arduino cores from actions/cache to ghcr bundles
arduino.yml's per-core actions/cache layer stored the installed cores and
toolchains (~/.arduino15) - several GB, dominated by the esp32 and mbed
cores - in the 10 GB Actions cache. For esp32 it was also ineffective: the
disk-cleanup step deletes the esp32 toolchain before actions/cache saves it,
so esp32 re-downloaded every run anyway.

- New arduino-cores-image workflow resolves each of the 9 distinct cores and
  publishes a tar of ~/.arduino15 + ~/Arduino/libraries to
  ghcr.io/<owner>/wolfssl-ci-arduino:<core>. It runs monthly: esp32, the
  fastest-moving core, releases ~monthly and the rest far less often.
- New install-arduino-core composite action restores that bundle offline and
  verifies the core is present, falling back to `arduino-cli core install`
  when the bundle is unavailable - so nothing breaks until the image is first
  published and made public.
- arduino.yml calls the action in place of the inline core install and the
  actions/cache step.

This takes the flaky espressif / esp8266.com / pjrc.com downloads off the PR
critical path and frees the Actions cache of the largest binaries it held.
2026-06-17 09:29:48 +00:00
Juliusz Sosinowicz 94a671bed8 CI: disable setup-alire's cache in the Ada workflow
setup-alire@v5 caches the gnat_native+gprbuild toolchain via actions/cache
(key alr[1][2.1.0][...]), holding ~1.26 GiB - 3x the 428 MiB toolchain, one
copy per ref - against the repo's 10 GiB cache cap. On a miss the toolchain
is only a ~17s pull from github.com (alire-project releases), so the cache
saved ~20-30s on a ~6.5min Ada job (dominated by gnatprove). Not worth the
space; install it fresh each run.
2026-06-17 09:29:48 +00:00
JacobBarthelmeh 6ff1f8f2b8 Merge pull request #10705 from cconlon/tsipMemFix
Renesas TSIP: skip XMEMCPY on MEMORY_E from tsip_StoreMessage()
2026-06-16 16:14:54 -06:00
JacobBarthelmeh e6f02ecf4d fix for clang-tidy warning on variable not read 2026-06-16 16:09:42 -06:00
Chris Conlon 6ebc379f31 Renesas TSIP: skip XMEMCPY on MEMORY_E from tsip_StoreMessage() 2026-06-16 13:58:52 -06:00
Tobias Frauenschläger eaa563419e BIO: reject negative length in memory BIO read
Reject a negative read length in the memory BIO read path so it cannot bypass
the signed bounds checks and reach a wild copy. Adds a regression test.
2026-06-16 20:56:45 +02:00
Tobias Frauenschläger 8f55480a1d SP math: validate ECDH shared-secret output buffer against the field size
Regenerate the SP backends so the ECDH secret generators check the caller's
buffer against the number of bytes actually written. Adds a P-384/P-521
buffer-size regression test.
2026-06-16 20:56:45 +02:00
Tobias Frauenschläger f23544f094 TLS 1.3: fix for post-handshake authentication
Only exempt the missing-certificate check during the initial handshake; once a
post-handshake CertificateRequest is outstanding the server again requires the
client certificate (and its CertificateVerify). Adds a post-handshake auth
test.
2026-06-16 20:56:45 +02:00
Tobias Frauenschläger c929798460 TLS: validate negotiated certificate type for raw public keys
Ensure a peer's certificate form (X.509 vs raw public key) matches the
negotiated certificate type, defaulting to X.509 when none was negotiated,
on both the client and server. Adds RPK regression tests covering both
directions.
2026-06-16 20:31:36 +02:00
Tobias Frauenschläger 3e30e69c35 certman: enforce keyCertSign usage on chain-supplied intermediate CAs
Require the keyCertSign key usage on non-root intermediate CAs added during
path building when a KeyUsage extension is present, per RFC 5280. Adds a
regression test.
2026-06-16 20:31:36 +02:00
Tobias Frauenschläger d382439c7c PKCS7: tighten signature presence check in PKCS7_verify
Ensure a signer signature is actually verified before reporting a
PKCS7 SignedData object as verified, and add a regression test.
2026-06-16 20:19:22 +02:00
Juliusz Sosinowicz cfbfecb1bc CI: fail the linuxkm bundle build on any download error
Addresses PR review feedback. The kernel-tracking linuxkm bundle treated a
failed --download-only as a warning and still published, so a transient
mirror error could ship a partial bundle. Because the daily job skips
rebuilds while the kernel label matches, such a partial bundle would
persist until the kernel next changes (~monthly), forcing consumers to fall
back to apt the whole time.

The linuxkm set is small and entirely required, so resolve it as one
closure and let a failure fail the job; we push only on success, so the
last good bundle stays in place. The static -full/-minimal bundles keep
their per-package skip-and-warn - they serve many independent consumer
subsets and rebuild weekly, so maximizing coverage is the right trade-off
there.
2026-06-16 16:33:12 +00:00
Juliusz Sosinowicz 06e4ec9fe3 CI: install all apt deps from ghcr bundles
Extends the ghcr offline-install path to every install-apt-deps consumer
that was still on plain apt, and publishes the bundles they need.

New bundles built by ci-deps-image:
- ubuntu-24.04-embedded: the membrowse ARM cross-toolchain (~0.5 GB), kept
  out of -full so it does not bloat the interop workflows' pull.
- ubuntu-24.04-linuxkm: linux-headers-$(uname -r) + the kernel-module build
  toolchain. linux-headers tracks the runner's running kernel, so a daily
  job rebuilds it only when uname -r changed (recorded as an image label);
  a mismatch during a runner-image rollout just falls back to apt.

Consumers now passing ghcr-debs-tag:
- sssd -> ubuntu-24.04-full (its deps added to that list)
- hostap-vm -> ubuntu-22.04-full (its deps added to that list)
- membrowse targets -> ubuntu-24.04-embedded; the two linuxkm targets ->
  ubuntu-24.04-linuxkm (new per-target matrix.ghcr_tag)
- linuxkm.yml -> ubuntu-24.04-linuxkm (pinned to ubuntu-24.04 so the
  bundle's headers match the runner kernel)

Each consumer still falls back to apt when its bundle is unavailable, so
nothing breaks until ci-deps-image first publishes the new tags.
2026-06-16 15:22:36 +00:00
Tobias Frauenschläger 266e07e58d SLH-DSA: zeroize secret WOTS+/FORS material and fix alloc-failure paths
Zeroization:
- Add missing ForceZero on the PRF outputs and WOTS+ chain state that hold
  secret key material.
- Route the WOTS sign leaf through a temp so secret chain values never touch
  the public signature buffer.
- Add SLHDSA_SHAKE_X4_STATE_W so buffer and wipe sizes stay in sync.

Leak / alloc-failure fixes:
- Fix chain_idx_x4 returning on SAVE_VECTOR_REGISTERS2 failure without freeing
  state/fixed (memory leak, and the secret was left unzeroized); break to the
  cleanup path instead.
- Guard all function-scope wipes with WC_VAR_OK to avoid a NULL deref when an
  allocation fails under WOLFSSL_SMALL_STACK.
2026-06-16 15:48:39 +02:00
Juliusz Sosinowicz 2f50f8c968 CI: drop actions/cache apt-deps layer from install-apt-deps
The ci-cache-offload work added a ghcr .deb bundle path to
install-apt-deps, making the actions/cache apt-archive layer redundant.
Remove it so no apt-deps-* cache entries are produced. Apt packages now
install either offline from the ghcr bundle (when ghcr-debs-tag is set)
or via plain apt-get with the existing retry/backoff.

- Strip the Compute/Restore/Pre-seed/Collect/Save cache steps and the
  cache-hit fast path; drop the now-unused 'cache' input.
- Update callers that passed 'cache': membrowse-onboard, membrowse-report
  (and the apt_cache matrix key in membrowse-targets.json), and sssd.

The ghcr offline path and the ccache actions/cache usage are untouched.
2026-06-16 10:52:07 +00:00
jordan c761755add bsdkm driver: tiny cleanup. 2026-06-16 00:25:59 -05:00
jordan 7cffbb6240 bsdkm driver: cleanup switch default. 2026-06-15 23:19:46 -05:00
jordan 6bfbf19721 bsdkm driver: cleanup. 2026-06-15 23:14:57 -05:00
David Garske c685293c92 Merge pull request #10685 from julek-wolfssl/ci-cache-offload
CI: offload ccache/apt/buildx caches off the GitHub Actions cache
2026-06-15 18:35:12 -07:00
David Garske 70883a4ead Merge pull request #10692 from JacobBarthelmeh/fuzz
additional sanity check on alert message size
2026-06-15 18:27:58 -07:00
JacobBarthelmeh 68422e84de additional sanity check on alert message size 2026-06-15 16:49:54 -06:00
Juliusz Sosinowicz 634ac9b6da CI: align branch-introduced actions with master's Node.js 24 bump
Rebasing onto master (which migrated JS actions to Node.js 24 runtimes)
left a few action refs that this branch added in new steps still on the
old major versions. Bring them in line with master:

- ccache-setup read-only restore:   actions/cache/restore@v4 -> @v5
- smoke-test / os-check ccache save: actions/cache/save@v4    -> @v5
- ci-deps-image checkout:            actions/checkout@v4       -> @v5
2026-06-15 22:39:56 +00:00
Juliusz Sosinowicz b8c008f3ac CI: address Skoll review (reseed coverage, ghcr owner, restore key)
- os-check.yml linux shard: add a schedule-gated CCACHE_RECACHE=1 step so
  the weekday seed reseeds from clean compiles rather than only accumulating
  deltas. This shard manages ccache directly (its own restore/save) and so
  was not covered by the ccache-setup composite's reseed.
- install-apt-deps: hardcode the ghcr bundle owner to wolfssl. The bundle is
  only published under ghcr.io/wolfssl by ci-deps-image, so fork PRs now read
  the public upstream image instead of a nonexistent ghcr.io/<fork>/wolfssl-ci-debs.
- ccache-setup: document that the read-only restore key reuses the save
  key shape for symmetry and is never an exact hit by design.

Skoll F3 (a packages-subset-of-bundle CI guard) is deferred to a follow-up;
F4 (release-branch ccache saves) is left as the intended seed-on-schedule /
everything-else-reads model.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 80a3e67ba3 CI: clarify ccache/apt-deps offload comments (Copilot review)
Tighten three pieces of documentation to match the implementation; no
behaviour change:

- install-apt-deps (ghcr-debs-tag description): the apt mirror is avoided
  only on the successful offline path. The offline install is a single
  --no-download install of the whole package set, so any miss (bundle
  absent/private/incomplete) falls back to the apt path.
- ci-deps-image header: each bundle is every requested package plus the
  dependencies not already present on the matching runner image - tied to
  that runner, not a portable/self-contained .deb closure.
- ci-deps-image schedule note: a package missing from the bundle fails the
  whole offline install (it is not per-package), falling back to the full
  apt path.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 93b1e35a15 CI: address Copilot review (ccache-setup if:, smoke-test concurrency)
- ccache-setup: gate the scheduled-reseed step with
  `if: github.event_name == 'schedule'` again. The github context IS
  available in a composite action's step-level if: (install-apt-deps
  already relies on it), so the earlier $GITHUB_EVENT_NAME workaround and
  its comment were based on a wrong premise. The real load failure was the
  ${{ }} expression in the read-only input description, fixed separately.

- smoke-test.yml: include github.event_name in the concurrency group. The
  workflow pushes to master/main and now also runs on a weekday schedule;
  both share github.ref on the default branch, so under
  cancel-in-progress a seed run and a master push could cancel each other.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 86e5df754e CI: drop github context from ccache-setup input description
The read-only input description embedded `${{ github.event_name ==
'pull_request' }}` as example text. GitHub validates ${{ }} expressions in
an action's input definitions at manifest-load time, where the github
context is not available, so the action failed to load ("Unrecognized
named-value: 'github'", action.yml line 27) and every ccache-setup
consumer died at "Set up ccache" (build library, make check, Compiler
test, Multi-arch test, ...). Describe the expression in prose instead of
embedding it as a live ${{ }} template; the github.* references that
remain are in step with:/run: blocks, where the context is available.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 8754aee447 CI: fix ccache-setup load failure (github context in composite if:)
The scheduled-reseed step gated CCACHE_RECACHE with
`if: github.event_name == 'schedule'`, but the github context is not
available in a composite action's step-level if:. The action manifest
therefore failed to load ("Unrecognized named-value: 'github'"), and
every workflow using ccache-setup broke at the "Set up ccache" step
(build library, make check, Compiler test, Multi-arch test, ...).

Gate on the built-in $GITHUB_EVENT_NAME env var in the shell instead,
which keeps the schedule-only reseed behaviour with no caller changes.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 146e1c3d34 CI: reseed ccache from clean compiles on scheduled runs
The scheduled (cron) refresh restored the prior ccache and recompiled
only the translation units that changed, so unchanged objects were never
rebuilt and the shared cache could drift indefinitely. Set
CCACHE_RECACHE=1 on schedule events - gated inside the ccache-setup
action, so none of the calling workflows change - to force fresh
compiles that re-store every result. PR and push runs are unaffected and
keep their warm hits; only the scheduled jobs pay the full recompile.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz 3faaf7818c CI: address Copilot review - offline no-install-recommends, stale comments
- install-apt-deps: the ghcr offline-install path now honors the
  no-install-recommends input; it was always installing recommends,
  diverging from the regular apt path.
- install-apt-deps: correct the ghcr-debs-tag example to a real tag
  (ubuntu-24.04-minimal) - ci-deps-image publishes -minimal/-full
  variants, not a bare <ver> tag.
- os-check: fix the schedule header comment - macOS runs --build-only on
  the weekday cron to seed its ccache (like the linux shards); only
  Windows is skipped on schedule.
2026-06-15 22:36:35 +00:00
Juliusz Sosinowicz dd2f9d3ab8 CI: offload ccache/apt/buildx caches off the GitHub Actions cache
The 10 GB, LRU-evicted, PR-scoped Actions cache was being thrashed - the
docker simulator buildx layers (~6 GiB), plus per-PR ccache and apt-archive
writes whose keys never hit - which kept evicting the shared ccache, while
the apt mirror timed out often enough to break PR CI. Move the heavy caches
to ghcr (free, separate pool) and make PR runs read-only against the Actions
cache.

apt dependencies from prebuilt ghcr .deb bundles
  - ci-deps-image.yml resolves each package list under .github/ci-deps/ into
    its .deb closure and publishes ghcr.io/<owner>/wolfssl-ci-debs:<tag> in
    two tiers: <ver>-minimal (make-check family) and <ver>-full (interop
    superset), for ubuntu-22.04 and 24.04.
  - install-apt-deps gains a ghcr-debs-tag input: pull the bundle and install
    offline (--no-download) so the apt mirror is never on the PR critical
    path. Any failure (bundle missing/not public/incomplete) falls through to
    the existing apt path, so it is always safe to set.

sim-test buildx layers to a shared ghcr registry cache
  - the 7 docker simulator workflows switch from cache-to: type=gha to
    ghcr.io/wolfssl/wolfssl-sim-cache:<scope>. cache-from reads on every run
    (anonymous); cache-to writes only on the weekend cron and manual
    workflow_dispatch. Per-distinct-image tags and de-duplicated writers keep
    parallel matrix jobs from racing on one ref.

ccache: PRs read, the schedule writes
  - ccache-setup gains read-only: PR runs restore the shared master-scoped
    cache but never upload; schedule/push runs refresh it. Wired across
    os-check (linux + macOS), pq-all, smoke-test and the 12 small make-check
    workflows.
  - parallel-make-check.py gains --build-only (compile every config, skip the
    test phase) so weekday-morning seed crons warm the cache PR runs consume.

artifact retention capped at 7 days on the failure-log/result uploads that
previously defaulted to 90.

ONE-TIME SETUP: after their first publish, make the ghcr packages
wolfssl-ci-debs and wolfssl-sim-cache PUBLIC so anonymous pulls work from PR
(including fork) runs; until then everything falls back cleanly.
2026-06-15 22:36:35 +00:00
David Garske f9cd909c4d Merge pull request #10689 from julek-wolfssl/bump-github-actions-node24
.github: bump JavaScript actions to Node.js 24 runtimes
2026-06-15 15:27:01 -07:00
jordan 77fea4fe84 bsdkm driver: fix callback sync. 2026-06-15 16:00:19 -05:00
philljj 753a47739d Merge pull request #10688 from douzzer/20260615-linuxkm-fenrir-fixes
20260615-linuxkm-fenrir-fixes
2026-06-15 15:25:50 -05:00