Zephyr: wolfSSL module support for the wolfPSA provider and native RTOS use#10983
Open
Frauschi wants to merge 2 commits into
Open
Zephyr: wolfSSL module support for the wolfPSA provider and native RTOS use#10983Frauschi wants to merge 2 commits into
Frauschi wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
k_mutex/k_thread/k_condvardirectly, with no dependency onCONFIG_POSIX_THREADS;k_condvaruse is gated on the kernel version.WOLFSSL_SINGLE_THREADEDdefaults from!MULTITHREADING, so single-threaded kernels need no manual opt-in and consumers (wolfPSA) don't have to select it.zephyr/tests/wolfssl_condvarztest exercises the native condvar path, wired into CI.Configuration interface
CONFIG_WOLFSSL_SETTINGS_FILEis authoritative; the module never layers Kconfig#defines over it.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.HAVE_FIPS_VERSION 5/_MINOR 3with a KconfigchoiceunderWOLFCRYPT_FIPS(default v6). Version triples mirrorconfigure.ac's--enable-fips=mapping exactly. Also defines theHAVE_FIPSmaster 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'suint16_tlength,DT_HAS_CHOSEN-guarded), falling back tosys_rand_get().HAVE_HASHDRBGstays guarded byWC_NO_HASHDRBG.Misc
z_time()reads the native_sim simulator RTC for a real wall clock on native targets, regardless of libc.mem_track.hgains a ZephyrStackSizeCheckthat runs the benchmark in a measuredk_threadand reports high-water-mark stack usage.