Commit Graph

24650 Commits

Author SHA1 Message Date
Sean Parkinson
a0d6afbb04 Merge pull request #8505 from jmalak/ow-fixes
various fixes for Open Watcom build
2025-02-27 10:31:19 +10:00
Daniel Pouzzner
183d9b44d1 Merge pull request #8509 from kaleb-himes/WCv6.0.0-RC4-CHECKIN
Disable XTS-384 as an allowed use in FIPS mode
2025-02-26 18:24:12 -06:00
Sean Parkinson
c290907228 Merge pull request #8510 from wolfSSL/devin-lifeguard/update-rules-d59f9c48
Update Devin Lifeguard rules
2025-02-27 09:40:48 +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
David Garske
92ed003a58 Merge pull request #8502 from SparkiDev/pkcs_pad
PKCS Pad: public API to do PKCS padding
2025-02-26 15:17:50 -08: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
devin-ai-integration[bot]
615d7229b0 Update Devin Lifeguard rules 2025-02-26 22:19:57 +00:00
David Garske
307b71c0f4 Merge pull request #8508 from SparkiDev/arm_asm_sha512_384
ARM ASM: available for SHA-384 only too
2025-02-26 14:11:27 -08:00
kaleb-himes
738462a6f0 Remove redundent gates 2025-02-26 12:03:25 -07:00
kaleb-himes
b8a383469a Disable 192-bit tests in FIPS mode 2025-02-26 11:09:31 -07:00
kaleb-himes
9063093993 Disable XTS-384 as an allowed use in FIPS mode 2025-02-26 07:38:45 -07:00
Tobias Frauenschläger
75d63071df Fix memory leak in handshake
Make sure peer dilithium keys are properly freed.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:34:00 +01:00
Tobias Frauenschläger
491e70be7a PSK fix
Fix compilation in case PSK is enabled, not Session tickets are
disabled.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:33:59 +01:00
Tobias Frauenschläger
3d4ec1464b Minor Dilithium fix
Fix compilation in case caching is enabled.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:33:59 +01:00
Tobias Frauenschläger
af4017132d LMS fixes
* Add support for CMake
* Add support for Zephyr
* Make sure the internal key state is properly handled in case a public
  key is imported into a reloaded private key.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:33:59 +01:00
Tobias Frauenschläger
9db5499dbd Update CryptoCb API for Dilithium final standard
Add context and preHash metadata.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-26 15:33:59 +01: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
Jiri Malak
b5ba7a6fcc correct Open Watcom linker extra libraries 2025-02-26 11:03:36 +01:00
Jiri Malak
47d130440d remove now useless __WATCOMC__ macro check 2025-02-26 10:26:28 +01:00
Jiri Malak
17a0081261 correct line length to be shorter then 80 characters 2025-02-26 08:02:43 +01:00
Sean Parkinson
9e9efeda28 ARM ASM: available for SHA-384 only too
Add HAVE_SHA384 to check for whether assembly code is available.
2025-02-26 16:10:21 +10:00
Jiri Malak
a83cf8584d add new macro __UNIX__ to the list of known macros 2025-02-26 01:22:25 +01:00
Jiri Malak
ddfbbc68ac various fixes for Open Watcom build
- fix build for OS/2
- fix build for Open Watcom 1.9
2025-02-25 22:52:36 +01:00
David Garske
3557cc764a Merge pull request #8501 from SparkiDev/digest_test_rework
Digest testing: improve
2025-02-25 13:03:48 -08:00
David Garske
f2c5b4e56a Merge pull request #8500 from SparkiDev/evp_aes_gcm_test_fix
test_wolfssl_EVP_aes_gcm: fix for mem fail testing
2025-02-25 09:56:55 -08:00
David Garske
bac6771828 Merge pull request #8499 from SparkiDev/crl_list_fix
CRL: fix memory allocation failure leaks
2025-02-25 09:54:55 -08:00
David Garske
4eda5e1f7f Merge pull request #8491 from jmalak/winsock-guard
correct comment for _WINSOCKAPI_ macro manipulation
2025-02-25 09:51:23 -08:00
Daniel Pouzzner
0589a34f91 Merge pull request #8135 from gasbytes/fix-conversion
Fix conversion on various files
2025-02-25 10:01:31 -06:00
Reda Chouk
9178c53f79 Fix: Address and clean up code conversion in various files. 2025-02-25 11:17:58 +01:00
Sean Parkinson
6016cc0c97 Digest testing: improve
Make testing digests consistent.
Add KATs for all digests.
Check unaligned input and output works.
Perform chunking tests for all digests.

Fix Blake2b and Blake2s to checkout parameters in update and final
functions.
Fix Shake256 and Shake128 to checkout parameters in absorb and squeeze
blocks functions.

Add default digest size enums for Blake2b and Blake2s.
2025-02-25 19:07:20 +10:00
Sean Parkinson
6f268c4369 CRL: fix memory allocation failure leaks
On memory allocation failure, some functions were leaking memory.

