Commit Graph

54 Commits (ef8181959e9312bc05ce59f07598a6e8be43aed1)

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 Keefe 5626aa3a0b Mikey-sakke format fix 2026-07-29 13:00:17 -06:00
Aidan Keefe 6715f35753 hpke_context revised 2026-07-29 13:00:17 -06:00
Aidan Keefe edac0694db srp_sha256 revised 2026-07-29 13:00:17 -06:00
Aidan Keefe a6933bdb24 Mikey-Sakke example revised 2026-07-29 13:00:17 -06:00
Anthony 0aeba02dce Add MIKEY-SAKKE (ECCSI + SAKKE) example
Identity-based key exchange per RFC 6507-6509: KMS provisions user key
material, ECCSI signs the SAKKE-encapsulated SSV, receiver verifies
and derives the shared secret.
2026-07-29 13:39:43 -04:00
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
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
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 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 9ac1bcbc4e F-1297: fix RSA signature verification check that always passed regardless of result 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
Anthony Hu 1c824034d6 Curve25519 needs an RNG for blinding 2025-12-30 16:05:57 -05:00
JacobBarthelmeh 912c585989
Merge pull request #411 from dgarske/keywrap
Example for key wrap using ECDH, HKDF and AES GCM
2025-03-26 03:50:37 +07: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 c3847f05a1
Merge pull request #442 from wolfSSL/ecc_sign_determinsitic_k2
ecc_sign_determinisitic.c test for for deterministic ECDSA Prime Field for SECP256R1, SECP384R1, and SECP521R
2024-07-19 07:42:04 -07:00
Eric Blankenhorn 3c14ef823a Add wc_ecc_set_rng to ecdh_gen_secret 2024-07-10 10:25:52 -05: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
aidan garske 49bfb703a7 ecc_sign_determinisitic.c test for for deterministic ECDSA Prime Field for SECP256R1, SECP384R1, and SECP521R. With SHA256, SHA384, and SHA512 tests. 2024-07-03 09:58:38 -07:00
aidan garske ecd8ce1882 ecc_sign_determinisitic.c test for for deterministic ECDSA Prime Field for SECP256R1, SECP384R1, and SECP521R. With SHA256, SHA384, and SHA512 tests. 2024-07-03 09:44:51 -07:00
Andras Fekete 4c2f96ff64 Clean up wolfSSL path variable name 2024-04-04 13:28:23 -04:00
David Garske 8e203bf1f0 Example for key wrap using ECDH, HKDF and AES GCM. 2023-11-01 17:18:47 -07: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
tim-weller-wolfssl 013a6da63d Phase 1 updates to wolfSSL examples based on testing with wolfSSL
release v5.5.4-stable.  Changes include minor build fixes and README
updates.
2023-03-25 09:15:11 -05:00
Sean Parkinson cbe8214bd8 Add RSA key generation example 2022-05-11 11:41:27 +10:00
David Garske f61f8f9a5b Improve the endianess logic for test vector. 2022-01-27 14:40:45 -08:00
David Garske a93591c6b0 Added simple README.md. 2022-01-27 07:38:53 -08:00
David Garske dd3549220f Added endianess to the example. All tests pass now. 2022-01-27 07:36:42 -08:00
David Garske c24f179233 Curve25519 test vectors. 2022-01-26 16:09:10 -08:00
Lealem Amedie c8d596269d Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
Lealem Amedie f30fea9e3c minor spelling and markdown fixes 2021-06-30 09:35:29 -06:00
Lealem Amedie be264f0511 Adding documentation where needed. Made changes to code to assure files build and implement good coding practices 2021-06-29 16:02:52 -06:00
David Garske 5ba15f1426 Spelling fixes. 2021-06-09 09:07:40 -07:00
kaleb-himes 770c6b589f Remove unused variables 2021-05-04 10:23:35 -06:00
kaleb-himes d4c25f24f7 Implement peer review feedback 2021-05-04 10:20:11 -06:00
Kaleb Himes 238019d1d2
Merge branch 'master' into TEST_CERT_KEY_PAIR 2020-06-18 07:31:36 -06:00
Sean Parkinson 0687fcb3b7 Add Curve448, Ed448 and Ed25519 examples
Curve448 example as part of pk/ecdh_generate_secret/ecdh_gen_secret.c
2020-06-18 13:16:03 +10:00
Kaleb Himes edd754a38a
Merge pull request #193 from SparkiDev/srp_examples
SRP examples
2020-06-17 21:01:53 -06:00
Sean Parkinson 037d296724 SRP examples
srp_gen - generates the verifier for username and password
srp_gen does client and server side work to create and verify proofs
2020-06-18 09:25:51 +10:00
kaleb-himes 05009a6255 Add executable to ignore, add check for FP_MAX_BITS 2020-05-27 14:35:39 -06:00
kaleb-himes 5bac34359e Quick example app to check if a cert and key match 2020-05-27 14:27:35 -06:00
kaleb-himes b9d5847fb4 Fix: ecc sign/verify examples calling wolfmath primitives without WOLFSSL_PUBLIC_MP check 2020-05-08 16:35:12 -06:00
David Garske 751d3ee4ad Updated Makefile to allow for wolf path. 2020-05-04 08:00:11 -07:00
David Garske 8b8915d17e Peer review feedback. Adjust README.md and fix possible use of un-init variable. 2020-05-04 07:58:43 -07:00
David Garske 4f732c9b6b Improved ECC sign/verify examples using raw key/signature elements. Add ECC public key export example. Cleanup ecc_keys.c example. 2020-05-04 07:52:27 -07:00
Chris Conlon 9237d307b5 update copyright to 2020 2020-01-03 16:08:42 -08:00
Sean Parkinson 3f51d20c36 Add RSA and DH samples
RSA key generation with sign-verify checks.
DH parameter generation or FFDHE with key agreement checks.
2019-11-26 17:34:43 +10:00
Kaleb Himes f749088e32
Formatting changes 2019-05-10 13:49:11 -06:00
kaleb-himes 0ab33c6e35 Remove unused prototype 2019-05-10 13:45:59 -06:00