Skip to content

Zephyr: wolfSSL module support for the wolfPSA provider and native RTOS use#10983

Open
Frauschi wants to merge 2 commits into
wolfSSL:masterfrom
Frauschi:zephyr_fixes
Open

Zephyr: wolfSSL module support for the wolfPSA provider and native RTOS use#10983
Frauschi wants to merge 2 commits into
wolfSSL:masterfrom
Frauschi:zephyr_fixes

Conversation

@Frauschi

Copy link
Copy Markdown
Contributor

Summary

Extends the wolfSSL Zephyr module to support two coupled efforts: wolfPSA as Zephyr's PSA Crypto provider and the wolfSSL secure-sockets TLS backend.

What's included

Native RTOS threading

  • wolfCrypt's Zephyr port now uses k_mutex / k_thread / k_condvar directly, with no dependency on CONFIG_POSIX_THREADS; k_condvar use is gated on the kernel version.
  • WOLFSSL_SINGLE_THREADED defaults from !MULTITHREADING, so single-threaded kernels need no manual opt-in and consumers (wolfPSA) don't have to select it.
  • New zephyr/tests/wolfssl_condvar ztest exercises the native condvar path, wired into CI.

Configuration interface

  • A user-supplied CONFIG_WOLFSSL_SETTINGS_FILE is authoritative; the module never layers Kconfig #defines over it.
  • Many new Kconfig knobs (WOLFSSL_CRYPTO_ONLY, WOLFSSL_SINGLE_THREADED) plus new classic-crypto / TLS / PQC feature knobs — RSA, ECC, ChaCha20-Poly1305, Curve25519, SNI, session cache/tickets, and ML-KEM / ML-DSA / LMS / XMSS / Falcon — each with its memory-reduction "small" option.
  • Replaces the hardcoded HAVE_FIPS_VERSION 5 / _MINOR 3 with a Kconfig choice under WOLFCRYPT_FIPS (default v6). Version triples mirror configure.ac's --enable-fips= mapping exactly. Also defines the HAVE_FIPS master switch, which was previously missing and left the version macros inert.

DRBG seeding

  • wc_GenerateSeed() on Zephyr draws seed material from the hardware entropy driver when present (chunked to the entropy API's uint16_t length, DT_HAS_CHOSEN-guarded), falling back to sys_rand_get(). HAVE_HASHDRBG stays guarded by WC_NO_HASHDRBG.

Misc

  • z_time() reads the native_sim simulator RTC for a real wall clock on native targets, regardless of libc.
  • Benchmark stack tracking: mem_track.h gains a Zephyr StackSizeCheck that runs the benchmark in a measured k_thread and reports high-water-mark stack usage.

Frauschi added 2 commits July 23, 2026 22:42
…OS use

Extend the wolfSSL Zephyr module for the wolfPSA-provider and secure-sockets
efforts:

  - Native RTOS threading: wolfCrypt's Zephyr port uses k_mutex/k_thread/
    k_condvar directly (no CONFIG_POSIX_THREADS), with k_condvar gated on the
    kernel version, covered by a native-threading ztest wired into CI.
  - Config interface: a user-supplied CONFIG_WOLFSSL_SETTINGS_FILE is
    authoritative and the module never layers Kconfig #defines over it. The
    module-default block is shaped by build-profile knobs (WOLFSSL_CRYPTO_ONLY,
    WOLFSSL_SINGLE_THREADED, which now defaults from !MULTITHREADING) plus new
    classic-crypto/TLS/PQC feature knobs (RSA/ECC/ChaCha-Poly/Curve25519/SNI/
    session-cache/session-ticket and ML-KEM/ML-DSA/LMS/XMSS/Falcon, each with
    its memory-reduction "small" options). A consumer such as wolfPSA validates
    its own requirements rather than the module injecting them.
  - DRBG seeding: wc_GenerateSeed() on Zephyr draws seed material from the
    hardware entropy driver when present (chunked to the entropy API's uint16_t
    length, DT_HAS_CHOSEN-guarded) and falls back to sys_rand_get() otherwise;
    HAVE_HASHDRBG stays guarded by WC_NO_HASHDRBG.
  - z_time(): read the native_sim simulator RTC for a real wall clock on the
    native targets regardless of libc.

Verified on native_sim/native/64 and nucleo_h743zi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant