Commit Graph

9557 Commits (ed2c20a3b2317f49b51daf54eb537304b0ded9a6)

Author SHA1 Message Date
Daniel Pouzzner c2b486ce53 fix some misindentation in wolfcrypt/src/coding.c.
force lower CMAKE_POLICY_VERSION_MINIMUM to try to work around obsolete cmake config syntax in several OSP workflows.
2025-04-02 17:08:20 -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
Daniel Pouzzner 8705d28d48 wolfcrypt/src/aes.c: in wc_AesSetKeyLocal(), rework support for WC_FLAG_DONT_USE_AESNI (fixes WC_C_DYNAMIC_FALLBACK).
wolfssl/wolfcrypt/settings.h: in WOLFSSL_LINUXKM section, #ifdef LINUXKM_LKCAPI_REGISTER, #define WOLFSSL_TEST_SUBROUTINE to nothing, and #define WC_TEST_EXPORT_SUBTESTS.

linuxkm/lkcapi_glue.c:
* add check_skcipher_driver_masking() and check_aead_driver_masking(),
* use _masking() checks in all linuxkm_test_*().
* add !WOLFSSL_AESGCM_STREAM implementation of linuxkm_test_aesgcm().
* add implementations of linuxkm_test_aesctr(), linuxkm_test_aesofb(), and linuxkm_test_aesecb()
* remove incomplete+disabled AES-CCM shim implementation.

linuxkm/module_hooks.c: pull in wolfcrypt/test/test.h if LINUXKM_LKCAPI_REGISTER.

linuxkm/Makefile: build wolfcrypt/test/test.o if ENABLED_LINUXKM_LKCAPI_REGISTER.

Makefile.am: add ENABLED_LINUXKM_LKCAPI_REGISTER to exports in BUILD_LINUXKM section.

configure.ac: add AC_SUBST([ENABLED_LINUXKM_LKCAPI_REGISTER]); in ENABLED_LINUXKM_DEFAULTS set up, remove `-DWOLFSSL_TEST_SUBROUTINE=static` from AM_CFLAGS adds; fix whitespace.

.wolfssl_known_macro_extras: add WC_WANT_FLAG_DONT_USE_AESNI.

wolfcrypt/test/test.c: add `|| defined(WC_TEST_EXPORT_SUBTESTS)` to outermost gate, add wc_test_ prefix to render_error_message() and export it,

wolfcrypt/test/test.h: add prototype for wc_test_render_error_message(), and #ifdef WC_TEST_EXPORT_SUBTESTS, add prototypes for all the subtests.
2025-04-02 17:00:48 -05:00
Daniel Pouzzner 3c16722538 wolfcrypt/src/aes.c and wolfssl/wolfcrypt/aes.h: add support for WC_FLAG_DONT_USE_AESNI in wc_AesSetKeyLocal(); add support for USE_INTEL_SPEEDUP_FOR_AES.
linuxkm/lkcapi_glue.c: finish implementation of WC_LINUXKM_C_FALLBACK_IN_SHIMS and add TEST_WC_LINUXKM_C_FALLBACK_IN_SHIMS.

use "WC_C_DYNAMIC_FALLBACK" consistently (remove/replace uses of "WC_AES_C_DYNAMIC_FALLBACK").
2025-04-02 17:00:48 -05:00
Daniel Pouzzner 6d92dae632 configure.ac: add support for --enable-aesni-with-avx/USE_INTEL_SPEEDUP_FOR_AES (AESNI+AVX, but only for AES modes).
linuxkm/lkcapi_glue.c: implement WC_LINUXKM_C_FALLBACK_IN_SHIMS, km_AesGet(), and km_AesFree().

src/include.am: add missing gates for AES-GCM and AES-XTS asm.

