Commit Graph

1800 Commits (2151a1b8a1f8f81c4dba985429d50b76db7307e5)

Author SHA1 Message Date
Brett Nicholas 2151a1b8a1 review comments 2025-05-12 11:43:56 -06:00
Brett Nicholas 79f214f73c add new X509 API: wc_Exportx509PubKeyWithSpki 2025-05-09 14:40:20 -06:00
David Garske 1e3718ea7b
Merge pull request #8655 from SparkiDev/asn1_oid_update
ASN.1 OIDs and sum: Change algorithm for sum
2025-05-07 11:43:54 -07:00
Sean Parkinson 112351667a ASN.1 OIDs and sum: Change algorithm for sum
New sum algorithm has no clashes at this time.
Old algorithm enabled by defining: WOLFSSL_OLD_OID_SUM.
New oid_sum.h file generated with scripts/asn1_oid_sum.pl.

Added bunch of OID names into asn1 example.
2025-05-07 08:32:08 +10:00
David Garske 05a3557b2b
Merge pull request #8703 from lealem47/zd19592
Attempt wolfssl_read_bio_file in read_bio even when XFSEEK is available
2025-05-06 14:42:19 -07:00
jordan baa7efa8af Fix coverity uninit var warnings, add missing priv key ForceZero. 2025-05-05 13:14:39 -05:00
Lealem Amedie 5fe086b388 Skip PKCS8 header check in wc_CreatePKCS8Key with WOLFSSL_NO_ASN_STRICT 2025-04-22 16:58:04 -06:00
Eric Blankenhorn 66b9256f86 Fixes from CodeSonar report 2025-04-22 14:43:01 -05:00
Daniel Pouzzner 9e5c064d5d
Merge pull request #8679 from kojiws/keep_header_on_pkcs12_parse
Add wc_PKCS12_parse_ex() to keep PKCS8 header
2025-04-19 01:57:21 -05:00
Koji Takeda 039ff1b460 Add wc_PKCS12_parse_ex() 2025-04-18 06:39:16 +09:00
Kareem 038eab61d0 Add additional FPKI test OIDs. 2025-04-17 11:29:36 -07:00
Kareem 00a6c3953c Add some FPKI test OIDs which are currently being used in DoD JITC certificates. 2025-04-17 11:10:35 -07:00
Daniel Pouzzner 5b3e19c1b6
Merge pull request #8686 from miyazakh/oid_collision
fix OID collision
2025-04-17 00:54:04 -05:00
Hideki Miyazaki 62f7ff9ec2 fix OID collision
fix qt jenkins failure
2025-04-17 11:55:03 +09:00
Sean Parkinson 3ac05dea09 Regression test fixes
dtls13.c: LowResTimer() not available when NO_ASN_TIME is defined.
api.c: Add certificate and key to use for when only Ed25519 or Ed448.
asn.c: Casts needed for g++ compile.
mem_track.c: Casts needed for g++ compile.
2025-04-16 21:46:48 +10:00
Daniel Pouzzner ed5d8f8e6b update several files in wolfcrypt/src/port/arm to include libwolfssl_sources.h;
update wolfcrypt/src/port/af_alg, wolfcrypt/src/port/devcrypto, and wolfcrypt/src/port/kcapi to include libwolfssl_sources.h;

remove a slew of includes across lib sources made redundant by libwolfssl_sources.h.
2025-04-11 13:57:23 -05:00
David Garske e37dc29c1c Fixed RX TSIP RSA key creation to populate the RsaKey public material.
Fixed issue with brace when using `WOLF_CRYPTO_CB_ONLY_RSA`.
Fixed mixed declaration in `wc_RsaFunction_ex`.
Fixed missing SetMyVersion with for RSA key gen with old ASN and no PKCS12.
Added gating on RSA 1024/2048 RX TSIP build macros.
2025-04-09 12:39:48 -07:00
Daniel Pouzzner c401f5caf2 move the newly added wolfcrypt/src/wolfssl_sources.h to wolfssl/wolfcrypt/libwolfssl_sources.h, and likewise for wolfssl_sources_asm.h; revert changes to IDE/ project files. 2025-04-04 18:44:12 -05:00
Daniel Pouzzner 217440c885 Add wolfcrypt/src/wolfssl_sources.h and wolfcrypt/src/wolfssl_sources_asm.h,
which force on BUILDING_WOLFSSL and do boilerplate includes, and update library
  sources to include them at the top.

  wolfssl_sources.h includes types.h, error-crypt.h, and logging.h, and
  conditionally, config.h.  settings.h and wc_port.h are unconditionally
  included at the top of types.h.

  wolfssl_sources_asm.h includes settings.h, and conditionally, config.h.

