Commit Graph

11236 Commits

Author SHA1 Message Date
Tesfa Mae dbf4aaa5be TA100: follow-up changes (squash after 4e64cb56) 2026-05-08 18:50:43 +02:00
Tesfa Mae 00cca3e25b TA100: Microchip Trust Anchor support RSA/ECC 2026-05-08 18:50:43 +02:00
Sean Parkinson 69a378461a Merge pull request #10406 from Frauschi/lms_xmss_certs
Support RFC 9802 LMS and XMSS in X.509 verification
2026-05-08 11:48:34 +10:00
David Garske 2b042709f2 Merge pull request #10427 from cconlon/setAsymKeyDerVersion
Set PKCS#8 version correctly in SetAsymKeyDer() when publicKey is bundled
2026-05-07 16:12:18 -07:00
David Garske fea8d1b5bc Merge pull request #10413 from JeremiahM37/fenrir-7
zeroize sensitive memory and validate public API inputs
2026-05-07 14:47:32 -07:00
David Garske 9a46ecb263 Merge pull request #10380 from padelsbach/lms-xmss
Add crypto callbacks for LMS and XMSS
2026-05-07 14:46:56 -07:00
David Garske 58ca6a1fa7 Merge pull request #10302 from JacobBarthelmeh/ecc
additional sanity checks on invalid input
2026-05-07 14:39:21 -07:00
David Garske 80a04551cf Merge pull request #10405 from SparkiDev/mlkem_fixes_1
ML-KEM: fix comments, API signatures, minor issues
2026-05-07 14:37:59 -07:00
David Garske 8c74977eee Merge pull request #10297 from kareem-wolfssl/zd21676
Properly handle fallback cipher type case in wc_Pkcs11_CryptoDevCb.
2026-05-07 14:36:05 -07:00
David Garske 6efbacf402 Merge pull request #10416 from jackctj117/v6-fix
fix: guard wc_Ed448PublicKeyToDer ed448_export_public call for FIPS<7
2026-05-07 14:32:48 -07:00
David Garske aeeb98cc04 Merge pull request #10400 from embhorn/gh10383
Fix Dilithium signing when WC_DILITHIUM_CACHE_MATRIX_A is enabled
2026-05-07 14:30:46 -07:00
David Garske 8ac2a1ae1b Merge pull request #10418 from rlm2002/coverity
20260506 Coverity
2026-05-07 14:11:32 -07:00
David Garske 52847ed7e0 Merge pull request #10420 from SparkiDev/mldsa_small_1
ML-DSA fixes: small vfy key object, small SHA-3, fix test
2026-05-07 13:52:50 -07:00
Chris Conlon 7cc84d38fb fix SetAsymKeyDer to set PKCS#8 version=1 when bundling publicKey (RFC 5958) 2026-05-07 14:05:51 -06:00
Tobias Frauenschläger 28468b44f5 Support RFC 9802 LMS and XMSS in X.509 verification
Wire the stateful hash-based signature schemes HSS/LMS (RFC 8554) and
XMSS / XMSS^MT (RFC 8391) into the X.509 cert-verification path per
RFC 9802.

asn:
- Register id-alg-hss-lms-hashsig (1.2.840.113549.1.9.16.3.17),
  id-alg-xmss-hashsig (1.3.6.1.5.5.7.6.34) and id-alg-xmssmt-hashsig
  (1.3.6.1.5.5.7.6.35) in oid_sum.h, asn.c and asn1_oid_sum.pl.
- Plumb the new keyOIDs through GetCertKey, SigOidMatchesKeyOid,
  HashForSignature, FreeSignatureCtx and ConfirmSignature so leaf
  and CA certificates parse, load and verify end-to-end.
- Rename IsSigAlgoECC -> IsSigAlgoNoParams; the function has tested
  "AlgorithmIdentifier omits NULL parameters" since PQC algos were
  added, and HSS/LMS + XMSS only made the original name more
  misleading.

wc_lms / wc_xmss:
- Add wc_XmssKey_ImportPubRaw_ex which derives parameters from the
  4-byte OID prefix at the start of the raw public key, taking an
  is_xmssmt hint to disambiguate the overlapping XMSS / XMSS^MT OID
  spaces.
- Extend wc_LmsKey_ImportPubRaw with the same auto-derive from
  u32str(L) || lmsType || lmOtsType when key->params is NULL; this
  also fixes a latent NULL-deref when the legacy precondition was
  violated.
- Reject WC_*_STATE_OK in both ImportPubRaw paths so re-importing
  on a private-key-loaded handle can't desync priv/pub.