wolfcrypt/src/aes_xts_asm.S and wolfssl/wolfcrypt/sp_int.h: don't redefine HAVE_INTEL_AVX2.
2025-04-02 17:00:48 -05:00
JacobBarthelmeh a3d0ffb1ed
Merge pull request #8622 from SparkiDev/kyber_improv_3
ML-KEM/Kyber: minor improvements
2025-04-02 09:56:32 -06:00
JacobBarthelmeh 0a4599133c
Merge pull request #8599 from kareem-wolfssl/zd19563
Add support for DoD certificate policy OIDs.
2025-04-02 09:44:25 -06:00
Sean Parkinson fafc333e93 LMS: add API to get Key ID from raw private key
Always last 16 bytes of private key.
2025-04-02 16:05:11 +10:00
Sean Parkinson 8a9e125756 ML-KEM/Kyber: minor improvements
Minor improvement to SHA-3 x64 code.
Minor improvement to performance of ML-KEM/Kyber x64 code.
Minor improvement to performance of C code.
2025-04-02 13:10:44 +10:00
Sean Parkinson 83e1cfcf01 LMS: change identifiers to match standard
Use the identifiers from IANA for LMS.
2025-04-01 12:15:20 +10:00
Sean Parkinson c5dadd6f8d
Merge pull request #8600 from JacobBarthelmeh/microchip
random implementation does not require PIC32 build macro
2025-04-01 08:36:45 +10: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
JacobBarthelmeh 307d746653
Merge pull request #8590 from SparkiDev/arm32_no_assign_reg
ARM32/Thumb2 ASM: fix WOLFSSL_NO_VAR_ASSIGN_REG
2025-03-31 10:04:51 -06: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
Brett Nicholas a8384bb426
Merge pull request #8602 from dgarske/cryptocb_no_hmac
Fix for crypto callback macro guards with `DEBUG_CRYPTOCB`
2025-03-28 10:51:45 -06:00
David Garske 04a3f1c206
Merge pull request #8604 from LinuxJedi/STM32MP2
Add instructions for STM32MP25 with OpenSTLinux
2025-03-28 09:37:13 -07:00
Andrew Hutchings 5d0c3f7c27 Add instructions for STM32MP25 with OpenSTLinux 2025-03-28 09:28:49 +00:00
David Garske e1ec90a886 Fix for crypto callback without HMAC and `DEBUG_CRYPTOCB`. Fix guards on crypto cb hashing. 2025-03-27 16:42:24 -07:00
David Garske d235013fe9 Fix for STM32 PKA with P521 and shared secret. ZD 19422 2025-03-27 15:30:37 -07:00
JacobBarthelmeh 25dc3f08e9 random implementation does not require PIC32 build macro 2025-03-27 15:53:39 -06: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
Sean Parkinson 21c0d7803a Greenhills compiler: fix asm and volatile
Greenhills compiler doesn't accept volatile and __asm__ needs to be
__asm.
2025-03-27 10:54:19 +10:00
Sean Parkinson ea677dd30d ARM32 inline ASM: make all vars input when not assigning regs
Compiler doesn't keep parameters in the same registers as passed if they
are output registers.
2025-03-27 10:51:01 +10:00
Daniel Pouzzner ddf7d5b6f1
Merge pull request #8584 from dgarske/stm32_aesgcm
Fixes for STM32H7S AES GCM. Cleanups for STM32 AES GCM.
2025-03-26 10:57:18 -05:00
Sean Parkinson cfab666369 ARM32/Thumb2 ASM: fix WOLFSSL_NO_VAR_ASSIGN_REG
Thumb2 needed constants defined even with no register assignments.
ARM32 needed support added fo rnot having registers assigned to
variables.
2025-03-26 12:46:32 +10:00
Daniel Pouzzner 61cdcd71e6
Merge pull request #8588 from SparkiDev/mlkem_encapsulte_no_return
ML-KEM/Kyber: mlkem_encapsulate not to return a value
2025-03-25 00:14:41 -05:00
Sean Parkinson cfc774c152
Merge pull request #8581 from dgarske/no_ecc_check_public_order
Add option to disable ECC public key order checking
2025-03-25 09:13:56 +10:00
Sean Parkinson 66662bc399 ML-KEM/Kyber: mlkem_encapsulate not to return a value
Don't return a value from mlkem_encapsulate() to ensure code is just the
maths.
2025-03-25 08:11:03 +10:00
David Garske 8635014249 Fix to enable SHA384/SHA512 crypto hardware on STM32H7S. 2025-03-24 14:30:35 -07:00
David Garske a709b16ed2 Adding option for `NO_ECC_CHECK_PUBKEY_ORDER`. ZD 19422 2025-03-24 14:00:23 -07:00
Daniel Pouzzner 3cad38a1ca wolfcrypt/test/test.c: gate wc_CmacFree()s in cmac_test() on !HAVE_FIPS || FIPS_VERSION3_GE(6,0,0); fix some return codes in hash_test(). 2025-03-22 17:19:37 -05:00
Daniel Pouzzner 60ffde6d7c wolfcrypt/test/test.c: fix error-path various uninitialized data uses and memory leaks. 2025-03-22 13:40:31 -05:00
Daniel Pouzzner 190f46ef23 wolfcrypt/test/test.c: fix -Wdeclaration-after-statement in sm3_test(). 2025-03-22 01:22:19 -05:00
Daniel Pouzzner 1587f21938 fix a couple -Wdeclaration-after-statements. 2025-03-21 22:33:45 -05:00
Daniel Pouzzner 777d42fabe wolfcrypt/src/siphash.c: gate armasm on defined(WOLFSSL_ARMASM), not !defined(WOLFSSL_NO_ASM). 2025-03-21 21:12:41 -05:00
David Garske 93c8d7df0d Fixes for STM32H7S AES GCM. Cleanups for STM32 AES GCM. 2025-03-21 16:17:36 -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 9a3ea6fd73
Merge pull request #8568 from embhorn/msvs_pqc_build
Fix MSVS build issues with PQC config
2025-03-21 12:41:19 -07:00
David Garske 294e4c79a8
Merge pull request #8578 from philljj/coverity_unchecked_ret
Coverity unchecked return value
2025-03-21 10:05:29 -07:00
David Garske 9258fde02f
Merge pull request #8570 from wolfSSL/devin/1742405136-cipherType-to-string
Add wolfSSL_EVP_CIPHER_type_string function and test
2025-03-21 10:04:41 -07:00
Eric Blankenhorn f663ed28b6 Fix MSVS build issues with PQC config 2025-03-21 11:49:55 -05:00
Chris Conlon 7c9ecd39fe
Merge pull request #8550 from lealem47/STM32WBA
Add support for STM32WBA
2025-03-21 09:58:17 -06:00
David Garske b9aeeac58b
Merge pull request #8576 from douzzer/20250319-FIPS-lean-aesgcm
20250319-FIPS-lean-aesgcm
2025-03-21 08:55:34 -07:00
jordan 8d0931df9d coverity: check mp radix ret values. 2025-03-21 10:08:13 -04:00
jordan 15ac07c9ef coverity: check correct ret value. 2025-03-21 09:25:28 -04:00
jordan 3a02ab286c coverity: unchecked return value with mp_copy. 2025-03-21 08:59:31 -04:00
Sean Parkinson 295ba3b416 Intel x86_64, gcc, icc: put branches on 32 byte boundary
Improved security with compile flag.
2025-03-21 17:50:31 +10:00
Daniel Pouzzner 57ecd4b246 configure.ac: fix -DNO_BIG_INT setup to recognize $ENABLED_SP_MATH.
wolfcrypt/test/test.c: fix gating around modLen in rsa_test().

wolfssl/openssl/bn.h: remove superfluous WOLFSSL_SP_MATH gate around mp_int mpi
  in struct WOLFSSL_BIGNUM definition.

wolfssl/wolfcrypt/wolfmath.h: add check for "Conflicting MPI settings.", add
  initial check for WOLFSSL_SP_MATH_ALL || WOLFSSL_SP_MATH to include sp_int.h,
  and remove superfluous WOLFSSL_SP_MATH gate on "common math functions".
2025-03-20 22:18:22 -05:00
David Garske 5f013c735e
Merge pull request #8575 from ColtonWilley/fix_cryptocb_rsa_pad_ret_len
Fix outlen return for RSA private decrypt with WOLF_CRYPTO_CB_RSA_PAD
2025-03-20 19:03:25 -07:00
Daniel Pouzzner b544354306 wolfssl/wolfcrypt/wolfmath.h: don't include an MPI header if NO_BIG_INT is
defined, and issue a #error if no MPI backend gate is defined and NO_BIG_INT
   is not defined either.

configure.ac:
* add support for FIPS lean-aesgcm[-{ready,dev}].
* implement handler for --enable-sha256.
* move setup for WOLFSSL_FIPS_DEV and WOLFSSL_FIPS_READY into the applicable
    per-flavor sections.
