Commit Graph

144 Commits (master)

Author SHA1 Message Date
Aidan Keefe f5c6e02ba6 new injection mechanic in CI/CD and github review fixes 2026-08-07 19:14:40 -06: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
Sean Parkinson 6ba3b3b7ef PQC proxy
Proxies that sit in front of a client and server that don't support PQC crypto algorithms.
2026-06-25 20:48:22 +10:00
Juliusz Sosinowicz 54f85adb37
Merge pull request #573 from helkoulak/ascon-examples
Ascon examples
2026-06-18 16:42:40 +02:00
Hosam Elkoulak e7d781e84b Fixes for ascon-hash256 2026-05-26 01:12:01 +02:00
Hosam Elkoulak d36f572a33 Fixes for ascon-file-encrypt 2026-05-26 00:41:28 +02:00
David Garske 6437dcdb83
Merge pull request #566 from sameehj/http-sign
Add RFC 9421 HTTP Message Signatures example using wolfCrypt Ed25519
2026-05-05 10:40:14 -07:00
David Garske 87e913955f Example for wolfCrypt PUF on STM32H5 2026-05-05 10:30:42 +02:00
Juliusz Sosinowicz b0ceceb0c8 Add OCSP responder examples
Three examples demonstrating the new OCSP Responder API:

1. ocsp-request-response.c - Pure API usage: encode DER OCSP requests
   from certificates, generate signed responses, and verify them
   in memory without networking.

2. ocsp-responder-http.c - Minimal HTTP server that accepts POST
   requests with DER OCSP payloads and returns signed responses.

3. nginx-scgi/ - Production-style deployment using nginx as HTTP
   frontend with wolfclu running as an SCGI backend for OCSP
   processing.
2026-04-07 14:11:36 +02:00
Sameeh Jubran 9a3b8458b3 Add RFC 9421 HTTP Message Signatures example using wolfCrypt Ed25519
Initial implementation of RFC 9421 HTTP Message Signatures as a
wolfssl-examples project. Covers a minimal interoperable subset:
derived components (@method, @authority, @path, @query), arbitrary
HTTP header fields, Ed25519 signing/verification, single signature
(sig1), and timestamp-based replay protection.

Files:
- common/wc_sf.{c,h}: Minimal RFC 8941 structured fields subset
  (dictionary lookup, inner lists, parameters, byte sequences)
- common/wc_http_sig.{c,h}: RFC 9421 Sign/Verify/GetKeyId API
- sign_request.c: Standalone signing example
- http_server_verify.c: Demo HTTP server with signature verification
- http_client_signed.c: Demo HTTP client sending signed requests
- test_vectors.c: 11 tests including RFC 9421 Appendix B.2.6

Design decisions:
- Ed25519-only (alg enforced on verify path)
- sigOut/inputOut are char* (NUL-terminated strings)
- Header names lowercased per RFC 9421 Section 2.1
- Portable case-insensitive comparison (no POSIX strcasecmp)
- SO_RCVTIMEO on server to prevent blocking on slow clients
- Signature base written directly to caller buffer (no double-buffer)

Known limitations:
- 32-bit long: parse_sf_integer caps at 9 digits, breaking current
  UNIX timestamps (needs fix, see below)
- No content-digest, multi-signature, or full RFC 8941 support
- Duplicate headers: first match wins, no folding

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-03-30 13:17:51 +03:00
Paul Adelsbach 1ac9c87c3b Extend minimal and rdseed examples 2026-03-20 15:27:46 -07:00
Paul Adelsbach 62476b1871 Add minimal buffer encrypt and decrypt example for AES-GCM 2026-03-12 09:52:47 -07:00
Daniele Lacamera c92a922aea Added `uefi-library`: wolfCrypt as UEFI driver 2026-02-18 18:54:14 +01:00
David Garske a4072803f2 Example for ST-SAFE A120 2026-01-06 00:27:27 +00:00
David Garske 6f4d61fa65
Merge pull request #530 from julek-wolfssl/tls13-earlydata
Add TLS 1.3 early data examples
2025-12-29 09:18:35 -08:00
jordan ff0fc6ce88 bsdkm: example cleanup. 2025-11-21 16:00:20 -06:00
Juliusz Sosinowicz c967668ebf Add DTLS 1.3 early data examples 2025-11-03 14:59:11 +01:00
Juliusz Sosinowicz fef27cf910 Add TLS 1.3 early data examples
Introduces client and server examples that demonstrate the use of
TLS 1.3 early data (0-RTT) with session resumption.

