Commit Graph

28981 Commits

Author SHA1 Message Date
Kareem 3e04475875 Fix unused variable error 2026-04-22 15:22:36 -07:00
Kareem ebdcc03b71 Code review feedback 2026-04-22 15:22:36 -07:00
Kareem 1397268aa1 In wc_PKCS7_DecodeEnvelopedData, confirm encryptedContentTotalSz does not exceed the total message size before using it in the non-streaming case.
Thanks to Zou Dikai for the report.
2026-04-22 15:22:36 -07:00
Kareem 7f218574c4 Ensure esd->signedAttribsCount contains the correct count in case some are skipped by using the current idx rather than the total array size.
Thanks to Zou Dikai for the report.
2026-04-22 15:22:36 -07:00
JacobBarthelmeh b5738236d9 Merge pull request #10187 from embhorn/zd21587
Fixes in TLS ECH, handle empty records, and ASN len check
2026-04-22 14:44:15 -06:00
JacobBarthelmeh bc4bec63fc Merge pull request #10094 from sebastian-carpenter/GH-10068
Fixes: for GH #10068
2026-04-22 14:24:25 -06:00
JacobBarthelmeh c098e53948 Merge pull request #10247 from julek-wolfssl/fenrir/20260417
Fenrir fixes
2026-04-21 16:26:38 -06:00
JacobBarthelmeh c6f8e845ee Merge pull request #10267 from holtrop-wolfssl/rust-chacha20_poly1305-oneshot-buffer-length-check
Rust wrapper: add buffer size checks in Rust wrapper for ChaCha20_Poly1305 one-shot encrypt/decrypt wrappers
2026-04-21 16:19:29 -06:00
JacobBarthelmeh 98cd7fe404 Merge pull request #10265 from ejohnstown/qnx-fix
Tasking Warning
2026-04-21 16:18:38 -06:00
Sean Parkinson 353a379bd7 Merge pull request #10262 from douzzer/20260420-test-fixes
20260420-test-fixes
2026-04-21 10:23:46 +10:00
Sean Parkinson 967780f1b7 Merge pull request #10239 from gasbytes/crl-idp-extension-fix
reject crls with unrecognized critical extensions
2026-04-21 10:21:31 +10:00
JacobBarthelmeh ad8b6dbc32 Merge pull request #10217 from ColtonWilley/null-checks-evp-ocsp-x509
Fix NULL derefs, buffer overflow, and i2d contract in EVP/OCSP/X509
2026-04-20 17:27:19 -06:00
Sean Parkinson a0bfcbba54 Merge pull request #10245 from Frauschi/small_stack
Make sure large buffers are on the heap with SMALL_STACK
2026-04-21 08:47:59 +10:00
Daniel Pouzzner 956f057e73 scripts/pem.test: correctly compute and use SRC_DIR, and fix whitespace. 2026-04-20 17:42:29 -05:00
Daniel Pouzzner 7e67274ebe scripts/pem.test: add more missing feature sensing and conditions. 2026-04-20 15:24:28 -05:00
Daniel Pouzzner eff2fcd513 scripts/pem.test: refactor to eliminate dependence on bash [[ -v foo ]] construct. 2026-04-20 13:49:53 -05:00
Josh Holtrop a2b1f580c6 Rust wrapper: add buffer size checks in Rust wrapper for ChaCha20_Poly1305 one-shot encrypt/decrypt wrappers 2026-04-20 13:58:36 -04:00
Daniel Pouzzner 8b6739296c examples/pem/pem.c: don't wolfCrypt_Cleanup() unless wolfcrypt_inited;
scripts/pem.test:
* add setup for WOLFSSL_NO_DER_TO_PEM,
* exit early with skip code if executable dependencies are missing or WOLFSSL_NO_PEM or NO_CODING, and
* add clean skip clauses to convert_to_pem(), compare_pem(), and pem_der_exp(), if WOLFSSL_NO_DER_TO_PEM.
2026-04-20 12:47:36 -05:00
Juliusz Sosinowicz a010825bb0 Address review comments on Fenrir zeroization fixes
Two follow-ups raised by Copilot review on PR #10247:

src/pk_rsa.c: Make derAllocSz a word32 instead of int and only assign
it after a successful XMALLOC, so the cleanup path can never call
ForceZero with a wrapped-around size derived from a negative derSz.