* fix sensing of $ENABLED_AESGCM in FIPS setup clauses to pivot on `!= "no"`
    rather than `= "yes"`, to accommodate "4bit" and other non-"yes" values.
* fix SNI_DEFAULT to be "no" if $ENABLED_TLS = no.
* fix ENABLED_DHDEFAULTPARAMS default to be $ENABLED_DH rather than yes.

wc_encrypt.c: add missing gates in wc_CryptKey() for NO_SHA256.

wolfcrypt/test/test.c: gating fixes for NO_SHA256.

wolfcrypt/benchmark/benchmark.c: basic fixes for building/running with
  --disable-rng (-DWC_NO_RNG).

With the above additions and fixes, it's now a clean build, test, and benchmark,
  with --disable-sha256 --enable-cryptonly --disable-hashdrbg --disable-rng
  --disable-hmac, though RSA/DH/ECC benches are disabled.
2025-03-20 20:03:34 -05:00
David Garske 2cf4997d0f
Merge pull request #8565 from res0nance/correct-debug-info
random: correct debug messages
2025-03-20 17:04:47 -07:00
David Garske 18268a5ea9
Merge pull request #8551 from kareem-wolfssl/zd19541
Change #pragma GCC macros in sp_int.c to PRAGMA_GCC macros to avoid calling them on unsupported toolchains.
2025-03-20 16:44:10 -07:00
David Garske 7ba179f50f
Merge pull request #8560 from SparkiDev/test_api_c_split_1
Split out tests: random, wolfmath, public key
2025-03-20 16:42:41 -07: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
Colton Willey 4290bfb9a6 Fix outlen return for RSA private decrypt with WOLF_CRYPTO_CB_RSA_PAD defined 2025-03-20 13:46:13 -07:00
David Garske 2c36ae268f
Merge pull request #8536 from SparkiDev/kyber_to_mlkem
Update Kyber APIs to ML-KEM APIs
2025-03-20 11:07:53 -07:00
David Garske 4c0d4a931e
Merge pull request #8555 from bigbrett/default-devid-disable
Add option to disallow automatic use of "default" devId
2025-03-20 10:56:17 -07:00
Devin AI ec00f780ec Rename parameter in wolfSSL_EVP_CIPHER_type_string and add test
Co-Authored-By: lealem@wolfssl.com <lealem@wolfssl.com>
2025-03-19 17:41:51 +00:00
Devin AI af1f6543e1 Add wolfSSL_EVP_CIPHER_type_string function to get cipher string from type
Co-Authored-By: lealem@wolfssl.com <lealem@wolfssl.com>
2025-03-19 17:29:03 +00:00
jordan d1f94ad3e8 linuxkm fedora: fix uninitialized build error. 2025-03-19 10:47:32 -04:00
Kareem 6c472496b4 Only perform ARM assembly CPUID checks if support was enabled at build time. 2025-03-17 14:25:08 -07:00
res0nance c697f87bda random: correct debug messages 2025-03-17 21:12:51 +08:00
Sean Parkinson 663ca29a5d Split out tests: random, wolfmath, public key
Improved testing of random APIs.
wolfmath tests moved out.
Public key algorithm testing moved out: RSA, DSA, DH, ECC, SM2,
Curve25519, Ed25519, Curve448, Ed448, ML-DSA.
Signature API tests moved out.

Fix for OCSP testing to ensure RSA is available.

Added group names to API test cases.
Can select groups to run with --group <name>. --groups lists all known
group names.

Added option to stop API testing on first failure: --stopOnFail.
2025-03-17 09:32:00 +10:00
Daniel Pouzzner bc7fbee539
Merge pull request #8528 from SparkiDev/digest_test_rework_2
Digest tests: add more tests
2025-03-14 16:11:42 -05:00
Daniel Pouzzner 87c0ac90b8 configure.ac:
* sense assert.h and define WOLFSSL_HAVE_ASSERT_H accordingly.
* force off enable_aesgcm_stream if 32 bit armasm or riscv-asm (not yet implemented or buildable).
* add AM_CONDITIONAL([BUILD_CHACHA_NOASM, ...]) when --enable-chacha=noasm.