- Tighten wc_XmssKey_Verify's length check to strict equality,
  matching wc_LmsKey_Verify and the documented contract of using
  wc_XmssKey_GetSigLen for the buffer size.

tests / fixtures:
- Bouncy Castle 1.81 fixtures in certs/lms and certs/xmss covering
  every supported parameter set, plus CA->leaf chains per family
  and one BC-native LMS fixture as a cross-impl interop gate.
- New api tests verify each fixture end-to-end, tamper TBS and
  signature bytes, exercise the wolfCrypt-level negative paths
  (NOT_COMPILED_IN, BUFFER_E, BAD_FUNC_ARG, BAD_STATE_E, OID/family
  mismatch, partial-write invariants, lenient VERIFYONLY re-import,
  strict sigLen check) and confirm the outer signatureAlgorithm
  OID is rejected when it disagrees with the SPKI in both
  XMSS<->XMSS^MT directions.
2026-05-07 17:14:31 +02:00
Eric Blankenhorn 935c3901d9 Fix from review 2026-05-07 07:34:39 -05:00
Eric Blankenhorn 8ce4e126ae Fix from review 2026-05-07 07:34:39 -05:00
Eric Blankenhorn 4191d46d95 Fix Dilithium signing when WC_DILITHIUM_CACHE_MATRIX_A is enabled 2026-05-07 07:34:39 -05:00
Sean Parkinson e98fb8f72b Merge pull request #10415 from douzzer/20260506-fixes
20260506-fixes
2026-05-07 17:00:02 +10:00
Daniel Pouzzner d86174cc50 src/ssl.c: in wolfSSL_check_domain_name(), use XSTRCMP(), not strcmp();
wolfcrypt/src/asn.c, wolfssl/wolfcrypt/asn.h, src/ssl.c, wolfssl/ssl.h: move wolfssl_local_IsValidFQDN() from ASN.1 layer (where it has no users and is gated out in lean PSK builds) to TLS layer (where its users are);

scripts/crl-revoked.test: use `cp --symbolic-link` opportunistically but fall back to `cp -p`.
2026-05-06 21:40:33 -05:00
Jeremiah Mackey a075a99729 evp: fix sm4-ctr debug message 2026-05-07 02:31:25 +00:00
Jeremiah Mackey 8667bd0f92 wolfcrypt: validate API input sizes 2026-05-07 02:31:25 +00:00
Jeremiah Mackey 90eb7253b6 wolfcrypt: zero sensitive buffers 2026-05-07 02:31:25 +00:00
Jeremiah Mackey a454248791 eddsa: zero orig_k after sign 2026-05-07 02:31:25 +00:00
Jeremiah Mackey 6711389e3b pkcs7: zero plaintext before free 2026-05-07 02:31:25 +00:00
Jeremiah Mackey a2aa3691f0 srp: harden secret intermediates 2026-05-07 02:31:25 +00:00
Paul Adelsbach 7f5138fb9a More review feedback: pass hash to LMS export, and drop len check in XMSS verify 2026-05-06 17:46:42 -07:00
Sean Parkinson 55d7ed8d0e ML-DSA fixes: small vfy key object, small SHA-3, fix test
Only have the public key in the ML-DSA key object when verify-only.
Be able to leave out SHA-3 APIs when only needing SHAKE.
Fix ML-DSA testing to only have data for compiled in parameters.
2026-05-07 10:03:41 +10:00
Sean Parkinson 15398c26d0 ML-KEM: fix comments, API signatures, minor issues
More checks for public or private key not set.
wc_MlKemKey_Free clears key->flags
wc_MlKemKey_DecodePrivateKey now checks the public key is valid.
wc_MlKemKey_EncodePrivateKey doesn't need calculate hash of public key
as encoding the public key will do this.
EncodePrivateKey/EncodePublicKey now return BAD_STATE_E when flags not
set.
mlkem_kdf, mlkem_check_public, mlkem_xof_absorb pointer parameters are
now const.
Now all mlkem_redistribute_*_rand_avx2 functions are WOLFSSL_LOCAL.
Changed Kyber uses to MlKem.
2026-05-07 08:17:27 +10:00
Kareem 3f1c6bdac8 Code review feedback. 2026-05-06 15:13:48 -07:00
Kareem d1b6ddca75 Properly handle fallback cipher type case in wc_Pkcs11_CryptoDevCb.
Thanks to Zou Dikai for the report.
2026-05-06 15:12:09 -07:00
Ruby Martin e085d468d8 clear potential null dereference 2026-05-06 14:33:14 -06:00
jackctj117 a3799cffda fix: guard wc_Ed448PublicKeyToDer ed448_export_public call for FIPS<7 2026-05-06 14:09:56 -06:00
Daniel Pouzzner 03cee6f2bf tests/api/test_ed25519.c and tests/api/test_ed448.c: add missing FIPS v7+ gating in test_wc_ed25519_export() and test_wc_ed448_export().
wolfcrypt/test/test.c: in aes_cbc_test(), use unconditional static on msg4 and verify4 to work around gcc optimizer bug (probably same bug as noted in ac11279c60).
2026-05-06 14:24:18 -05:00
David Garske 490c1062e4 Merge pull request #10274 from gasbytes/crl-idp-extension-fix-follow-up
Reject CRLs with unrecognized critical entry extensions per RFC 5280 section 5.3
2026-05-06 12:13:28 -07:00
Paul Adelsbach 0f2c526ee2 Add missing WC_NO_ERR_TRACE 2026-05-06 11:22:47 -07:00
Paul Adelsbach 8c2bf1dfd4 Remove wc_*Key_HashMsg functions and PKCS#11 references 2026-05-06 09:56:22 -07:00
Ruby Martin d960d02c80 compare against MAX_UNICODE_SZ, readability change 2026-05-06 09:28:43 -06:00
Ruby Martin dbdd066737 remove dead length check 2026-05-06 09:24:01 -06:00
Juliusz Sosinowicz 061311d6ca zd/21661: harden X.509 chain validation, session ticket identity binding, and peer cert restore
- x509_str: require CA:TRUE unconditionally in wolfSSL_X509_verify_cert;
  verify leaf signature even when verify_cb overrides INVALID_CA
