Commit Graph

78 Commits (6790c95e944bc4cdc707914215760f8ca94d6025)

Author SHA1 Message Date
Daniel Pouzzner f0f4084f94 linuxkm/lkcapi_dh_glue.c: never install DH/FFDHE on kernel <5.18 -- DH secrets have a different format before that version, and FFDHE (CONFIG_CRYPTO_DH_RFC7919_GROUPS) was introduced in 5.18 and is the only FIPS-allowed DH variant. 2025-05-14 15:39:37 -05:00
Daniel Pouzzner 8410d922db .wolfssl_known_macro_extras: remove WOLFSSL_CURVE25519_BLINDING (defined in settings.h since aa840f9c94). 2025-05-10 01:31:45 -05:00
Sean Parkinson 4b73e70515
Merge pull request #8706 from dgarske/win_crypt_rng
New build option to allow reuse of the windows crypt provider handle …
2025-05-07 20:55:07 +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
David Garske d04ab3757e New build option `WIN_REUSE_CRYPT_HANDLE` to allow reuse of the windows crypt provider handle. Seeding happens on any new RNG or after `WC_RESEED_INTERVAL`. If using threads make sure wolfSSL_Init() or wolfCrypt_Init() is called before spinning up threads. ZD 19754. Fixed minor implicit cast warnings in internal.c. Add missing `hpke.c` to wolfssl VS project. 2025-05-06 14:38:02 -07:00
Lealem Amedie 579e22f843 Remove WOLFSSL_NO_FSEEK from known macros 2025-05-06 15:39:18 -04:00
Daniel Pouzzner b9b66042d7 wolfssl/wolfcrypt/dh.h: gate in wc_DhGeneratePublic() with WOLFSSL_DH_EXTRA,
adding WOLFSSL_NO_DH_GEN_PUB in the unlikely event it needs to be disabled;

configure.ac: in --enable-linuxkm-lkcapi-register section, remove special-case
  handling for -DWOLFSSL_DH_GEN_PUB, and add support for
  --enable-linuxkm-lkcapi-register=all-kconfig, which disables registration of
  any algs that are disabled in the target kernel, and #errors if any algs or
  registrations are disabled or incompatible in libwolfssl but enabled in the
  target kernel (note, it does not #error for algorithms we don't currently
  shim/implement);

linuxkm/lkcapi_glue.c: change default WOLFSSL_LINUXKM_LKCAPI_PRIORITY from 10000
  to INT_MAX to make masking impossible;

linuxkm/lkcapi*glue.c: move all remaining algorithm-specific gate setup into the
  respective algorithm family files, and in each family file, add
  LINUXKM_LKCAPI_REGISTER_ALL_KCONFIG logic to activate shims only if the
  corresponding algorithm is activated in the target kernel.

linuxkm/lkcapi_sha_glue.c: fix -Wunuseds in
  wc_linuxkm_drbg_default_instance_registered() and wc_linuxkm_drbg_cleanup()
  when !LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT.
2025-05-05 13:17:06 -05:00
Sean Parkinson aa50cfc92c
Merge pull request #8723 from lealem47/zd19721
Sniffer: Add multiple sessions by removing cached check
2025-05-02 08:44:05 +10:00
Lealem Amedie ac139dfe49 Sniffer: Add multiple sessions by removing cached check 2025-05-01 14:27:35 -04:00
Daniel Pouzzner 273b7fc0da linuxkm: support DRBG in LKCAPI shim set:
* Implement --enable-linuxkm-lkcapi-register=stdrng and =stdrng-default,
  LINUXKM_LKCAPI_REGISTER_HASH_DRBG, and
  LINUXKM_LKCAPI_REGISTER_HASH_DRBG_DEFAULT.  With "_DEFAULT", the DRBG is
  installed as the systemwide default stdrng, necessitating
  deregister-on-command, described below.  Note that get_random_bytes() and the
  associated /dev/random and /dev/urandom do not use the default stdrng, and
  their back end cannot currently be replaced by a module.

* Add control nodes /sys/module/libwolfssl/install_algs and
  /sys/module/libwolfssl/deinstall_algs.