src/include.am: gate armasm/riscv_asm chacha files on !BUILD_CHACHA_NOASM.

tests/api.c: add missing HAVE_CHACHA&&HAVE_POLY1305 gate around test_TLSX_CA_NAMES_bad_extension().

wolfcrypt/src/chacha.c: tweak WOLFSSL_ARMASM and WOLFSSL_RISCV_ASM codepaths to also depend on !NO_CHACHA_ASM.

wolfssl/wolfcrypt/types.h: in setup for wc_static_assert(), #include <assert.h> if WOLFSSL_HAVE_ASSERT_H, >=C11, or >=C++11.
2025-03-13 23:17:57 -05:00
Sean Parkinson 97a646661f Poly1305 ARM32 assembly code: loading with ldm
Loading message with ldm, that requires aligned pointers, when 64n +
16*[1-3] bytes are to be processed.
2025-03-14 11:05:48 +10:00
Sean Parkinson 93acd466a7
Merge pull request #6805 from jpbland1/ech-hello-retry
Ech hello retry request
2025-03-13 09:17:58 +10:00
Brett Nicholas 8e3e60e4e2 adds WC_NO_DEFAULT_DEVID to disallow automatic use of "default" devId 2025-03-12 16:53:25 -06:00
Kareem 88fdfdd52d Change #pragma GCC macros in sp_int.c to PRAGMA_GCC macros to avoid calling them on unsupported toolchains. 2025-03-12 12:12:24 -07:00
Daniel Pouzzner d2fc77ae93 wolfcrypt/test/test.c: add missing PRIVATE_KEY_UNLOCK()s around pkcs7enveloped_test() and pkcs7authenveloped_test() exposed by "--enable-fips=ready --enable-pkcs7 --disable-harden". 2025-03-11 17:10:54 -05:00
Lealem Amedie 96b8d72c4f Add support for STM32WBA 2025-03-11 15:16:26 -06:00
Daniel Pouzzner 2de3d46971 wolfcrypt/test/test.c: in cryptocb_test(), fix error code from
wc_CryptoCb_RegisterDevice(), and call wc_CryptoCb_UnRegisterDevice() at
  cleanup.
2025-03-11 14:51:25 -05:00
John Bland 8ff08740f8 Merge branch 'master' into ech-hello-retry 2025-03-10 03:37:27 -04:00
Sean Parkinson a7690ca24b ML-KEM/Kyber: finish name change 2025-03-10 08:37:14 +10:00
Sean Parkinson e7ef3ab606 Digest tests: add more tests
Add testing of MD2 and Md4.
Add more tests of functions in hash.c.
Reformat data to match what is output by PRINT_DATA macro.
2025-03-10 08:13:06 +10:00
Daniel Pouzzner 66376bed28 wolfcrypt/src/misc.c: in xorbufout() and xorbuf(), call XorWords() directly via a simplified path if all args are already aligned to WOLFSSL_WORD_SIZE (fixes performance regression from dc2e2631bc).
configure.ac: add a "Conflicting asm settings" error check at end, since our configuration currently blows up if --enable-intelasm and --disable-asm are combined.
2025-03-07 19:52:26 -06:00
Daniel Pouzzner c3f24568ff
Merge pull request #8520 from JacobBarthelmeh/pkcs7_verify_stream
PKCS7 verify and decode indefinite length support
2025-03-07 18:47:30 -06:00
JacobBarthelmeh 09ffdeb897 fix for different reported conversion warnings 2025-03-07 11:52:01 -07:00
Anthony Hu f8506c3e04 Allow critical alt and basic constraints extensions
Also properly track pathlen.
2025-03-07 13:06:06 -05:00
JacobBarthelmeh 53fa4ffbaf conversion warning fixes 2025-03-07 11:03:12 -07: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
kareem-wolfssl acc096c2ea
Merge pull request #8533 from dgarske/eccnb
Fixes for ECC non-blocking tests
2025-03-06 11:08:43 -07:00
JacobBarthelmeh 8e98a41401 fix for build with NO_PKCS7_STREAM 2025-03-06 10:43:02 -07:00
David Garske 547519265a
Merge pull request #8534 from douzzer/20250305-linuxkm-LKCAPI-AES-CBC-fixes
20250305-linuxkm-LKCAPI-AES-CBC-fixes
2025-03-06 08:44:05 -08:00
JacobBarthelmeh b039e055df clang-tidy warning of garbage value used 2025-03-05 17:19:53 -07:00
David Garske 1bd3bf1b66
Merge pull request #8531 from night1rider/zephyr-fs-rewind-fix
Fix for missing rewind function in zephyr
2025-03-05 16:04:36 -08:00
David Garske dfc6a52db5 Fixes for ECC non-blocking tests. Added example user_settings.h build test. Demonstrate ECC 256, 384 and 521 bit. 2025-03-05 15:58:51 -08:00
Daniel Pouzzner d82a7b10c5 wolfcrypt/src/evp.c: fix a name conflict around "cipherType" that provokes -Wshadow on gcc pre-4v8. 2025-03-05 17:56:08 -06:00
Daniel Pouzzner dc2e2631bc linuxkm: various fixes for LKCAPI wrapper for AES-CBC (now passing kernel-native
self-test and crypto fuzzer), and de-experimentalize it.