- x509_str: align WOLFSSL_X509_V_ERR_INVALID_CA with OpenSSL value (79)
  so OPENSSL_COEXIST builds compile; bump WC_OSSL_V509_V_ERR_MAX to 80
  and extend error_test() missing-value table for the new gaps
- asn: reject embedded NUL in dNSName / rfc822Name / URI SAN entries
- internal: re-verify restored ticket peer cert against trust store with
  CRL/OCSP checks; clear stale state from session cache on verification
  failure
- ticket: bind SNI and ALPN into session ticket via compile-time selected
  hash (TICKET_BINDING_HASH_TYPE); reject resumption on mismatch in both
  TLS 1.3 and TLS 1.2 paths
- ticket: defer SNI/ALPN binding check until after extensions are parsed
  by consolidating into VerifyTicketBinding(), called once after
  ALPN_Select in DoTls13ClientHello and DoClientHello; the early
  per-call sites ran before extensions were parsed and rejected valid
  resumptions in nginx, haproxy, grpc, and CPython integration tests
- ssl_sess: free previous session in wolfSSL_d2i_SSL_SESSION before
  overwrite
- examples/client: increase SESSION_TICKET_LEN fallback from 256 to 2048
  to support larger tickets
- tests: update SAN NUL fixtures and add parse-time rejection coverage;
  add test_tls13_ticket_peer_cert_reverify for CA-removal scenario; skip
  it under WOLFSSL_NO_DEF_TICKET_ENC_CB
2026-05-06 16:45:58 +02:00
JacobBarthelmeh f140546ba1 add sanity check of hash to atmel port 2026-05-06 08:34:50 -06:00
Daniel Pouzzner 50da0c0a26 Merge pull request #10390 from Frauschi/lms_Wconversion
LMS Wconversion fixes
2026-05-06 09:16:23 -05:00
Daniel Pouzzner 29343708df Merge pull request #10391 from Frauschi/xmss_Wconversion
XMSS Wconversion fixes
2026-05-06 09:15:59 -05:00
Tobias Frauenschläger 2833a4b1e8 ML-DSA Wconversion fixes 2026-05-06 15:33:17 +02:00
Tobias Frauenschläger 40b583fbcb Wconversion fixes for LMS 2026-05-06 15:31:00 +02:00
Tobias Frauenschläger fe353af409 XMSS Wconversion fixes 2026-05-06 15:29:08 +02:00
Paul Adelsbach 7906e67c14 Address PR comments 2026-05-05 13:46:45 -07:00
Paul Adelsbach b9eb7c1ff8 Add crypto callbacks for LMS and XMSS 2026-05-05 13:46:41 -07:00
David Garske 13f459127c Merge pull request #10372 from MarkAtwood/fix/ed448-der-const
fix: add const to wc_Ed448 DER export function key parameters
2026-05-05 12:49:30 -07:00
David Garske 44564dd5fd Merge pull request #10368 from holtrop-wolfssl/gh10359
Allow SubjectInfoAccess extension without id-ad-caRepository entry
2026-05-05 12:49:19 -07:00