Also add reference counting to CRL object so that a deep copy of a list
of CRLs doesn't leak memory.
The test was explicitly freeing each CRL in the list.
2025-02-25 09:05:03 +10:00
Sean Parkinson
ac1f25d6f4 test_wolfssl_EVP_aes_gcm: fix for mem fail testing
Fix test to not leak when memory allocation failure testing.
When not supporting AES-GCM streaming, allocation failures occur.
Always call cleanup.
2025-02-25 08:15:43 +10:00
Daniel Pouzzner
a85641574d Merge pull request #8493 from Laboratory-for-Safe-and-Secure-Systems/pqc_clang_tidy
PQC Clang-tidy fixes
2025-02-24 15:37:05 -06:00
JacobBarthelmeh
146d17d134 Merge pull request #8496 from embhorn/mosquitto_cert_update
Add cert update to workflow
2025-02-24 11:14:33 -07:00
Eric Blankenhorn
0256b426f0 Add cert update to workflow 2025-02-24 11:26:19 -06:00
Sean Parkinson
a756010a4d Merge pull request #8492 from douzzer/20250221-fix-Kbuild-EXPORT_SYMBOL_NS_GPL
20250221-fix-Kbuild-EXPORT_SYMBOL_NS_GPL
2025-02-24 22:37:29 +10:00
Tobias Frauenschläger
fd8f6e168b PQC Clang-tidy fixes
Fixes two clang-tidy warnings in error cases.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-24 09:28:23 +01:00
Daniel Pouzzner
c9cf4137e7 linuxkm/Kbuild and linuxkm/module_exports.c.template: refactor using .ONESHELL, and in recipe for generating linuxkm/module_exports.c, render the namespace with a literal, with or without quotes as dictated by target kernel version. remove EXPORT_SYMBOL_NS_Q(), which didn't work right on old (pre-6.13) kernels with namespace support.
wolfssl/wolfcrypt/settings.h: in WOLFSSL_LINUXKM section, define NO_OLD_WC_NAMES, OPENSSL_COEXIST, etc., to avoid collisions with in-tree crypto in application sources that include both wolfssl and linux kernel native headers.
2025-02-23 15:35:33 -06:00
Daniel Pouzzner
011ade4966 .wolfssl_known_macro_extras: fix unneeded and out-of-order entries (LC_ALL=C order). 2025-02-23 15:35:33 -06:00
Daniel Pouzzner
0116ab6ca2 Merge pull request #8484 from jmalak/offsetof
Rename OFFSETOF macro to WolfSSL specific WC_OFFSETOF name
2025-02-23 14:45:43 -06:00
Jiri Malak
d066e6b9a5 correct comment for _WINSOCKAPI_ macro manipulation
The issue is with MINGW winsock2.h header file which is not compatible
with Miscrosoft version and handle _WINSOCKAPI_ macro differently
2025-02-23 11:15:38 +01: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
David Garske
29c3ffb5ee Merge pull request #8435 from JacobBarthelmeh/formatting
add else case to match with other statements
2025-02-21 17:21:10 -08:00
David Garske
865f96aafd Merge pull request #7821 from Laboratory-for-Safe-and-Secure-Systems/pqc_hybrid_kex
Add more PQC hybrid key exchange algorithms
2025-02-21 11:28:55 -08:00
JacobBarthelmeh
5fc7d9f5f2 Merge pull request #8483 from gojimmypi/pr-fips-readme
Update README.md to reflect FIPS 140-3 validated Certificate #4718
2025-02-21 11:00:31 -07:00
Tobias Frauenschläger
c899f79cfa Update key share group ranking algorithm
In case no user group ranking is set, all groups are now ranked equally
instead of the order in the `preferredGroup` array. This is the
behavior already indicated in the comment header of the function.

This change is necessary for applications that do not set their own
group ranking (via `wolfSSL_CTX_set_groups()` for example). When such an
application creates a TLS server and receives a ClientHello message with
multiple key shares, now the first key share is selected instead of the
one with the lowest index in the `preferredGroup` array.

Recent browsers with PQC support place two key shares in their
ClientHello message: a hybrid PQC + X25519 one and at least one
classic-only one. The hybrid one is the first one, indicating a
preference. Without this change, however, always the classic-only key
share has been selected, as these algorithms have a lower index in the
`preferredGroup` array compared to the PQC hybrids.

Tested using a patched version of NGINX.

This change also results in a different selection of a key share group
in case of a HelloRetryRequest message. For the tests, where static
ephemeral keys are used (`WOLFSSL_STATIC_EPHEMERAL`), an additional
check is necessary to make sure the correct key is used for the ECDH
calculation.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-21 18:44:51 +01:00
Tobias Frauenschläger
89491c7e36 Improvements for PQC hybrid key exchange
Add support for X25519 and X448 based hybrid PQC + ECC key exchange
groups. Furthermore, two new combinations with SECP curves are added to
match OQS combinations.

This also incorporates the changed order of X25519 and X448 based
combinations to place the PQC material before the ECDH material. This is
motivated by the necessity to always have material of a FIPS approved
algorithm first.

Also, codepoints are updated to reflect the latest draft standards for
pure ML-KEM and some of the hybrids. With these changes and based on the
recent additions to both enable ML-KEM final and draft versions
simultaneously, a WolfSSL TLS server is now compatible with all recent
browsers that support either the draft version of ML-KEM (Chromium based
browsers and Firefox < version 132; only when the draft version is
enabled in the build) or the final version already (Firefox > version 132).

In the process of extending support, some code and logic cleanup
happened. Furthermore, some memory leaks within the hybrid code path have
been fixed.

Signed-off-by: Tobias Frauenschläger <tobias.frauenschlaeger@oth-regensburg.de>
2025-02-21 18:44:40 +01:00
David Garske
6271d5b5a4 Merge pull request #8485 from jmalak/cmake-build
fix failing build if not found standard threads support
2025-02-21 09:38:33 -08:00
JacobBarthelmeh
c3d5fa6748 Merge pull request #8481 from cconlon/jniDTLS13
Enable DTLS 1.3 by default in `--enable-jni` build
2025-02-21 10:02:49 -07:00
Jiri Malak
000f32a5a4 fix failing tests build if not found standard threads support
Threads::Threads is not defined, if support not found for some reason
if custom threads support is used then it happen always
of cause some tests relates to standard threads support then it fails during build, but build is started and only some tests fail
2025-02-21 09:24:15 +01:00