Commit Graph

1835 Commits (6398f4552fac0d451ab265f039a5fe96cb8882c5)

Author SHA1 Message Date
Anthony 6398f4552f Add SRP-6a SHA-256 example
Full exchange (enrollment through mutual proof verification) using
SHA-256 and the RFC 5054 2048-bit group.
2026-07-29 13:39:36 -04:00
Anthony 96fb285077 Add HPKE seal/open context example
One KEM encapsulation protecting an ordered message sequence via
wc_HpkeInitSealContext()/wc_HpkeContextSealBase() and the open
equivalents, with out-of-order rejection.
2026-07-29 13:39:21 -04:00
Anthony f09fb7378f Add KDF examples
HKDF (RFC 5869), PBKDF2 (RFC 2898) and scrypt (RFC 7914), each
verified against its RFC known-answer test vector.
2026-07-29 13:39:15 -04:00
Anthony 9f751293e3 Add SipHash example
SipHash-2-4 one-shot 64/128-bit MACs and the incremental API, checked
against the reference implementation's test vector.
2026-07-29 13:39:03 -04:00
Anthony 73dde4a277 Add BLAKE2b/BLAKE2s examples
Incremental hashing checked against the RFC 7693 known-answer vectors,
plus BLAKE2b's native keyed mode used as a MAC.
2026-07-29 13:38:44 -04:00
Anthony eba0390017 Add SM2/SM3/SM4 examples
wolfCrypt-level ShangMi examples: SM3 hash (GB/T 32905 known answer),
SM4-GCM with tamper detection, SM2 sign/verify including the ZA digest
step, and SM2 ECDH. Requires the wolfSSL/wolfsm overlay.
2026-07-29 13:38:24 -04:00
Anthony dbf6e9ad49 Add SLH-DSA (FIPS 205) example
Key generation, signing and verification for all SHAKE and SHA2
parameter sets, with corrupted-signature rejection.
2026-07-29 13:38:02 -04:00
Aidan Garske b41d12c0b8
Add CI that builds and runs every example (#598)
* Regenerate the CRL that expired in September 2025

* Refresh the expired certificates embedded in certloadverifybuffer

* Return 0 from tls servers that returned a wolfSSL_write byte count

* Send a client certificate from client-tls and client-tls13-resume

* Return 0 from certverify instead of WOLFSSL_SUCCESS

* Give the XTS demo key two different halves

* Exit success after ml_dsa prints its parameter table

* Report failure from the custom io file client and server

* Latch failures across every ecc-params curve lookup

* Ignore SIGPIPE in the btle fifo transport

* Fix the dtls rw-threads certificate paths

* Make runall.sh fail when an example fails

* Make openssl-verify.sh actually verify and actually fail

* Raise the generate_ssl.sh common name length limit

* Port the PQ examples to the current wolfSSL API

* Return 0 from csr_w_ed25519_example and rsa-public-decrypt-app

* Build the x509_acert openssl example against the right headers

* Give the examples Makefiles a consistent wolfSSL prefix

* Fix the double free and NULL derefs in the custom io cleanup paths

* Stop forcing the ESP32 examples to include a developer private config

* Add the missing WiFi Kconfig to the DTLS13 station examples

* Use XSTRLCPY in client-dtls13 since wolfSSL has no XSTRCPY

* Make the DTLS13 example ctx static so it stops colliding with libnet80211

* Set SO_REUSEADDR on the tls servers that lacked it

* Give puf the wolfSSL sources and stop building the IDF 4.4 only ENC28J60 examples

* Set SO_REUSEADDR on server-tcp as well

* Exit the can-bus client on EOF and give it real input in CI

* Re-arm the select timeout each pass in the nonblocking dtls server

* Keep the shared memory BIOs alive until both sides are done

* Port the ebpf tracers to the libbpf 1.0 perf_buffer__new signature

* Clone wolfSSL before make builds its graph so uefi-static builds from a clean tree

* Raise wolfcryptjni compileSdk to 32 for the BigInteger API its submodule uses

* Link wolfentropy.o and keep wc_port socket helpers out of the UEFI build

* Track the wolfSSL dilithium.c to wc_mldsa.c rename and drop a stale java import

* Move uefi-library to the wc_MlDsa API after the wolfSSL dilithium rename

* Declare the launcher activity exported, required from API 31

* Configure wolfSSL before make in the fullstack setup script

* Track the wolfSSL io.c to wolfio.c rename in the ndk sample

* Keep glibc headers out of the freestanding uefi-library build

* Track the wolfSSL mlkem.h rename and give RT1060 the SDK name it selects on

* Track the wolfIP struct ll rename and pin wolfIP to its v1.0 release

* Use getaddrinfo in the ndk sample since bionic does not declare gethostbyname

* Cross compile RT1060 with arm-none-eabi and document the SDK value the Makefile matches

* Enable wolfIP HTTP so its httpd.h actually declares the API the example calls

* Define HAVE_NETDB_H so wolfio.c includes the header its getaddrinfo path needs

* Link pkcs12.o, which RT1060 enables by default and wolfcrypt test calls

* Port the ENC28J60 examples to the ESP-IDF 5.x ethernet API

* Compile dtls.c in the ndk sample, which enables WOLFSSL_DTLS

* Define the PHY identifier registers the removed IDF header supplied

* Compile kdf.c in the ndk sample for the TLS PRF

* Give RT1060 a current_time so the benchmark stops needing clock_gettime

* Port the ENC28J60 PHY to the IDF 5.x autonego_ctrl vtable

* Remove the ENC28J60 server's duplicate driver copy that main already builds

* Return the DTLS server to accept on close_notify so a resume is heard

* Run the C# pq client/server pair under mono

* Define WOLFSSL_CERT_REQ so the ndk-gradle app links wolfssljni's X509_REQ calls

* Refresh the expired client ECC DER certificate

* Add CI that builds and runs every example against wolfSSL master and stable

* Sign OCSP staples with a responder intermediate1 actually delegated

* Report a failing PKCS#11 example instead of always exiting 0

* Link the PSA library the README's PSA_LIB_PATH names

* Widen the mynewt pointer prints so they build on a 64 bit native BSP

* Test RSA under UEFI with a 2048 bit key so it clears wolfSSL's minimum

* Left pad the ECDSA r and s so a leading zero cannot shift the signature

* Document the smime and indef flags the pkcs7 examples need

* Fail ecc-verify when the signature does not verify

* Fail ecc-sign when a round produces an invalid signature

* Fail aesgcm-file-encrypt when its sanity test does not pass

* Check that ML-KEM derives the same shared secret on both sides

* Fail ecdh_gen_secret when the two sides derive different secrets

* Return the DH key agreement error instead of always exiting 0

* Retry the fullstack HTTPS probe so a slow sim start does not fail it

* Confirm the custom-io file transfer succeeded so CI can assert it

* Print a success line from the silent file-encrypt and ecc-export examples

* Add device-sims job running ATECC608 STSAFE and TROPIC01 sim wolfcrypt tests

* Extend device-sims to STM32 and PIC32MZ for the full sim fleet

* Mount wolfSSL for the STM32 and PIC32MZ sim wolfcrypt runs

* Accept the zero success return from wolfSSL_CTX_set_max_early_data

* Read the earlydata reply so the client processes the session ticket before resuming

* Read the earlydata reply in the DTLS client so it processes the session ticket

* Run the tls13 and dtls13 earlydata pairs now that the clients process the ticket

* Let expect_fail clear on refs that carry the fix via a fixed_on marker

* Retry the PSA TLS 1.3 handshake so an intermittent ECC reject does not fail CI

* Retry network fetches across CI so a transient blip does not fail a job

* Normalize do_ecc and do_25519 exit codes like do_448 so an error is never masked to 0

* Build and run the merged-in hsm dtls_client example in CI via a dedicated hsm.yml job

* Add a make check target to each applicable example

* Run only the example and lint smoke set on draft PRs

* Only run a per-target workflow when its own example dir changes

* Assert the real se050 wolfcrypt result instead of an early sub-test line

* Size the RSA 2048 key export buffers so the UEFI test does not fail on BUFFER_E

* Call the always-present MLDSA context API from the UEFI driver

* Cross uefi-static and uefi-library with both wolfSSL refs in the matrix

* Give each tpm matrix leg a ref-unique results file and artifact

* Add a codespell spellcheck pass to the lint job

* Run push CI on master only so a PR branch does not double-trigger

* Select valgrind by caller_run_id since event_name is the caller under workflow_call

* Make example check targets catch real failures with pipefail exit checks and inputs

* Wire the harness to run make check for mode check examples starting with ecc

* Migrate the single-entry exec examples to mode check and fold their inputs into the check targets

* Fix four make check assertions that misfired under pipefail

* Give the tpm manifest entry a run step so it asserts output

* Skip uefi-static in the lint make -n loop so it does not clone

* Assert the actual verify result in the pkcs7 and rsa-nb checks

* Return nonzero from pkcs12-create-example on a failed create so the check is not a false pass

* Return nonzero from rsa-kg on any key generate or write failure

* Assert the static memory checks by exit code instead of a pipefail grep that BSD make lacks

* Run pkcs7 signedData stream through make check so it asserts the real verify result

* Check DER certificates and CRLs in the expiry canary too

* Feed the wolfHSM client its stdin so run_client actually exchanges data

* Assert every make check by exit code and captured output instead of a pipefail grep so they hold under BSD make
2026-07-23 10:07:06 -06:00
Marco Oliverio c586428531
wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555)
* wolfHSM: add DTLS client that uses HSM as cryptographic backend