src/pk.c: Capture allocSz at the XMALLOC call site (and clear it back
to 0 on allocation failure) so the relationship between the buffer
allocation and the recorded size is explicit and cannot drift if the
surrounding control flow changes.
2026-04-20 16:12:30 +00:00
Daniel Pouzzner e601e04444 fix examples/pem/ and scripts/pem.test:
examples/pem/pem.c:
* improve error messages,
* add wc_SetSeed_Cb() if WC_RNG_SEED_CB, and
* add wolfCrypt_Init() and wolfCrypt_Cleanup().

scripts/pem.test:
* fix exit code to unmask script failure,
* add configured feature detection,
* improve error messages and handling,
* add configuration gating around subtests, and
* comment out currently failing subtests.
2026-04-20 10:26:09 -05:00
Daniel Pouzzner 8c3d471ce1 linuxkm/module_hooks.c: in wolfssl_init() FIPS_OPTEST_FULL_RUN_AT_MODULE_INIT code path (currently unused), add missing declaration for i. 2026-04-20 10:19:33 -05:00
Daniel Pouzzner a7bf5e5989 wolfcrypt/test/test.c: add missing FIPS gating for backward-incompatible NULL arg tests in hkdf_test() and srtpkdf_test(). 2026-04-20 10:17:31 -05:00
Tobias Frauenschläger 847f3d6bab Make sure large buffers are on the heap with SMALL_STACK 2026-04-19 20:38:41 +02:00
Sean Parkinson fa9f24ff27 Merge pull request #10223 from rlm2002/zd21611
CN constraints fix
2026-04-19 21:28:29 +10:00
Sean Parkinson d577ea3228 Merge pull request #10238 from JeremiahM37/fenrir-issues-4
Fix UAF in Delete wrappers, harden KDF and LMS signing
2026-04-19 21:18:44 +10:00
Ruby Martin 797ba3f03b test DNS name constraints on CA are applied against Subject CN name when SAN name is unavailable
test correct CN with no SAN available is accepted
2026-04-17 12:10:25 -06:00
Mattia Moffa 7bf63e91ff Remove now useless check 2026-04-17 20:05:08 +02:00
Reda Chouk 857141da35 reject crls with unrecognized critical extensions per rfc 5280 section 5.2 2026-04-17 19:36:55 +02:00
Mattia Moffa 807214dc55 Avoid unneeded temporary stack buffer; remove redundant check 2026-04-17 19:32:23 +02:00
John Safranek 6f89331377 Tasking Warning
Tasking compiler does not support #warning and needs the #pragma message
case where available. This will fix the wolfSSH QNX nightly from
failing.
2026-04-17 09:52:00 -07:00
David Garske c4c71eece3 Merge pull request #10085 from Frauschi/rfc8773bis-cert-with-extern-psk
Add RFC8773(bis) cert_with_extern_psk support
2026-04-17 09:43:20 -07:00
David Garske 423b47177c Merge pull request #10243 from night1rider/SHE-doxygen-clean
Add SHE doxygen so documentation can pick up the API and notes.
2026-04-17 09:36:05 -07:00
David Garske 1f271855fc Merge pull request #10241 from SparkiDev/asm_gen_refactor_1
ASM files: generation script refactor output
2026-04-17 09:35:03 -07:00
Juliusz Sosinowicz 1e040923c6 Only zero unused tail of PKCS#8 PEM buffer
F-2148

The prior fix zeroed the computed DER staging area, but PEM output from
wc_DerToPemEx fills most of the buffer and overlaps that region,
corrupting the valid PEM. Preserve the allocation size and zero only
the bytes beyond the actual PEM length, or the whole buffer on failure.
2026-04-17 17:02:58 +02:00
Juliusz Sosinowicz 00fff0f3fc Zeroize PKCS#8 DER staging area in PEM write helper
F-2148

pem_write_mem_pkcs8privatekey stages the PKCS#8 DER encoded private key
at the tail of the PEM buffer, then writes the shorter PEM output at
the head of the same buffer. The DER tail is not overwritten, leaking
the plaintext private key to heap memory after the callers free. Zero
the DER staging area before returning.
2026-04-17 16:48:06 +02:00
Juliusz Sosinowicz 87e5c62111 Zeroize EC DER buffer in i2d_ECPrivateKey error path
F-2147

