1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00
Commit Graph

1345 Commits

Author SHA1 Message Date
Marco Oliverio
5d1903ff34 dtls13: support session export and import
wolfSSL_dtls_export()/wolfSSL_dtls_import() only ever carried a DTLS 1.2
session. A DTLS 1.3 connection additionally keeps a table of epochs, each
with its own traffic secret, record and record number keys, sequence numbers
and replay window, and none of that was serialized.

Export version 7 adds two trailing sections to the blob, the DTLS 1.3 record
layer state and the Connection ID, both length prefixed so a reader that does
not know a section can step over it and a version 6 blob still imports.

- dtls13: serialize the send epoch, the peer epoch and, when there is one,
  the previous peer epoch: epoch numbers, sequence numbers, replay window,
  traffic secrets and key material. Import re-derives the record keys through
  Tls13DeriveRecordKeys(), the same expansion the handshake runs
- dtls: carry a tx Connection ID of any length. The peer picks it and RFC 9146
  bounds it only by its one byte length field, so DTLS_CID_MAX_SIZE may not
  refuse it. The rx id keeps that bound: it is the one we hand the peer and it
  has to fit the record layer buffers. Clear the target's CID when the blob
  carries none

Refusals, so a blob never describes a connection that cannot be restored:
- refuse to export a half sent fragmented handshake message, or while a write
  dup still has work parked
- refuse a state only import into a DTLS 1.3 session, and keep stamping the
  state only blob with export version 6
- require the imported epochs to be the ones the blob names, reset the epoch
  table on import and commit a slot only once every field of it has been read

Bounds checking on the import path:
- keep every exported section inside the buffer the caller sized, and step
  over the import sections by their declared length
- check the imported epoch key lengths against the negotiated suite and the
  traffic secret length against the hash
- size the exported key state from the build's own cipher sizes
- scrub the session export scratch buffer before freeing it
- use IsAtLeastTLSv1_3() for the imported version check

