Commit Graph

25210 Commits

Author SHA1 Message Date
Juliusz Sosinowicz
d82d8a53ef wc_HKDF_Expand_ex: correctly advance the index 2025-05-06 13:47:54 +02:00
Sean Parkinson
1c0e5af3a4 Merge pull request #8720 from JacobBarthelmeh/xilinx
add macro guards for SHA3 test cases to unit tests
2025-05-06 10:50:01 +10:00
Sean Parkinson
428915e492 Merge pull request #8719 from philljj/coverity_april_2025
Fix coverity warnings
2025-05-06 10:11:27 +10:00
Sean Parkinson
dfec168402 Merge pull request #8721 from philljj/coverity_misc
Coverity misc
2025-05-06 10:04:53 +10:00
JacobBarthelmeh
3819c352e8 Merge pull request #8728 from dgarske/qat_4.28
Fixes for Intel QuickAssist latest driver (4.28)
2025-05-05 17:48:49 -06:00
David Garske
c2f1563144 Merge pull request #8726 from kareem-wolfssl/zd19786
Pass in correct hash type to wolfSSL_RSA_verify_ex.
2025-05-05 15:38:41 -07:00
Daniel Pouzzner
629d812eb3 Merge pull request #8730 from philljj/linuxkm_pkcs1pad_more
linuxkm rsa: add more pkcs1pad sha variants
2025-05-05 16:59:29 -05:00
philljj
6296dfdb1e Merge pull request #8735 from douzzer/20250502-linuxkm-fixes
20250502-linuxkm-fixes
2025-05-05 16:29:00 -05:00
David Garske
2c0ca1cacb Fix for QAT driver QAT.L.4.28.0-00004 icp include path. Fix for CentOS 7 to allow automake 1.13.4 (works fine). 2025-05-05 13:22:54 -07:00
Daniel Pouzzner
c402d7bd94 Merge pull request #8729 from philljj/linuxkm_ecdh_decode_secret
Linuxkm ecdh decode secret
2025-05-05 14:59:51 -05:00
David Garske
d5cca9d7c9 Merge pull request #8733 from SparkiDev/riscv_hash_raw_fix
RISC-V 64-bit: fix raw hash when using crypto instructions
2025-05-05 12:44:51 -07:00
Kareem
aad15b27a2 Pass in correct hash type to wolfSSL_RSA_verify_ex. 2025-05-05 11:58:26 -07:00
jordan
a341333589 linuxkm rsa: additional pkcs1 sha variants. 2025-05-05 13:50:12 -05:00
jordan
68682f155c linuxkm ecdh: remove dependency on crypto_ecdh_decode_key. 2025-05-05 13:39:13 -05:00
jordan
efd5405d0e coverity: fix check_after_deref, assignment_where_comparison_intended, uninit vars, return values, etc. 2025-05-05 13:18:29 -05: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
jordan
baa7efa8af Fix coverity uninit var warnings, add missing priv key ForceZero. 2025-05-05 13:14:39 -05:00
JacobBarthelmeh
e233ead7f6 add macro guards for SHA3 test cases 2025-05-05 11:19:21 -06:00
David Garske
9587b7b12e Merge pull request #8734 from JacobBarthelmeh/libssh2
update libssh2 test to use stable-slim instead of test-slim
2025-05-05 09:55:57 -07:00
JacobBarthelmeh
5fbe23cfd9 update libssh2 test to use stable-slim instead of test-slim 2025-05-05 10:09:47 -06:00
Sean Parkinson
3acf3ef3c5 RISC-V 64-bit: fix raw hash when using crypto instructions
./configure CC=riscv64-linux-gnu-gcc --host=riscv64 --disable-shared LDFLAGS=--static --enable-riscv-asm=zvkned
Digest state is not always stored in a way that can be directly copied out.
2025-05-03 08:42:17 +10:00
philljj
1075ce8cf4 Merge pull request #8727 from douzzer/20250501-linuxkm-ecdsa-workaround
20250501-linuxkm-ecdsa-workaround
2025-05-01 22:44:48 -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
Daniel Pouzzner
fea5694e1d linuxkm/lkcapi_glue.c: with kernels <6.3.0, disable kernel fips_enabled mode while registering FIPS ECDSA shims, to work around crypto manager bug (not recognized as FIPS-allowed algorithms). 2025-05-01 16:57:55 -05:00
Daniel Pouzzner
a18a8ced23 linuxkm/lkcapi_*_glue.c: in test harnesses, fix several out-of-order NULLing of PTR_ERR-type pointers in error paths. 2025-05-01 16:55:30 -05:00
philljj
937fb03f05 Merge pull request #8718 from douzzer/20250428-linuxkm-stdrng
20250428-linuxkm-stdrng
2025-05-01 15:31:15 -05:00
Lealem Amedie
ac139dfe49 Sniffer: Add multiple sessions by removing cached check 2025-05-01 14:27:35 -04:00
Daniel Pouzzner
5633a2fa76 linuxkm: in configure.ac, fix feature dependency test for --enable-linuxkm-lkcapi-register=stdrng*, and in linuxkm/lkcapi_sha_glue.c, fix PRNG quality test in wc_linuxkm_drbg_startup(). 2025-05-01 13:07:23 -05:00
Daniel Pouzzner
1b59bc25d1 linuxkm:
in lkcapi_sha_glue.c:

    in linuxkm_hmac_setkey_common(), ignore keylength even in FIPS modules (use
    wc_HmacSetKey_ex(..., 1)) on kernel < 6.0 to work around crypto manager bug;

    in wc_linuxkm_drbg_startup(), add rng workout routine using handle from
    crypto_alloc_rng();

  in lkcapi_*_glue.c: fix test routines to return valid wolfCrypt error codes
  consistently;

  in module_hooks.c, implement
    * linuxkm_lkcapi_sysfs_install_node(),
    * linuxkm_lkcapi_sysfs_deinstall_node(),
    * FIPS_rerun_self_test_handler()
  and add corresponding setup/teardown in wolfssl_init() and wolfssl_exit();

  in lkcapi_glue.c:

    refactor linuxkm_lkcapi_sysfs_install and linuxkm_lkcapi_sysfs_deinstall to
    use the new helpers;

    harden the REGISTER_ALG() and UNREGISTER_ALG() macros and the
    linuxkm_lkcapi_register() and linuxkm_lkcapi_unregister() functions, and add
    informational messages about number of algs registered/deregistered;

  in x86_vector_register_glue.c: fix gate for irq_fpu_usable() workaround to
  reflect backporting of fix in >=5.10.180 in 5.10-LTS and >=5.15.39 in 5.15-LTS
  linuxkm/lkcapi_glue.c: move WOLFSSL_DEBUG_TRACE_ERROR_CODES coverage for
  EINVAL/ENOMEM/EBADMSG to module_hooks.c.
