Commit Graph

66 Commits (master)

Author SHA1 Message Date
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 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
David Garske 011d7f3146
Merge pull request #569 from night1rider/csr-fix
refactor csr_example to use filled Cert struct workflow
2026-04-08 13:49:09 -07:00
night1rider 00c263c7db refactor csr_example.c to clarify CSR API and show how to use a filled out Cert struct (req) to fully create a CSR with proper error handling and memory management. 2026-04-02 20:17:59 -06:00
Anthony Hu 7806e1bcd8 Make sure to set the CSR version 2025-11-10 14:48:07 -05:00
Andras Fekete 4c2f96ff64 Clean up wolfSSL path variable name 2024-04-04 13:28:23 -04:00
Eric Blankenhorn 20d13d8526 Fix up readme and build issues in certgen examples 2024-03-13 14:16:06 -05: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
David Garske a363898fbc
Merge pull request #340 from JacobBarthelmeh/pkcs12
adding use of devid to pkcs12 example
2023-01-09 16:13:23 -08:00
Jacob Barthelmeh cfffdd9ec8 set correct csr version in example 2022-12-01 16:49:46 -07:00
JacobBarthelmeh 401d467506 adding use of devid to pkcs12 example 2022-10-07 14:44:27 -07:00
David Garske b2c0ca21da Various improvements to crypto callbacks. 2022-04-22 15:59:45 -07:00
David Garske b9b157d9ef Fix for crypto callback not returning `CRYPTOCB_UNAVAILABLE`, which caused an invalid hash to be used for CSR signing. ZD 13949. 2022-04-05 12:50:34 -07:00
David Garske da6e5dee6b
Merge pull request #309 from anhu/too_much
Get rid of some garbage prefixed to output.
2022-03-25 11:32:54 -07:00
Anthony Hu 9e4fd5270b Get rid of some garbage prefixed to output. 2022-03-25 14:13:57 -04:00
David Garske 9703627d63 Fix typo in certgen/README.md 2022-03-25 10:33:52 -07:00
Anthony Hu 1dff867c6d Instructions in the README.md 2022-03-04 16:52:49 -05:00
Anthony Hu 51cfd2d2a0 Address review comments by dgarske. 2022-03-03 11:36:12 -05:00
Anthony Hu 2dca4875e7 Revert back to word16 API. 2022-03-03 10:41:54 -05:00
Anthony Hu 0b1795e00a Changes due to API change. 2022-03-02 17:45:26 -05:00
Anthony Hu 488c018c8f Makefile 2022-03-02 15:25:57 -05:00
Anthony Hu 6da4ce41a5 Example for injecting custom extensions 2022-03-02 15:21:20 -05:00
Anthony Hu d7db324862 Example for parsing of custom extensions in X.509 certificates. 2022-02-28 16:43:50 -05:00
David Garske d34e89053c Line length 2022-02-24 11:32:29 -08:00
David Garske d646f7a816 Further peer review improvements for documentation. 2022-02-24 11:30:44 -08:00
David Garske 45a13e1491 Improvements based on peer review. Added section in README.md. 2022-02-23 15:59:17 -08:00
David Garske 042956c74b CSR example using crypto callbacks (HSM). 2022-02-23 13:40:45 -08:00
Anthony Hu e94951119a This isn't csr generation, its certificate generation. 2022-02-18 13:17:55 -05:00
Anthony Hu 15b38449d4 Get rid of unused variable. 2022-02-16 15:27:03 -05:00
David Garske 0ce48b6028 Cleanup non ECC cases. 2021-11-29 14:34:44 -08:00
David Garske f304069438 Fixes for building without ECC enabled. Updated examples and remove duplicate with_altnames and combined into existing example. 2021-11-29 13:29:26 -08:00
David Garske 7212062235 Fixes issue with uninitialized `caKey` found with valgrind reported in ZD 13212. 2021-11-29 07:10:35 -08:00
David Garske dfd8a09c19 Fixes to get csr_sign working correctly. Currently only supports ECC, but could be easily adopted for RSA or ED25519. 2021-11-18 22:10:10 -08:00
David Garske bde4231cb3 Improvements to CSR examples.
* Add ed25519 support to csr_example.
* Added example for signing a CSR using a CA.
* Cleanup the csrgen_example.
2021-11-17 17:08:58 -08:00
Anthony Hu bb753dc179 Comment fixup for csr_example.c 2021-10-18 10:11:06 -04:00
Kaleb Himes 59e50a6a09
Merge pull request #265 from lealem47/nightly-CDT-Fixes
Getting files to run and pass nightly-CDT test
2021-07-06 17:46:14 -05:00
Lealem Amedie c8d596269d Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
Lealem Amedie 7032e3d457 removing depreciated void 2021-06-30 10:07: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
kaleb-himes 80295cedf4 Fixes warnings thrown by csr_w_ed25519_example.c 2021-06-29 14:47:25 -06:00
David Garske 5ba15f1426 Spelling fixes. 2021-06-09 09:07:40 -07:00
kaleb-himes 8c0d3e9270 Add a sample of IP address as opposed to DNS Name only 2020-06-25 13:19:42 -06:00
kaleb-himes fdd09aa1b7 name certs reflecting PK used, update examples w/ new names 2020-06-03 14:44:52 -06:00
kaleb-himes 33a16547a7 Fix a comment typo 2020-06-02 15:01:54 -06:00
kaleb-himes 8175e9da8b correct logic in PP check 2020-05-08 16:00:55 -06:00
Kaleb Himes 6466c9bda3
Fix a comment 2020-05-07 15:39:27 -06:00
kaleb-himes 2c14954fa1 Example of setting alt names with crafted ASN.1 string 2020-05-07 15:30:33 -06:00
Chris Conlon 9237d307b5 update copyright to 2020 2020-01-03 16:08:42 -08:00