CI: build the session export job with Connection ID support.
2026-08-26 18:42:12 +02:00
philljj
a417ee3a4c Merge pull request #11038 from gasbytes/dupcrl_entry-copies-fix
Deep copy revoked cert entry extensions in DupCRL_Entry()
2026-08-25 13:36:51 -05:00
philljj
514af438d7 Merge pull request #11156 from gasbytes/x509_store_ctx_verify_cb_fix
Report X509_VERIFY_PARAM hostname/IP mismatches to the verify callback so applications can inspect or override them
2026-08-25 09:38:08 -05:00
Reda Chouk
53647f9dcd Deep copy revoked cert entry extensions in DupCRL_Entry() when CRL_STATIC_REVOKED_LIST and OPENSSL_EXTRA are enabled, and add a regression test for the X509_CRL_dup path. 2026-08-25 16:04:26 +02:00
philljj
33824d8053 Merge pull request #11006 from rlm2002/coverity
20260729 Coverity fixes
2026-08-25 08:46:03 -05:00
Sean Parkinson
94dca6fdd4 Merge pull request #11228 from aidangarske/fenrir-fixes-9961
Encode default cert validity as UTCTime through 2049
2026-08-25 17:16:56 +10:00
Sean Parkinson
6c36c71c5f Merge pull request #11237 from holtrop-wolfssl/f-7106
wolfssl_local_MatchBaseName: fix 1-byte read out of bounds looking for "@"
2026-08-25 16:09:06 +10:00
Sean Parkinson
e15720e4e3 Merge pull request #11185 from embhorn/zd22296
Enforce RFC 8446 SHA-1 certificate rule on TLS 1.3 chains
2026-08-25 11:07:37 +10:00
Sean Parkinson
2cda28008c Merge pull request #10992 from padelsbach/sm2-verify-overlap-test
Add SM2 verify hash test with identical points
2026-08-25 10:08:28 +10:00
JacobBarthelmeh
678a065f10 Merge pull request #11248 from night1rider/ASU-ECIES-Improvements
Asu ecies improvements
2026-08-24 16:42:06 -06:00
philljj
f8b140f511 Merge pull request #11204 from padelsbach/falcon-cb-free
Add CB_FREE mode for Falcon
2026-08-24 16:30:18 -05:00
night1rider
69786c2f00 Add unit test coverage for wc_ecc_ctx_get_rng 2026-08-24 14:13:37 -06:00
JacobBarthelmeh
ff17d489d3 Merge pull request #11209 from night1rider/curve448-callbacks
Add curve448 crypto callback support
2026-08-24 09:50:17 -06:00
JacobBarthelmeh
74b8207b72 Merge pull request #11053 from night1rider/Xilinx-ASU-ECC-standalone
Xilinx asu ecc standalone
2026-08-24 09:46:02 -06:00
night1rider
5dd72727cb Fix curve448 test guards for CB_FIND and zero-check builds, cover cb zero result 2026-08-21 17:04:19 -06:00
night1rider
06abdc18e6 Only offload a key-owned X448 private scalar to that key's own device
wc_curve448_make_key and wc_curve448_export_public_ex derived the public
point through the keyless wc_curve448_make_pub, which dispatches to the
first registered device; route them through a devId-carrying helper.
2026-08-21 17:04:19 -06:00
night1rider
93d71fdda9 Address second round of review findings on curve448 cryptocb support
Restore key devId on the keygen stub's error return, full-buffer-check
callback output, cover the new/delete NULL out-params, drop a dead guard.
2026-08-21 17:04:19 -06:00
night1rider
eb1cde51ab Address review findings on curve448 cryptocb support
Assert cryptocb output in curve448_onlycb_test, reject an all-zero
wc_curve448_generic result, guard the new API test for CB-only builds.
2026-08-21 17:04:18 -06:00
night1rider
3d7f7ad4d6 Add curve448 crypto callback support
Mirror curve25519: keygen, shared secret, make pub and generic
callbacks, wc_curve448_init_ex/new/delete, new wc_curve448_generic
API with scalar clamp checks, WOLF_CRYPTO_CB_ONLY_CURVE448 mode,
TLS devId plumbing, tests (test.c, api unit tests, swdev),
benchmark devId, CI entries.
2026-08-21 17:04:18 -06:00
Ruby Martin
589b9eb4bf Free the unexpected return in test_wolfSSL_load_client_CA_file 2026-08-21 16:50:11 -06:00
Josh Holtrop
4eb192d4c8 wolfssl_local_MatchBaseName: fix 1-byte read out of bounds looking for "@"
Fixes F-7106
2026-08-21 15:47:05 -04:00
Ruby Martin
b9575d9502 Assert TLSX_GetRequestSize matches TLSX_WriteRequest in cookie echo test 2026-08-21 11:43:16 -06:00
philljj
c5d9483cce Merge pull request #11097 from julek-wolfssl/tls13-0rtt-middlebox-fixes
TLS 1.3: fix early data decryption handling and middlebox compat build option
2026-08-21 10:35:09 -05:00
Reda Chouk
94f939cfbd Report X509_VERIFY_PARAM hostname/IP mismatches to the verify callback so applications can inspect or override them 2026-08-21 15:13:09 +02:00
Aidan Garske
1c73648177 F-9961 - Encode default cert validity as UTCTime through 2049 2026-08-20 18:38:39 -07:00
Paul Adelsbach
cecf35171d PR feedback: test updates, invalidate shake.devId 2026-08-20 17:46:42 -07:00
Ruby Martin
f71194b839 Free the i2d output buffer in test_wc_PKCS12DecisionCoverage 2026-08-20 16:31:04 -06:00
Ruby Martin
259b291f42 test_ssl_crl_ocsp.c: free parsed URL parts on the failure path 2026-08-20 15:51:35 -06:00
philljj
9ab8a4b19d Merge pull request #11172 from dgarske/fenrir_threadsafety_keys
Thread safety and private key handling
2026-08-20 16:32:51 -05:00
Ruby Martin
dd04f301b1 prevent uninitialized scalar variable issue 2026-08-20 13:11:32 -06:00
philljj
27de130fb0 Merge pull request #11170 from dgarske/fenrir_align_ports
Alignment and vendor port hardening
2026-08-20 11:38:30 -05:00
JacobBarthelmeh
87d41e2dd5 Merge pull request #11140 from holtrop-wolfssl/zd22282
Fix directoryName NameConstraints bypass
2026-08-20 09:21:47 -06:00
philljj
3fe6dc1503 Merge pull request #11101 from padelsbach/client-cookie-enable
Add separate client cookie enable config
2026-08-20 10:12:23 -05:00
philljj
19755092a8 Merge pull request #11153 from yosuke-wolfssl/fix/f_7075
Fix TSP message imprint algorithm/digest length consistency
2026-08-20 09:35:12 -05:00
night1rider
aa1f85114b Xilinx Versal Gen2 ASU: fix the Vitis build and correct the benchmark rows
The config probe now uses the target include path, and ARM assembly builds in
both modes. Documents the ECIES hardware path, drops a dead protocol branch,
declines a zero length message, and builds the ECC request helpers only where
they are called. Benchmark rows no longer claim hardware they cannot reach.
2026-08-20 08:14:14 -06:00
David Garske
8bffaff697 Check ECC private key scalar range on import (F-1930, F-1931) 2026-08-19 23:54:09 -04:00
David Garske
212b70cf35 Add SHA-256 unaligned block hashing regression test (F-3344) 2026-08-19 23:49:43 -04:00
Juliusz Sosinowicz
3abaff7e8e Address review: cover the fresh start check error returns
wolfSSL_CTX_no_early_data_fresh_start_check() only had success path
coverage. Test BAD_FUNC_ARG for a NULL and a TLS 1.2 ctx, and SIDE_ERROR
for a client ctx. Document the clock requirement on the public API.
2026-08-20 02:19:07 +00:00
Juliusz Sosinowicz
88d4bdf05f Address review: CMake option sync and test record-scan bounds
- The JNI bundle appends -DWOLFSSL_TLS13_MIDDLEBOX_COMPAT straight to
  WOLFSSL_DEFINITIONS, leaving the option at 'no'. The ECH conflict check
  then tested a variable that never became true, so both features stayed
  enabled. Sync the option with the definitions list.