The error path in wolfSSL_i2d_ECPrivateKey could free an EC private key
DER staging buffer that may contain a partial private scalar. Zeroize
before XFREE.
2026-04-17 16:47:47 +02:00
Juliusz Sosinowicz 9925f90720 Zeroize RSA DER buffer in d2i_RSAPrivateKey_bio before free
F-2146

wolfSSL_d2i_RSAPrivateKey_bio read PKCS#1-encoded RSA private key DER
from a BIO into a heap buffer and freed it without ForceZero. Zeroize
before XFREE on both success and error paths.
2026-04-17 16:47:33 +02:00
Juliusz Sosinowicz a82828b3ac Zeroize RSA DER buffer in CTX_use_RSAPrivateKey before free
F-2145

wolfSSL_CTX_use_RSAPrivateKey staged the RSA private key DER (PKCS#1:
n, e, d, p, q, dP, dQ, qInv) in a heap buffer and freed it without
ForceZero. Zeroize before XFREE.
2026-04-17 16:47:19 +02:00
Juliusz Sosinowicz fa3feb7442 Zeroize static ephemeral key buffer before free
F-2144

SetStaticEphemeralKey loaded a private key file into keyBuf and freed it
without ForceZero. Static ephemeral keys are long-lived, so zeroize the
buffer before XFREE.
2026-04-17 16:46:57 +02:00
Juliusz Sosinowicz 9790719955 Zeroize sniffer watch key buffer before free
F-2143

ssl_SetWatchKey_file loaded a private key file into a heap buffer and
freed it without ForceZero on both error and success paths. Zeroize
before XFREE.
2026-04-17 16:46:43 +02:00
Juliusz Sosinowicz 4c8adc5046 Zeroize RSA DER buffer in To_Der error path
F-2142

wolfSSL_RSA_To_Der could free a buffer holding RSA private key material
when the DER encoding step failed. Record the allocation size and
ForceZero the buffer before XFREE on the private key path.
2026-04-17 16:46:24 +02:00
Juliusz Sosinowicz dfd37f4299 Zeroize EC DER buffer in PEM write error path
F-2141

The error path in wolfSSL_PEM_write_mem_ECPrivateKey freed the EC
private key DER staging buffer without ForceZero. Zeroize before free.
2026-04-17 16:45:29 +02:00
Juliusz Sosinowicz a05dd200a9 Zeroize DSA DER buffer in PEM write before free
F-2140

wolfSSL_PEM_write_mem_DSAPrivateKey serializes the DSA private key to a
heap DER buffer and freed it on five paths without ForceZero. Zeroize
the buffer before each XFREE.
2026-04-17 16:45:14 +02:00
Juliusz Sosinowicz cb495320fe Zeroize DER buffer in der_to_enc_pem_alloc before free
F-2139

Previously the plaintext private key DER buffer was freed via XFREE
without a preceding ForceZero when no password encryption was requested.
Track the actual allocation size and zeroize the buffer before release.
2026-04-17 16:44:45 +02:00
Tobias Frauenschläger 0de3925207 Add RFC8773bis cert_with_extern_psk support
Implement RFC8773bis (draft-ietf-tls-8773bis-13)
cert_with_extern_psk for TLS 1.3, including protocol checks
and API support.

Includes unit tests for API and handshake behavior as well
as tests in the testsuite using extended examples.
2026-04-17 15:12:04 +02:00
Reda Chouk fb64844924 Merge pull request #10205 from holtrop-wolfssl/rust-fenrir-fixes
Rust fenrir fixes
2026-04-17 10:32:26 +02:00
Sean Parkinson 755a90b3f3 Merge pull request #10218 from julek-wolfssl/zd/21535
Fix bugs found in crl.c, keys.c, and ssl_certman.c review
2026-04-17 10:46:48 +10:00
Sean Parkinson 318cd62d44 Merge pull request #10231 from JeremiahM37/fenrir-issues-3
Fix PEM input validation and zeroize sensitive key buffers
2026-04-17 10:44:55 +10:00
Sean Parkinson 460463aa8f Merge pull request #10166 from JeremiahM37/test-coverage
Add negative tests for TLS handshake verification paths
2026-04-17 10:41:53 +10:00
Sean Parkinson 9d1fe652b1 Merge pull request #10224 from embhorn/zd21594
Various fixes in internal.c
2026-04-17 09:44:33 +10:00