wolfssl/wolfcrypt/types.h: add definitions for WOLFSSL_WORD_SIZE_LOG2.

wolfcrypt/src/misc.c: fix xorbuf() to make the XorWords() reachable; also,
  refactor integer division and modulus ops as masks and shifts, and add pragma
  to suppress linuxkm FORTIFY_SOURCE false positive -Wmaybe-uninitialized.
2025-03-05 17:56:08 -06:00
JacobBarthelmeh 624233fb98 update test case to account for NO_DES3 build and resolve clang tidy warnings 2025-03-05 16:28:26 -07:00
Devin AI c1215aa93b Fix wc_MlKemKey_Free to return int instead of void
Co-Authored-By: sean@wolfssl.com <sean@wolfssl.com>
2025-03-05 22:42:19 +00:00
Devin AI f4b770c5ab Update Kyber APIs to ML-KEM APIs
- Change struct KyberKey to struct MlKemKey
- Add backward compatibility typedef for KyberKey
- Add function declarations for new wc_MlKemKey_ functions
- Add backward compatibility #defines to map old wc_KyberKey APIs to new wc_MlKemKey APIs
- Update wc_MlKemKey_Init to take key first and type second
- Create new files wc_mlkem.h and wc_mlkem.c with updated content
- Update internal APIs with lowercase kyberkey to lowercase mlkemkey

Co-Authored-By: sean@wolfssl.com <sean@wolfssl.com>
2025-03-05 22:38:07 +00:00
JacobBarthelmeh 68e483d196 refactor of decode envelop for edge cases 2025-03-05 15:24:02 -07:00
Daniel Pouzzner 9fc7e42554
Merge pull request #8507 from SparkiDev/ct_fixes_3
Constant time code: improved implementations
2025-03-05 15:17:23 -06:00
msi-debian 7ea89a62ba Fix for missing rewind function in zephyr 2025-03-05 12:49:58 -07:00
David Garske a073868cf0
Merge pull request #8527 from SparkiDev/sp_int_asm_fixes_1
SP int: inline asm improvements and mont reduce simplifications
2025-03-04 14:45:16 -08:00
JacobBarthelmeh b75976692e spelling fix and code formatting 2025-03-04 14:31:23 -07:00
JacobBarthelmeh 4124c824ca refactor decrypt content init call 2025-03-04 09:29:36 -07:00
Sean Parkinson caf801f211 SP int: inline asm improvements and mont reduce simplifications
SP int inline asm:
- allow input variables to be either registers or memory for Intel
x86/x64 (minor performance improvement)
  - don't have memory in clobber list if output variables are registers
- remove empty clobber line in arm32/thumb2 code for old versions of
gcc
_sp_mont_red():
  - simplify the code by not using extra variables
  - don't add to j in for loop check.