The client example performs an initial handshake to obtain a session
ticket, then reconnects and sends early data. The server example
receives early data and sends back a reply.
2025-10-29 17:49:00 +01:00
David Garske 75a4312cdc
Merge pull request #527 from mattia-moffa/20250923-certauth-clienthello
TLS 1.3 certificate_authorities extension in ClientHello
2025-10-06 11:02:50 -07:00
Mattia Moffa 72a39e270a Add info in readme, remove wolfSSL version check 2025-10-06 18:16:47 +02:00
Mattia Moffa adef0a284c Add example for TLS 1.3 certificate_authorities extension in ClientHello 2025-09-23 19:04:30 +02:00
Juliusz Sosinowicz 35cae80512 Add Eclipse to .gitignore 2025-09-19 12:02:14 +02:00
Juliusz Sosinowicz 7d179c1e4c Feat: Adds OCSP stapling example
Adds OCSP stapling client and server examples with
dynamic certs. This allows testing and demonstrating
OCSP stapling functionality.
2025-09-18 20:24:17 +02:00
Eric Blankenhorn 1e2dd49885 Update expired example certs 2025-09-15 12:21:21 -05:00
gojimmypi a94c2f7769
Improve Arduino Examples 2025-08-15 14:01:53 -07:00
gojimmypi 638297a18a
Move Arduino examples, add GitHub workflow 2025-04-06 13:01:22 +02:00
David Garske 9d6dcdf2e9
Merge pull request #496 from SparkiDev/hash_examples_update
Hash examples: add more
2025-03-20 16:47:26 -07:00
Sean Parkinson ae63bfdb40 Hash examples: add more
More examples based on different hash algorithms.
Examples hashing a string rather than a file.
Examples showing oneshot API.
Example of using hash wrapping API.
2025-03-18 12:22:24 +10:00
Sean Parkinson 223a172d57 RSA-PSS example: fixup
Separate out steps.
Hash the message before signing and verifying.
2025-03-18 11:07:11 +10:00
David Garske 8775b5c06d Minor improvements. Tested with RSA and ECC for both DTLS v1.2 and v1.3. Tested with/without calling accept/connect. Tested with calling `wolfSSL_is_init_finished`. 2025-01-03 11:59:26 -08:00
Daniel Pouzzner 6c5b5f4c49
Merge pull request #448 from SparkiDev/dtls_read_write_threaded
DTLS threaded read-write with same SSL object
2024-11-04 23:52:38 -06:00
jordan dca01c7293 pq: ML-DSA example. 2024-11-01 13:37:40 -05:00
Sean Parkinson 3bb9656563 DTLS threaded read-write with same SSL object
Add server and client DTLS example that have read and write threads that
use the same SSL objects.
Server also has encryption threads when wolfSSL is compiled for that.
2024-10-29 11:42:20 +10:00
Daniel Pouzzner 8254f47648
Merge pull request #455 from philljj/x509_acert_example
X509 acert example
2024-09-14 00:41:50 -05:00
Daniel Pouzzner d56158eef6
Merge pull request #453 from dgarske/dtls_cleanups
Cleanups for DTLS 1.3 client/server examples.
2024-08-31 00:43:20 -05:00
jordan 05076a726c Update dot gitignore. 2024-08-30 16:48:35 -05:00
David Garske eaa8e8e022 Cleanups for DTLS 1.3 client/server examples. 2024-08-28 08:17:48 -07:00
Sean Parkinson 4aa0d3758a AES-GCM one shot example
Add a simple example of using the AES-GCM oneshot API for encryption and
decryption.
2024-08-08 12:23:06 +10:00
aidan garske 413b997e7f ecc_sign_determinisitic.c test for for deterministic ECDSA Prime Field for SECP256R1, SECP384R1, and SECP521R .gitignore addition and binary file exclusion. 2024-07-03 11:54:26 -07:00
Sean Parkinson 03af3cf231 Low-level certificate verification examples 2024-06-06 15:53:14 +10:00
JacobBarthelmeh 7f7170609e add content/stream callback example 2024-02-26 09:46:28 -07:00
David Garske f808600853 Peer review feedback. 2024-01-10 15:05:48 -08:00
philljj 5b401de7d2 Example for xmss hooks support. 2023-10-05 08:45:57 -05:00
Chris Conlon ccd28fda67 PKCS#7: add example to verify existing SignedData file 2023-09-12 16:50:51 -06:00
JacobBarthelmeh a633d60b83
Merge pull request #392 from billphipps/add_vaultic
Add CryptoCB support for Wisekey VaultIC420
2023-08-23 14:03:20 -06:00
John Bland f155379142
add example of how to use HPKE with all options (#356)
* add example of how to use HPKE with all options

* add example of how to use ech with a public server run by cloudflare

* move ech example to tls directory, update hpke instructions

* update client-ech based on pr comments

* update ech test to handle read error

* update hpke_test to match changed function signature

* add root CA cert for ech-client example, fix

various problems based on pr comments

* clear out variable for example

* remove unused variable
2023-07-10 14:25:20 -07:00
Bill Phipps f0b047110d Ignore MacOS .DS_Store files. 2023-07-10 12:22:19 -04:00
John Bland 615c05c346 add examples for setting up an ech server and
connecting to it from a client. requested from https://github.com/wolfSSL/wolfssl/issues/6568
2023-07-04 06:17:33 -04:00
Chris Conlon 186be0fa9c Android Studio: add sample config and instructions for wolfSSL FIPS Ready with wolfSSL JNI/JSSE 2023-02-03 16:25:59 -07:00
gojimmypi 7e26aac247 example code cleanup; confirm working w/ ESP-IDF v5.0 2023-01-02 17:12:21 -08:00