* address reviewer's comment

* dtls client improvements
2026-07-22 08:37:34 -06:00
Emma Stensland dc6a012c30
Merge pull request #606 from padelsbach/fix-ecc-verify
Minor fixes in ecc-verify example
2026-07-21 16:37:18 -06:00
Paul Adelsbach 8eebbe0600 Minor fixes in ecc-verify example 2026-07-21 13:10:13 -07:00
Emma Stensland 478701b8b8 F-5613: keep peer verification enabled after loading CA cert in Mynewt client 2026-07-20 17:09:21 -06:00
Aidan Garske 3e274a11ac
Merge pull request #602 from padelsbach/update-lms-xmss-example
Update LMS and XMSS example to latest
2026-07-16 12:12:17 -07:00
Paul Adelsbach 69eb6003bd Update LMS and XMSS example to latest 2026-07-16 11:54:51 -07:00
jackctj117 48a25f4450
Merge pull request #574 from sameehj/cra
Add CRA Kit for customer SBOM integration
2026-07-16 09:49:03 -06:00
JacobBarthelmeh f4dfc164f7
Merge pull request #600 from stenslae/fenrir/f6720-caam-seco-iv-size
F-6720: IV Size
2026-07-15 15:43:27 -06:00
JacobBarthelmeh 1d906c77c8
Merge pull request #599 from stenslae/fenrir/f6721-pkcs12-createkey-sign
F-6721 PKCS12 Fix
2026-07-15 15:42:00 -06:00
Emma Stensland 8ed03a2982 F-6721: capture wc_RsaKeyToDer() result in a signed int before checking for errors in createKey 2026-07-15 10:09:54 -06:00
Emma Stensland 5807e9b595 F-6720: use a full 16-byte IV in CAAM/SECO AES-CBC examples 2026-07-15 10:04:02 -06:00
Emma Stensland 069f16efe2 F-2907 F-2912 F-3466 F-3467 F-3468 F-3469 F-3470: fix file handle, PKCS7 object, and key-decode buffer leaks across pkcs7 examples 2026-07-15 09:39:17 -06:00
Emma Stensland 6d28833ed3 fixed duplicate unlink(out_file) 2026-07-14 15:15:29 -06:00
Emma Stensland 8c968eb572 F-1296 F-2112 F-2893 F-2900 F-3899 F-4121 F-4127: Fix error handling in TLS, DTLS, and protocol examples 2026-07-14 15:06:41 -06:00
Emma Stensland 8f0f1af04a F-1298 F-1302 F-1307 F-1712 F-1713 F-1719 F-1720 F-1721 F-1722 F-2093 F-3466 F-3472 F-3477 F-4131 F-4132 F-4600 F-5612 F-6286 F-6289 F-6536: Fix error handling in crypto and signature examples 2026-07-14 15:06:41 -06:00
Emma Stensland f38780093c F-1300 F-2099 F-2100 F-2101 F-2113 F-2116 F-3474 F-3475 F-3476 F-3692 F-3694 F-3695 F-3892 F-3893 F-3894 F-4126: fix key/RNG leaks and zeroize private key buffers in certgen, ecc, and PQ examples 2026-07-14 14:32:22 -06:00
Emma Stensland 210e9caf3e F-1715 F-2114 F-3224 F-3690 F-4120 F-4123 F-4124 F-5614 F-5615: replace hardcoded/UAF-prone secrets and keys with RNG-generated values, zeroize key material before free, and flag non-constant-time secret comparisons 2026-07-14 13:33:25 -06:00
Emma Stensland 717e52d02b F-1305 F-1306 F-1714 F-2111 F-2905 F-2906 F-2909 F-3897 F-4125 F-4608 F-6288: fix NULL-deref, fd-leak, unaligned-access, and buffer-overflow bugs across CAN, PKCS7, embedded, and PEM-printing examples 2026-07-14 13:33:25 -06:00
Emma Stensland 320dca9c66 F-1302 F-1303 F-1304 F-1308 F-3471 F-3691 F-4601: fix buffer overflows, malloc/realloc NULL checks, and padding validation in crypto file-encryption examples 2026-07-14 13:33:25 -06:00
Emma Stensland 3a8472e7e4 F-3896 F-6291: fix linked-list head overwrite leak in memory-bucket-optimizer and zeroize PUF key material on exit 2026-07-14 13:05:13 -06:00
Emma Stensland 1149b07ac5 F-1293 F-1700 F-1709 F-1710 F-2095 F-2096 F-2098 F-2102 F-2103 F-2896 F-3226 F-4128 F-4129 F-4602: fix socket, buffer, and object leaks in BLE, custom-io, can-bus, certfields, and TLS examples 2026-07-14 12:59:50 -06:00
Emma Stensland 7bdf89dd97 F-3220 F-3221 F-3696 F-4603 F-4604 F-4609: zeroize DTLS session and OCSP CA key buffers, fix exit codes and ocsp_resp leak 2026-07-14 09:50:18 -06:00
Emma Stensland 278736016e F-2115 F-3693 F-3890 F-3895 F-5608 F-5609 F-5613 F-6290 F-6537 F-6538: fix RPi-Pico, TOPPERS, PSK, lwIP, Mynewt, uTasker, wolfIP, and STSafe examples issues 2026-07-13 17:29:28 -06:00
Emma Stensland 1cedd247eb F-1723 F-1724 F-1725 F-2908 F-2910 F-2911 F-3461 F-3683 F-3684 F-3891 F-4605 F-4606 F-4607: fix CAAM, Renesas, SGX, and UEFI examples issues 2026-07-13 17:29:28 -06:00
Emma Stensland 9ac1bcbc4e F-1297: fix RSA signature verification check that always passed regardless of result 2026-07-13 16:39:01 -06:00
Emma Stensland 12ba640b3a F-1701 F-1292 F-3225 F-3902 F-1705: fix double-close, wrong-socket, and NULL-check bugs, and harden fd/session sentinel handling across DTLS, TLS, PSK, and CAN-bus examples 2026-07-13 16:39:01 -06:00
Emma Stensland b389087ed7 F-5610: fix ENC28J60 TLS server continuing past a NULL WOLFSSL session, and harden ESP32 socket/string handling 2026-07-13 16:39:01 -06:00
Emma Stensland 99cdfa1e3a F-1295 F-1697 F-3684 F-6287: fix duplicate wolfSSL_write call, wc_FreeDhKey double-free/key2 leak, fileSize dead-code checks, and unsigned keySz < 0 check 2026-07-10 16:56:42 -06:00
Emma Stensland 73d813efe4 F-2895 F-2897 F-2898 F-2899 F-3898: fix cipher suite string colons, nanosecond overflow arithmetic, and shutdown() call in lwIP 2026-07-10 16:56:42 -06:00
Emma Stensland ac4b7b574e F-1698 F-1699 F-2094 F-2097 F-3222 F-3465 F-3900 F-4130 F-4599 F-5611 F-6285: fix logic and conditional bugs 2026-07-10 16:56:42 -06:00
Paul Adelsbach a627f04342
Merge pull request #578 from SparkiDev/pqc_proxy_examples
PQC proxy
2026-07-10 16:06:09 -06:00
Paul Adelsbach 0d71d9887a
Merge pull request #581 from night1rider/fenrir-issue-4598
Return WANT_WRITE on EWOULDBLOCK in my_IOSend
2026-07-10 15:55:15 -06:00
Paul Adelsbach 1ea8602197
Merge pull request #582 from night1rider/fenrir-issue-2894
Give each PSK thread its own heap copy of connfd
2026-07-10 15:50:04 -06:00
Zackery bf7fb899af
Merge pull request #575 from dgarske/amebapro2-huk-example
Add RealTek AmebaPro2 (RTL8735B) HUK wolfCrypt example
2026-07-10 14:13:48 -06:00
David Garske aebd9198c4
Merge pull request #587 from night1rider/fenrir-issue-1301
Propagate failure from EVP decrypt_file error paths
2026-07-06 17:23:20 -07:00
David Garske 4a5b5c9f4d
Merge pull request #588 from night1rider/fenrir-issue-1294
Fix operator precedence in wolfSSL_connect return check
2026-07-06 17:23:00 -07:00
David Garske 2eec706d69
Merge pull request #586 from night1rider/fenrir-issue-1696
Fix NULL check after wolfSSL_new to test the returned ssl object
2026-07-06 17:22:51 -07:00
David Garske d9aa3545aa
Merge pull request #579 from stenslae/f-1289-1718-1707-fixes
F-1289 F-1718 F-1707 F-1705 oob write and null pointer fixes
2026-07-06 11:26:12 -07:00
David Garske c43acf442a rtl8735b: GCM-wrap the HUK ECDSA scalar (authenticated unwrap)
Provision the wrapped scalar with AES-GCM (iv + tag) instead of ECB, so a
tampered/corrupted/wrong-device blob fails at unwrap (AES_GCM_AUTH_E) rather than
yielding a garbage scalar. Matches the wc_Rtl8735b_EccKey iv/tag fields.
2026-07-02 16:43:55 -07:00
David Garske 2bf2c06056 rtl8735b: enable WOLF_CRYPTO_CB_COPY/FREE for HUK HMAC
The HUK HMAC accumulation buffer now lives on the inner SHA-256 devCtx and relies
on the cryptocb copy/free ops so wc_HmacCopy/wc_HmacFree manage it correctly.
2026-07-02 16:34:16 -07:00
David Garske 36af63f1dd Add RealTek AmebaPro2 (RTL8735B) HUK-in-TLS example
In-memory TLS 1.2 ECDHE-ECDSA handshake with the server certificate ECDSA P-256
signature produced on the HUK HW engine via a PK sign callback. The rest of TLS
(PRF/HMAC, record AES-GCM, ECDHE) stays in software: a whole-CTX WC_HUK_DEVID
would route TLS's own 32-byte HMAC keys (e.g. the P-256 ECDHE pre-master in the
PRF) to the HUK, whose key==seed semantics break key derivation. Validated on
RTL8735B silicon.
2026-07-02 16:18:01 -07:00
Sameeh Jubran 811b31a363 cra-kit: address Atwood re-review blockers on #574
- Replace fabricated library-binary SHA-256/SHA-1 with all-zeros sentinels
  in the pinned wolfssl-component samples (cdx/spdx + commercial variants);
  a non-reproducible binary hash must not ship in a copyable sample.
- Recompute product bom-link checksums (CycloneDX bom hash + SPDX
  externalDocumentRef) to match the edited component SBOMs.
- Give the SPDX tag-value document a distinct documentNamespace so it no
  longer collides with the JSON serialization (SPDX 2.3 sec 3.5).
- Add licenses (GPL-3.0-only) to the wolfssl component in the product CDX
  (NTIA minimum elements).
- Align conformity-assessment-route.md wording to Annex III "important" /
  Annex IV "critical", dropping the "class II" label.
- Document the sentinel digest in SAMPLE-PROVENANCE.md.

validate.sh passes (cross-document checksums + pyspdxtools schema).

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-07-02 17:50:01 +03:00