2025-05-01 00:08:32 -05: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
4450167ab0 Merge pull request #8707 from philljj/register_dh
linuxkm: register dh and ffdhe.
2025-04-28 23:00:17 -05:00
Sean Parkinson
bb9f3c9f9d Merge pull request #8698 from rlm2002/msys2
adjust MSYS CI Build
2025-04-29 09:03:58 +10:00
Sean Parkinson
d8ab66b39a Merge pull request #8705 from dgarske/stm32_hash
Fix for STM32 Hash with IRQ enabled
2025-04-29 09:00:42 +10:00
Sean Parkinson
03ad93f4eb Merge pull request #8709 from dgarske/win32_wince
Fixes to support _WIN32_WCE (VS 2008 with WinCE 6.0/7.0)
2025-04-29 08:59:58 +10:00
Sean Parkinson
2ce7c2ac4c Merge pull request #8714 from mgrojo/alire-inclusion
Ada: prepare inclusion of v5.8.0 in Alire index
2025-04-29 08:58:24 +10:00
jordan
f6f3b0a1ee linuxkm: register dh and ffdhe. 2025-04-25 21:21:26 -05:00
mgrojo
e6e64515c7 Ada: prepare inclusion of v5.8.0 in Alire index 2025-04-25 20:56:06 +02:00
David Garske
b077c81eb6 Merge pull request #8712 from JacobBarthelmeh/release
prepare for release 5.8.0
v5.8.0-stable
2025-04-24 15:10:41 -07:00
JacobBarthelmeh
e4cb69caef remove trailing space character in changelog 2025-04-24 12:20:23 -07:00
JacobBarthelmeh
9be6a81bab prepare for release 5.8.0 2025-04-24 10:41:40 -07:00
David Garske
81cd5df263 Fixes to support _WIN32_WCE (VS 2008 with WinCE 6.0/7.0). Should have been part of #8621. 2025-04-24 08:18:44 -07:00
David Garske
3a1178f71c Fix for STM32 Hash with NVIC (IRQ) enabled that can cause a DINIS interrupt that does not get cleared. If the HASH NVIC tab has Interrupts enabled it can cause an IRQ to be triggered that is not cleared. This is because the wolfSSL implementation of STM32 Hash does not call the HAL HASH API's and does not use interrupts yet. ZD 19778 2025-04-23 13:55:57 -07:00
JacobBarthelmeh
c22505a71a Merge pull request #8700 from embhorn/rel_fixes_cs
Fixes from CodeSonar report
2025-04-23 11:36:15 -06:00
philljj
204d933f9f Merge pull request #8702 from douzzer/20250422-linuxkm-tweaks
20250422-linuxkm-tweaks
2025-04-22 21:34:13 -05:00
David Garske
68eec91f04 Merge pull request #8701 from JacobBarthelmeh/fuzz
init buffer before creating digest value
2025-04-22 15:20:45 -07:00
Daniel Pouzzner
1f9d0b1612 linuxkm/: fix error checking on malloc()ed values (! ptr, not IS_ERR(ptr)). 2025-04-22 17:11:52 -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
JacobBarthelmeh
43cdc1be74 init buffer before creating digest value 2025-04-22 14:34:16 -06:00
Eric Blankenhorn
66b9256f86 Fixes from CodeSonar report 2025-04-22 14:43:01 -05:00
Daniel Pouzzner
e6f8de7d31 Merge pull request #8699 from JacobBarthelmeh/bn
revert BN_CTX_init stub for older applications
2025-04-22 14:21:01 -05:00