2025-03-04 16:16:26 +10:00
David Garske 9b16ed5da4
Merge pull request #8518 from lealem47/evp_update_null_cipher
Add NULL_CIPHER_TYPE support to wolfSSL_EVP_CipherUpdate
2025-03-03 14:03:57 -08:00
David Garske 2b099daee0
Merge pull request #8511 from SparkiDev/intel_sha_not_avx1
SHA256: Intel flags has SHA but not AVX1 or AVX2
2025-03-03 13:59:10 -08:00
JacobBarthelmeh fcf88f16e6 spelling fixes and free decrypt structs on error case 2025-03-01 15:43:59 -07:00
JacobBarthelmeh b781ac6c29 asn to der macro gaurds and co-exist build fix 2025-02-28 15:42:24 -07:00
JacobBarthelmeh 6020bf2368 initialize test variables and fix async build 2025-02-28 14:46:42 -07:00
JacobBarthelmeh ea9f044bcc spelling fixes and return value fix 2025-02-28 14:34:51 -07:00
Daniel Pouzzner 50a3be6df7 wolfcrypt/src/sp_int.c. src/ssl_asn1.c. src/internal.c: rename several declarations to avoid shadowing global functions, for the convenience of obsolete (pre-4v8) gcc -Wshadow. 2025-02-28 15:29:58 -06:00
JacobBarthelmeh 638d9961d2 passing the rest of the PKCS7 unit tests 2025-02-28 14:23:24 -07:00
JacobBarthelmeh 7c6cd1deea passing a unit test 2025-02-28 14:23:24 -07:00
JacobBarthelmeh 1e254c014d application decryption successful 2025-02-28 14:23:24 -07:00
JacobBarthelmeh b1b1c15b35 add content stream output callback for VerifySignedData function 2025-02-28 14:23:24 -07:00
Lealem Amedie 22221e5007 Add NULL_CIPHER_TYPE support to wolfSSL_EVP_CipherUpdate 2025-02-28 11:44:30 -07:00
Sean Parkinson 4f8a39cbcf
Merge pull request #8498 from rizlik/ocsp_fixes
OCSP openssl compat fixes
2025-02-28 13:42:50 +10:00
Daniel Pouzzner f7ddc49487 linuxkm/linuxkm_wc_port.h: add #error if the user tries to use the kernel crypto fuzzer with FIPS AES-XTS (kernel bug).
src/internal.c: fix shiftTooManyBitsSigned in DefTicketEncCb().

tests/api/test_sha256.c and wolfssl/wolfcrypt/sha256.h: gate raw transform APIs (wc_Sha256Transform(), wc_Sha256FinalRaw()) and tests on !defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_AFALG_HASH).

move enum wc_HashFlags from wolfssl/wolfcrypt/hash.h to wolfssl/wolfcrypt/types.h to resolve circular dependency detected by cross-armv7m-armasm-thumb-fips-140-3-dev-sp-asm-all-crypto-only.

add FIPS_VERSION_GE(7,0) gates to new null-arg tests in test_wc_Shake{128,256}_*().

optimize ByteReverseWords() for cases where only one operand is unaligned, and add correct handling of unaligned data in ByteReverseWords64() to resolve unaligned access sanitizer report in cross-aarch64_be-all-sp-asm-unittest-sanitizer.
2025-02-26 20:55:56 -06:00
Sean Parkinson 0a6a8516f9
Merge pull request #8488 from dgarske/stm32h7s
Support for STM32H7S (tested on NUCLEO-H7S3L8)
2025-02-27 10:34:41 +10:00
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 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 b104887042 SHA256: Intel flags has SHA but not AVX1 or AVX2
Reversal of bytes when IS_INTEL_SHA only is same as when AVX1 or AVX2.
2025-02-27 09:25:13 +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
David Garske 557abcf76a Support for STM32H7S (tested on NUCLEO-H7S3L8). It supports hardware crypto for RNG, Hash, AES and PKA. Added future config option for DTLS v1.3. Support DTLS v1.3 only reduce code size (tested with: `./configure --enable-dtls13 --enable-dtls --disable-tlsv12 CFLAGS="-DWOLFSSL_SEND_HRR_COOKIE"`). 2025-02-26 14:00:48 -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 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 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
Sean Parkinson 4752bd2125 Constant time code: improved implementations
Change constant time code to be faster.
2025-02-26 11:52:09 +10: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
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
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
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
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
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