Commit Graph

1899 Commits (master)

Author SHA1 Message Date
Lealem Amedie 7271cc07e8 Add a minimal example for ecc verify 2026-04-24 12:31:14 -06:00
Paul Adelsbach 6d316999ff Misc fenrir fixes 2026-04-24 11:24:06 -07:00
Sameeh Jubran 09966434e4 http-message-signatures: address Skoll review feedback
- http_client_signed: check build_http_request() return before
  send() and cast to size_t; free key on import_private_only
  failure.
- http_server_verify: consolidate main() error paths around a
  single "cleanup:" label so pubKey and listenFd are released
  uniformly (import_public, socket, bind, listen).
- test_vectors: guard ed25519_free with per-key init flags so
  the shared cleanup path never frees an uninitialized struct.
- wc_http_sig.h: document that WC_SF_MAX_STRING / WC_SF_MAX_ITEMS
  drive ~12KB stack usage and must be tuned for embedded targets.
- wc_sf: reject *outSz > INT_MAX in wc_SfGenSigParams and
  wc_SfGenSigInput to guard word32 -> int casts (matches
  build_signature_base).

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-04-23 12:37:58 +03:00
night1rider 28fcdbbc24 Example project for using a FIPs Ready linux image on qemu and on RPI 5 with an initramfs kernel module loading, and ported projects to utilize wolfCrypt throughout the image example 2026-04-20 14:29:03 -06:00
David Garske 44e31acbc6
Merge pull request #570 from julek-wolfssl/ocsp-responder-examples
Add OCSP responder examples
2026-04-13 09:51:11 -07:00
Juliusz Sosinowicz e9a5c757e0 Address review feedback
- LoadFile now validates fread read the full file size and returns NULL
  on short read.
- ocsp-responder-http checks wolfSSL_Init return value.
- Remove bare scope block around sigaction setup.
2026-04-13 12:41:29 +02:00
Juliusz Sosinowicz b79c987789
Update ocsp/responder/nginx-scgi/run.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-10 14:17:01 +02:00
Juliusz Sosinowicz 04ff1c7ddd Address PR #570 review feedback for OCSP responder examples
- Add SO_RCVTIMEO (5s) on accepted client sockets to prevent indefinite
  blocking from incomplete requests
- Move 64KB httpBuf/respBuf from stack to static globals
- Fix SendAll infinite loop when send() returns 0 (check n <= 0)
- Ignore SIGPIPE to prevent crash on client disconnect during writes
- Use case-insensitive Content-Length header matching per RFC 7230
- Track error state and return nonzero from main on fatal errors
- Reset ret after wolfSSL_CertManagerLoadCABuffer to avoid leaking
  WOLFSSL_SUCCESS (1) into error paths in ocsp-request-response.c
- Add -Wextra to Makefile CFLAGS
2026-04-09 19:06:33 +02:00
Sameeh Jubran 330c9b258b wc_http_sig: remove extra braces around header lookup loop
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-04-09 13:32:58 +03: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
Juliusz Sosinowicz 1f6aa9c259 Address code review feedback for OCSP responder examples
- Add missing <time.h> include for time(NULL) usage
- Replace atoi() with strtol() and validate Content-Length in RecvHttp
  and ParsePost to reject negative/overflowing values
