Commit Graph

25198 Commits

Author SHA1 Message Date
David Garske
751dcdf3df Improve the hash wait logic by separating the data input ready from the digest calculation complete. 2025-05-05 14:36:36 -07:00
David Garske
0f4ce03c28 Fixes for NO_AES_192 and NO_AES_256. Added CI test. Fixed bad BUILD_ logic for ADH-AES256-GCM-SHA384. 2025-05-05 14:36:36 -07:00
David Garske
e487685d7d Fix for STM32 Hashing status bit checking logic. ZD 19783. The digest calculation was indicating "not busy" before digest result (DCIS) was finished. This did not show up on most systems because the computation is usually done by the time it reads. 2025-05-05 14:36:36 -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
jordan
68682f155c linuxkm ecdh: remove dependency on crypto_ecdh_decode_key. 2025-05-05 13:39:13 -05: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
Ruby Martin
a1cb6e5ba5 only test msys system, add buffer typecasts 2025-04-22 12:35:12 -06:00
Daniel Pouzzner
25cd009a42 Merge pull request #8695 from JacobBarthelmeh/coverity
null derefernce sanity checks and control flow issue
2025-04-22 11:37:51 -05:00
JacobBarthelmeh
9da9817f89 move test case to the correct location for stub macro guard 2025-04-22 10:09:01 -06:00
JacobBarthelmeh
b22cc12c8d add missing BN_CTX_init define 2025-04-22 09:29:28 -06:00
JacobBarthelmeh
33da20c3ec revert BN_CTX_init stub for older applications 2025-04-22 09:22:40 -06:00
David Garske
3ca444e0e1 Merge pull request #8697 from douzzer/20250419-test_dtls13_ack_order-uninited-read
20250419-test_dtls13_ack_order-uninited-read
2025-04-19 19:44:35 -07:00
Daniel Pouzzner
bbbed009b2 tests/api/test_dtls.c: fix read of uninited data in test_dtls13_ack_order(). 2025-04-19 01:57:51 -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
Daniel Pouzzner
543ba268a4 Merge pull request #8558 from julek-wolfssl/openssh-9.9-fix
wolfSSL_EVP_PKEY_cmp: only compare the public keys
2025-04-19 01:51:49 -05:00
philljj
3cdc521d33 Merge pull request #8696 from douzzer/20250418-linuxkm-lkcapi-cleanup
20250418-linuxkm-lkcapi-cleanup
2025-04-18 20:19:36 -05:00
Daniel Pouzzner
2e31cad4f6 wolfssl/internal.h: clean up WOLFSSL_TEST_VIS comments and an unneeded attr on GetOutputBuffer(). 2025-04-18 18:27:07 -05:00
Daniel Pouzzner
fe244fb41b linuxkm: clean up LKCAPI glue:
typography fixes;

static attr on const byte arrays;

refactor km_ecdsa_verify() to use a single heap allocation;

fix linuxkm_test_ecdsa_nist_driver() to copy sig and hash to a heap allocation before passing to sg_set_buf() (avoids unmapping of rodata);

in linuxkm_test_pkcs1_driver() move hash from stack to heap;

add LINUX_VERSION_CODE >= 5.4 assertion in linuxkm/lkcapi_glue.c;

streamline macro logic in linuxkm/lkcapi_sha_glue.c.
2025-04-18 18:21:57 -05:00