Zephyr: add wolfPSA as a Zephyr PSA Crypto provider#21
Open
Frauschi wants to merge 1 commit into
Open
Conversation
Add a Zephyr module that plugs wolfPSA into the in-tree PSA_CRYPTO_PROVIDER
choice (CONFIG_PSA_CRYPTO_PROVIDER_CUSTOM, Zephyr >= 4.3), supplying the PSA
Crypto API in place of Mbed TLS while reusing the wolfCrypt core compiled by the
sibling wolfSSL Zephyr module.
- Provider selection depends on WOLFSSL (never selects it) to avoid the socket
Kconfig's !WOLFSSL dependency loop; consumers set CONFIG_WOLFSSL=y.
- The PSA surface is generated at CMake-configure time from the compiled
wolfCrypt config intersected with what wolfPSA implements, so it tracks the
build. wolfPSA owns no wolfCrypt config of its own and follows the wolfSSL
module's, coexisting with the wolfSSL TLS stack in one image.
- Persistent keys are backed by Zephyr secure_storage via a wolfCrypt
AES-256-GCM custom ITS transform (encryption at rest, no Mbed TLS symbol in
the image); ZMS store backend on STM32H7.
- Optional thread-safe key store built on wolfCrypt's portable wc_*Mutex API.
- DRBG seeding is owned by the wolfSSL module; wolfPSA requires HAVE_HASHDRBG.
- Coverage favors Zephyr's own provider-agnostic PSA apps run against wolfPSA,
plus bespoke tests for the key-store lock, entropy path, and ITS transform.
Version numbering tracks wolfSSL.
Contributor
Author
|
The Zephyr CI tests will only succeed once wolfSSL/wolfssl#10983 is merged. |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #21
Scan targets checked: wolfpsa-bugs, wolfpsa-src
No new issues found in the changed files. ✅
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
Adds a Zephyr module (
modules/crypto/wolfPSA) that plugs wolfPSA into Zephyr'sPSA_CRYPTO_PROVIDER_CUSTOMchoice (Zephyr >= 4.3), supplying the PSA Crypto API in place of mbedTLS while reusing the wolfCrypt core compiled by the sibling wolfSSL Zephyr module. This gives Zephyr consumers (BLE host/mesh, TLS/Wi-Fi credentials, secure_storage,samples/psa/*) a wolfCrypt-backed PSA provider — and, paired with wolfCrypt FIPS, a certifiable crypto boundary that mbedTLS's PSA implementation cannot offer.What's included
Provider wiring
depends on WOLFSSL(neverselects it) to avoid the socket Kconfig's!WOLFSSLdependency loop; consumers setCONFIG_WOLFSSL=y.PSA_WANT_*) is generated at CMake-configure time from the compiled wolfCrypt config intersected with what wolfPSA implements (zephyr/gen/gen-crypto-config.py+psa_want_probe.c), so it tracks the build.WOLFCRYPT_ONLY).Persistent keys
secure_storagethrough a wolfCrypt AES-256-GCM custom ITS transform (zephyr/src/psa_its_transform_wolfcrypt.c) — encryption at rest with no Mbed TLS symbol in the image.src/psa_store_zephyr.cmapswolfPSA_Store_*onto the PSA ITS API; ZMS store backend on STM32H7 (128 KB flash sectors).Thread safety & entropy
wc_*MutexAPI.HAVE_HASHDRBG.Coverage
psa_consumerreuses Zephyr'stests/crypto/mbedtls_psaztest), plus bespoke suites: key-store lock (psa_concurrency), entropy path (psa_entropy), ITS transform confidentiality/tamper/uid-binding (psa_transform), persistent keys (psa_persistent_key), key purge (psa_purge), ITS round-trip (psa_its), secure storage (psa_secure_storage), store-unavailable fail-closed stub (psa_store_unavailable), and TLS + PSA coexistence in one image (psa_tls_coexist). Ships apsa_smokesample.Testing
native_sim/native/64and hardware-validated onnucleo_h743zi(STM32H743ZI), including persistent keys stored to on-chip flash via the ZMS ITS backend.Notes / requirements
CONFIG_PSA_CRYPTO_PROVIDER_CUSTOM(the provider seam) was added in Zephyr 4.3; below it the module is inert.CONFIG_WOLFSSL=y. Merge the wolfSSL PR first.