Add wolfssl_sources*.h to wolfcrypt/src/include.am, and to several IDE/ project
  files.

Also added a TEST_WOLFSSL_SOURCES_INCLUSION_SEQUENCE clause in
  wolfssl/wolfcrypt/settings.h to allow coverage testing.

In wolfcrypt/src/misc.c, retain existing ad hoc boilerplate includes, and use
  them if WOLFSSL_VIS_FOR_TESTS, otherwise include the new wolfssl_sources.h.

Define WOLFSSL_VIS_FOR_TESTS at top of wolfcrypt/test/test.c.

Also renamed WOLFSSL_NEED_LINUX_CURRENT to WOLFSSL_LINUXKM_NEED_LINUX_CURRENT,
  for clarity.
2025-04-04 16:51:04 -05:00
Daniel Pouzzner 51c6848340 wolfcrypt/src/coding.c, wolfssl/wolfcrypt/coding.h, wolfcrypt/src/asn.c,
wolfcrypt/test/test.c: refactor Base64_Decode() with separate always-CT
  Base64_Decode() and never-CT Base64_Decode_nonCT(), and use the latter only to
  decode known-public PEM objects, otherwise use always-CT Base64_Decode().
2025-04-02 17:08:20 -05:00
Kareem 8e9a986e0b Add comment clarifying that DoD certificate policy OIDs are not currently being parsed in the code, they are just recognized as valid OIDs. 2025-03-31 14:37:19 -07:00
Kareem b803a03ddd Add support for ISRG domain validated certificate policy OID (used by Let's Encrypt). Fixes libspdm test failure. 2025-03-28 12:41:52 -07:00
Kareem f313edb4cf Add a test certificate for all of the FPKI certificate policy OIDs. 2025-03-27 12:20:36 -07:00
Kareem eb3b4751ac Handle collisions in FPKI cert policy OID sums. 2025-03-27 12:20:36 -07:00
Kareem ac2df1420b Checked and corrected all OIDs and OID sums. 2025-03-27 12:20:36 -07:00
Devin AI 53f30b3c47 Add remaining FPKI cert policy OIDs.
Co-Authored-By: kareem@wolfssl.com <kareem@wolfssl.com>
2025-03-27 12:20:29 -07:00
Kareem 6daaaec6e2 WIP: clean up Devin's work, remove duplicate OIDs, handle OID sum collisions 2025-03-27 12:20:28 -07:00
Devin AI a911f70049 Add other federal PKI OIDs.
Co-Authored-By: kareem@wolfssl.com <kareem@wolfssl.com>
2025-03-27 12:20:02 -07:00
Devin AI 6910f80e3d Add all DoD PKI cert policy OIDs.
Co-Authored-By: kareem@wolfssl.com <kareem@wolfssl.com>
2025-03-27 12:19:49 -07:00
Daniel Pouzzner 1e89002762 fix various -Wdeclaration-after-statements, and add
-Wdeclaration-after-statement to .github/workflows/pq-all.yml.

rearrange code/gating in wolfcrypt/src/wc_mlkem.c:mlkemkey_encapsulate() for
  clarity and to fix a -Wdeclaration-after-statement.

also, made mlkem_encapsulate_c() and mlkem_encapsulate() return error code
  (currently always zero) rather than void, for consistency.

configure.ac: fix Kyber/ML-KEM option setup.
2025-03-21 15:46:44 -05:00
David Garske 01910a60aa
Merge pull request #8542 from anhu/dual_alg_crit_ext
Allow critical alt and basic constraints extensions
2025-03-20 16:15:42 -07:00
Anthony Hu 4967738044 Delete dupe line 2025-03-20 17:41:14 -04:00
Anthony Hu f8506c3e04 Allow critical alt and basic constraints extensions
Also properly track pathlen.
2025-03-07 13:06:06 -05:00
Daniel Pouzzner 932513a41e fixes for various -W*conversions in sp_int.c, asn.c, fe_operations.c, fe_448.c, ge_448.c. also, add support for NO_INT128, and add .github/workflows/wolfCrypt-Wconversion.yml. 2025-03-06 16:08:38 -06:00
Sean Parkinson 4f8a39cbcf
Merge pull request #8498 from rizlik/ocsp_fixes
OCSP openssl compat fixes
2025-02-28 13:42:50 +10:00
Sean Parkinson 99f25c6399
Merge pull request #8494 from Laboratory-for-Safe-and-Secure-Systems/various
Various fixes and improvements
2025-02-27 09:40:06 +10:00
Sean Parkinson f204ac8363 PKCS Pad: public API to do PKCS padding
PKCS padding adds length of padding as repeated padding byte.
Use the new function in all places.
2025-02-27 08:28:53 +10:00
Tobias Frauenschläger be6888c589 Fixes for Dilithium in TLS handshake
Some fixes to better handle Dilithium keys and signatures in the TLS
handshake.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:33:59 +01:00
Marco Oliverio dfc5e61508 asn: ocsp: refactor out CERT ID decoding
It will be reused in d2i_CERT_ID
2025-02-25 20:20:34 +00:00
Marco Oliverio c24b7d1041 ocsp: use SHA-256 for responder name if no-sha 2025-02-25 15:42:27 +00:00
Marco Oliverio 8b80cb10d6 ocsp: responderID.ByKey is SHA-1 Digest len
Check that responderID.ByKey is exactly WC_SHA_DIGEST_SIZE as per RFC
6960. KEYID_SIZE can change across build configuration.
2025-02-25 15:42:22 +00:00
Jiri Malak 1d1ab2d9ff Rename OFFSETOF macro to WolfSSL specific WC_OFFSETOF name
There are the following reasons for this
- it conflicts with the OFFSETOF macro in the OS/2 header (Open Watcom)
- it is compiler-specific and should use the C standard offsetof definition in the header file stddef.h
- it is more transparent unique name
2025-02-22 09:44:54 +01:00
Marco Oliverio a06a8b589c ocsp: minors 2025-02-17 08:59:29 +00:00
Marco Oliverio c1c9af5cb6 minor: improve indentation of guards 2025-02-17 08:59:29 +00:00
Marco Oliverio 2c2eb2a285 ocsp: improve OCSP response signature validation
- search for the signer in the CertificateManager if the embedded cert
  verification fails in original asn template.
2025-02-17 08:59:29 +00:00
Marco Oliverio 851d74fd69 ocsp-resp-refactor: address reviewer's comments 2025-02-17 08:59:29 +00:00
Marco Oliverio f782614e1e clang tidy fixes 2025-02-17 08:59:28 +00:00
Marco Oliverio 3a3238eb9f ocsp: refactor wolfSSL_OCSP_response_get1_basic
The internal fields of OcspResponse refer to the resp->source buffer.
Copying these fields is complex, so it's better to decode the response again.
2025-02-17 08:58:03 +00:00
Marco Oliverio b7f08b81a6 ocsp: adapt ASN original to new OCSP response refactor 2025-02-17 08:58:03 +00:00
Marco Oliverio f526679ad5 ocsp: refactor OCSP response decoding and wolfSSL_OCSP_basic_verify
- Search certificate based on responderId
- Verify response signer is authorized for all single responses
- Align with OpenSSL behavior
- Separate wolfSSL_OCSP_basic_verify from verification done during
  decoding
2025-02-17 08:58:03 +00:00