- Validate recLen and the record end against s_len before flipping the
  payload byte; the loop could index one past the buffer.
2026-08-20 02:19:07 +00:00
Juliusz Sosinowicz
978d795701 TLS 1.3: reject 0-RTT for tickets minted before the server ctx was created
RFC 8446 Section 8.2 recommends that freshly started servers reject
0-RTT while their anti-replay state cannot cover the ticket. A restarted
server that keeps its session cache or ticket encryption keys would
otherwise accept early data it cannot check for replays. Record the ctx
creation time and refuse early data, but not resumption, when the ticket
was minted by a previous instance. Deployments whose anti-replay state
reliably survives restarts can opt out with
wolfSSL_CTX_no_early_data_fresh_start_check(). Fixes #11013.
2026-08-20 02:19:07 +00:00
Juliusz Sosinowicz
16231de0ce Add build option for TLS 1.3 middlebox compatibility mode
Declare WOLFSSL_TLS13_MIDDLEBOX_COMPAT as a real CMake option and add
--enable-tls13-middlebox-compat to configure. Previously CMake accepted
-DWOLFSSL_TLS13_MIDDLEBOX_COMPAT=yes, advertised the macro in the
generated options.h, but never passed it to the library compile. Such a
build sent an empty legacy_session_id instead of the non-empty 32-byte
value RFC 8446 Section 4.1.2 requires in compatibility mode. Fixes
#11012. Fixes #11014.
2026-08-20 02:19:07 +00:00
Juliusz Sosinowicz
56dfde0df2 TLS 1.3: fatal bad_record_mac for accepted early data that fails decryption
Only skip undecryptable records when the server rejected early data. Once
the server has accepted the early_data extension, RFC 8446 Section 4.2.10
requires a decrypt failure on a 0-RTT record to terminate the connection
with a fatal bad_record_mac alert. Fixes #11011.
2026-08-20 02:19:07 +00:00
Paul Adelsbach
07edb52139 PR feedback: add/update tests, ensure devId is invalidated 2026-08-19 17:05:23 -07:00
philljj
ac4e90b779 Merge pull request #11122 from danielinux/mcdc-test-coverage
Mcdc test coverage - part 6
2026-08-19 17:55:55 -05:00
Paul Adelsbach
9d7ec9aa96 Fix test issue with WOLFSSL_TLS13_COOKIE 2026-08-19 13:54:49 -07:00
Paul Adelsbach
346543b3cb PR feedback: add cookie size check, remove braces, update comment 2026-08-19 13:54:48 -07:00
Paul Adelsbach
3e1e6b2bf8 Add separate client cookie enable 2026-08-19 13:54:48 -07:00
philljj
66865d3f5b Merge pull request #10362 from MarkAtwood/fix/d2i-ecprivatekey-pubkey-derive
fix: d2i_ECPrivateKey derives public key when absent from DER (ZD-21732)
2026-08-19 09:21:05 -05:00
Josh Holtrop
6ab329ce45 asn.c: map code points to SPACE for directory string per RFC 4518 2.2 2026-08-19 09:42:21 -04:00
night1rider
fe30f3fcf7 Xilinx Versal Gen2 ASU port: ECC, ECDH, ECIES and EdDSA offload 2026-08-19 03:07:37 -06:00