* Add configure option --enable-linuxkm-lkcapi-register=sysfs-nodes-only, and
  macro LINUXKM_LKCAPI_REGISTER_ONLY_ON_COMMAND, to inhibit registration at
  module load time.

In configure.ac ENABLED_LINUXKM_LKCAPI_REGISTER setup, don't define
  WOLFSSL_DH_GEN_PUB in old FIPS, but do define it for =all.
2025-04-29 00:42:15 -05:00
Daniel Pouzzner d4fc8c3791 linuxkm/: null out pointers with PTR_ERR()-encoded values before jumping to cleanup;
linuxkm/lkcapi_rsa_glue.c: in km_rsa_init(), implement error-path cleanup;

linuxkm/module_hooks.c: nix CONFIG_MODULE_SIG requirement in WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE builds;

wolfssl/wolfcrypt/settings.h: in WOLFSSL_LINUXKM setup, define WOLFSSL_ASN_INT_LEAD_0_ANY if LINUXKM_LKCAPI_REGISTER (required for kernel 5.10 crypto manager);

wolfcrypt/src/memory.c: add WC_NO_ERR_TRACE() to mock error returns in SAVE_VECTOR_REGISTERS2_fuzzer().
2025-04-22 16:44:07 -05:00
David Garske a9e2146f06
Merge pull request #8675 from SparkiDev/entropy_memuse_fix
Entropy MemUse: fix for when block size less than update bits
2025-04-16 20:18:22 -07:00
Sean Parkinson a34284e0a2 Entropy MemUse: support for custom hi res time
Call the custom high resolution time function when
CUSTOM_ENTROPY_TIMEHIRES is defined with the function name.
2025-04-17 09:30:29 +10:00
Daniel Pouzzner 049c4a8910 wolfssl/wolfcrypt/settings.h: map WC_SANITIZE_{DISABLE,ENABLE}() to kasan_{disable,enable}_current();
wolfssl/wolfcrypt/types.h: fallthrough map WC_SANITIZE_{DISABLE,ENABLE}() to WC_DO_NOTHING;

linuxkm/module_hooks.c: add WC_SANITIZE_DISABLE...WC_SANITIZE_ENABLE wrapper around critical span in updateFipsHash().
2025-04-16 15:51:47 -05:00
Sean Parkinson f458930d24
Merge pull request #8653 from kareem-wolfssl/zd19696
Make trusted_ca_keys check opt-in.
2025-04-16 10:45:01 +10:00
Daniel Pouzzner 10c1fc1edb linuxkm/lkcapi_glue.c: inhibit LINUXKM_LKCAPI_REGISTER_ECDH on kernel <5.13 (currently incompatible);
.wolfssl_known_macro_extras: fix lexical order.
2025-04-15 12:00:54 -05:00
David Garske 42644a55fb Fixes for building with .NET 3.5 (new WindowsCE macro). Fix for build error with `NO_WOLFSSL_MSG_EX`. Fix for ECC TFM option (only set with TFM). 2025-04-14 16:07:03 -07:00
Daniel Pouzzner ecf9982a0f .wolfssl_known_macro_extras: add TIF_NEED_FPU_LOAD. 2025-04-14 13:49:14 -05:00
Daniel Pouzzner 57baae90f1 linuxkm/lkcapi_glue.c: update calls to scatterwalk_map() and scatterwalk_unmap() for linux commit 7450ebd29c (merged for Linux 6.15);
configure.ac: fix --disable-linuxkm-lkcapi-register;