- Add SendAll() helper to handle partial send() writes
- Check return values of socket(), setsockopt(), and listen()
2026-04-08 11:31:35 +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
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
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
David Garske 9afdb0603c
Merge pull request #556 from sebastian-carpenter/client-ech-fix
fixing up ech examples
2026-03-21 15:50:42 -07:00
David Garske 52e44499f0
Merge pull request #563 from padelsbach/padelsbach/aesgcm-rdseed
Extend AES minimal and rdseed examples
2026-03-21 15:21:50 -07:00
Paul Adelsbach 1ac9c87c3b Extend minimal and rdseed examples 2026-03-20 15:27:46 -07:00
tmael 498d78e6d3
Merge pull request #562 from padelsbach/aes256-gcm-minimal
Add minimal buffer encrypt and decrypt example for AES-GCM
2026-03-12 10:17:02 -07:00
Paul Adelsbach 62476b1871 Add minimal buffer encrypt and decrypt example for AES-GCM 2026-03-12 09:52:47 -07:00
JacobBarthelmeh f2dec15dde
Merge pull request #560 from embhorn/fix_psk_resume_client
Set ssl to null after free to avoid double free
2026-02-24 14:52:02 -07:00
Eric Blankenhorn 205ff32c6e Set ssl to null after free to avoid double free 2026-02-24 15:36:39 -06:00
sebastian-carpenter 0e45f2fe9f fixing up ech examples + GREASE ECH example 2026-02-24 14:14:17 -07:00
JacobBarthelmeh a71710ec4f
Merge pull request #554 from anhu/dtlsmcast
Add DTLS 1.2 Mulicast Example.
2026-02-24 09:32:32 -07:00
Anthony Hu dfed0437ab Add DTLS 1.2 Mulicast Example. 2026-02-24 03:36:57 -05:00
David Garske a9d5b45b15
Merge pull request #366 from JacobBarthelmeh/pkcs12
adjust pkcs12 example to print out list of certificates found
2026-02-19 08:54:23 -08:00
Kaleb Himes 1e3c2a204a
Merge pull request #559 from danielinux/uefi-library
Added `uefi-library`: wolfCrypt as UEFI driver
2026-02-19 09:50:56 -07:00
JacobBarthelmeh b62a9c6009 change print buffer function name and use word32 for derSz 2026-02-18 17:02:01 -07:00
Jacob Barthelmeh 2aa1f85d3a improvements to example print out 2026-02-18 16:57:15 -07:00
JacobBarthelmeh 43a35469d9 adjust pkcs12 example to print out list of certificates found 2026-02-18 16:57:15 -07:00
Daniele Lacamera c92a922aea Added `uefi-library`: wolfCrypt as UEFI driver 2026-02-18 18:54:14 +01:00
David Garske 8e47edbf64
Merge pull request #557 from LinuxJedi/pico-fixes
Fixes to the Pi Pico build
2026-02-16 13:49:11 -08:00
David Garske eaea8523d9
Merge pull request #558 from LinuxJedi/pico-time-fix
Fix handling of `XTIME(0)`
2026-02-16 13:00:53 -08:00
Andrew Hutchings a469e04dbe
Merge pull request #476 from ColtonWilley/pkcs11_example_certs
Extend PKCS11 server example for certificate handling
2026-02-16 09:39:45 +00:00
Andrew Hutchings 9337dc00b5 Fix handling of `XTIME(0)`
It should behave more like `time()`.
2026-02-16 09:32:18 +00:00
Andrew Hutchings b821577eaf Fixes to the Pi Pico build
* Don't require FreeRTOS if we are doing a bare metal bench / test build
* Make stack checking stricter and increase stack size for DH
* Set alignment to 0, this fixes LMS if that is compiled-in
* `WOLFSSL_SP_MATH` and `WOLFSSL_SP_MATH_ALL` can't be used together
* Loop the benchmark
2026-02-12 14:56:18 +00:00
David Garske a2217c6e75
Merge pull request #539 from anhu/certmanager_ocsp
Show OCSP checking via CertManager
2026-02-05 08:44:07 -08:00
Anthony Hu 50d513b6d9 Show OCSP checking via CertManager 2026-02-03 16:26:25 -05:00
JacobBarthelmeh 9ada2ac95c
Merge pull request #553 from dgarske/stsafe-a120
Example for ST-SAFE A120
2026-01-23 11:04:29 -07:00
David Garske 22e2aa3197 Fix for ECDHE 2026-01-22 22:49:08 +00:00
David Garske de26517d51 Improvements to Makefile and examples 2026-01-21 00:03:05 +00:00
David Garske 1f0076dcf9 Added tests for brainpool curves and proper macro checking 2026-01-19 19:53:46 +00:00
David Garske 407922b85f Added ECDHE 2026-01-15 20:03:41 +00:00
David Garske b03db3bad8 Simplify testing 2026-01-12 21:15:02 +00:00
David Garske d212422971 Enable small stack 2026-01-06 19:01:26 +00:00
David Garske bd0c85ebc6 Implemented all required SDK cryptographic wrappers. 2026-01-06 18:07:38 +00:00
David Garske a4072803f2 Example for ST-SAFE A120 2026-01-06 00:27:27 +00:00
David Garske 45616142ca
Merge pull request #552 from anhu/25519_rng
Curve25519 needs an RNG for blinding
2025-12-31 11:26:56 -08:00
David Garske 6ba165d1ec
Merge pull request #550 from anhu/dtls_imp_exp
Show how to do DTLS import and export
2025-12-30 13:21:13 -08:00
Anthony Hu 1c824034d6 Curve25519 needs an RNG for blinding 2025-12-30 16:05:57 -05:00
Anthony Hu e99ba1f24c Fix copy and paste errors. 2025-12-30 14:53:11 -05:00