.wolfssl_known_macro_extras: fix order.
2025-04-14 00:01:40 -05:00
gojimmypi 241a1ed360
Introduce and move new Arduino examples and configuration updates 2025-04-12 15:38:37 +02:00
JacobBarthelmeh 704e97bca6
Merge pull request #8595 from dgarske/renesas_rx_tsip
Fixes for Renesas RX TSIP
2025-04-11 11:22:13 -06:00
Kareem 4808ce1b8c Add new macro to known macros, reformat comment to fit in max length. 2025-04-10 15:48:50 -07:00
Sean Parkinson 3919491a6a
Merge pull request #8589 from kareem-wolfssl/zd19572
Check if HWCAP_ASIMDRDM is defined.
2025-04-10 08:25:30 +10: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
David Garske a2ca1fe31f
Merge pull request #8641 from gojimmypi/pr-espressif-examples-update
Espressif updates. Kconfig, WOLFSSL_VIS_FOR_TESTS, ESP32P4
2025-04-08 15:09:18 -07:00
Kareem 8e1cfb8b8b Add HWCAP_ASIMDRDM to known macros 2025-04-08 13:42:05 -07:00
Daniel Pouzzner e1ece63942 wolfssl/wolfcrypt/types.h: refactor fallback implementation of wc_static_assert() to depend on __COUNTER__, to avoid namespace collisions on unlucky macro invocations with same line numbers. 2025-04-08 19:01:44 +00:00
gojimmypi 40c52bd844
Espressif updates. Kconfig, WOLFSSL_VIS_FOR_TESTS, ESP32P4 2025-04-06 16:01:35 +02:00
Sean Parkinson c29fba5b7e
Merge pull request #8614 from douzzer/20250317-linuxkm-lkcapi-aes-ctr-ofb-ecb
20250317-linuxkm-lkcapi-aes-ctr-ofb-ecb
2025-04-03 10:45:04 +10: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
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
David Garske a709b16ed2 Adding option for `NO_ECC_CHECK_PUBKEY_ORDER`. ZD 19422 2025-03-24 14:00:23 -07:00
Chris Conlon 7c9ecd39fe
Merge pull request #8550 from lealem47/STM32WBA
Add support for STM32WBA
2025-03-21 09:58:17 -06:00
Daniel Pouzzner 27a582829f .wolfssl_known_macro_extras: get macros back in C-lexical order. 2025-03-20 20:10:16 -05: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
Lealem Amedie 950be33c57 Insert STM32WBA52xx in the right order 2025-03-12 11:58:18 -06:00
Lealem Amedie e13bf4bd7c Add STM32WBA52xx to known macros 2025-03-12 11:08:26 -06:00
Sean Parkinson a7690ca24b ML-KEM/Kyber: finish name change 2025-03-10 08:37:14 +10:00
Daniel Pouzzner f572cffa31 .wolfssl_known_macro_extras: remove unneeded entry. 2025-03-05 18:44:08 -06:00
Daniel Pouzzner de6ac319cc .wolfssl_known_macro_extras: remove unneeded entries. 2025-02-28 18:01:49 -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
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
Jiri Malak a83cf8584d add new macro __UNIX__ to the list of known macros 2025-02-26 01:22:25 +01: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
Sean Parkinson 82b50f19c6 ML-KEM/Kyber: improvements
ML-KEM/Kyber:
  MakeKey call generate random once only for all data.
  Allow MakeKey/Encapsulate/Decapsulate to be compiled separately.
  Pull out public key decoding common to public and private key decode.
Put references to FIPS 140-3 into code. Rename variables to match FIPS
140-3.
  Fix InvNTT assembly code for x64 - more reductions.
  Split out ML-KEM/Kyber tests from api.c.

TLSX:
Store the object instead of the private key when WOLFSSL_MLKEM_CACHE_A
is defined or WOLFSSL_TLSX_PQC_MLKEM_STORE_OBJ. Faster decapsulation
when A is cached and object stored.
To store private key as normal define
WOLFSSL_TLSX_PQC_MLKEM_STORE_PRIV_KEY.

misc.c: when Intel x64 build, assume able to read/write unaligned
2025-02-20 08:14:15 +10:00
Daniel Pouzzner 10d5d59977 add .github/workflows/opensslcoexist.yml. fix TEST_OPENSSL_COEXIST section of wolfssl/ssl.h for compatibility with OpenSSL <3.2. also, remove frivolous entry for WOLFSSL_HMAC_COPY_HASH in .wolfssl_known_macro_extras. 2025-02-14 12:19:12 -06:00
Daniel Pouzzner e806bd76bb
Merge pull request #8445 from SparkiDev/perf_improv_1
Performance improvements
2025-02-13 23:25:47 -06:00
David Garske 746aa9b171
Merge pull request #8443 from ColtonWilley/add_cert_rel_prefix
Add a cert relative prefix option for tests
2025-02-13 14:48:06 -08:00
Colton Willey b119182c9d Add to known macro list 2025-02-13 09:35:39 -08:00